Adrian Chen

A New Day in Unity

c#, development, game, learning

The few indie game developers forums I’ve join, whenever someone makes post on #screenshotsaturday, my first question would always be “What did you used to build this with!?”

I’ve been spamming that for the past few months, and realised that a big portion of games are built with Unity3d. so I’ve decided to give this a shot and do some learning and tutorials~!

"Unity"

Conclusion

In the past I have only tried building games with a few javascript games frameworks; impact.js, crafty.js, Phaser, etc. There’s some really positive points using unity comparing it to these js frameworks.

The one thing I love most is the ease on publishing and building your game onto different platforms, such as html5, iOS, android, windows, mac, etc. Everything is within one package. Where as I had to use 3rd party tools to help me do things like this when i have built a web canvas game and wants to publishing onto the iOS for example.

I really really like is how easy it was on building the levels and positioning things. Impact.js provided an level editor but it is still pretty clunky, with the other frameworks there’s a bit of trial and error with placing things with code. Generally overall I think I prefer building stuff with Unity than the game javascript frameworks.

Google Live Case Color - Pixel

case, google, live, phone, pixel, tech

Recently Bought a maps Live case for my google pixel from the google store. I spent some time choosing the color theme and the map location for my case. Just arrived today, the color on the case was way off, the black theme I selected was almost at a purple color, waited ages for the case to arrive as well 😩… This is what it looked like: "Google Map Live Case"

I’ve contacted the google’s team and let them know about the color issue, they say they are looking into it. Hopefully they can sort it out soon.

Raspberry Pi Torrent Box

gear, hardware, mini-project, pi, raspberry

With the new release of the Raspberry Pi 2, it reminded me of the old Raspberry Pi model B I have that’s covered in dust doing nothing. Feeling a bit sad for my Raspberry Pi I decided to turn it into something useful, a 24/7 bit torrent client. For downloading erm… all the public domain legal earth watching that I do.

The Pi’s power consumption is so low, it almost cost nothing on your electricity bill, and it’s passive cooling which means it noiseless.

I mostly followed this guide here on setting up Deluge the bit torrent client & samba share on the Raspberry Pi.

When I first tried out the guide, I had an self powered external hard drive that I plugged straight into the Pi, however when ever we try to access the files more than a minute, I would get an I/O error writing to ... then I would have to remount the drive on the pi. After trying out different combination of the format and partition of the hard disk… it turned out there was a power surge on the hard disk USB plug, when it connects to the Pi it would disrupt it’s operation.

This is my working solution:

"Setup of the Raspberry Pi torrent box using the powered usb hub and external hard drive"

I Added a powered usb hub between the Raspberry Pi and the external hard disk to make sure the hard disk is not drawing power from the Pi, and also changed the external hard disk to be one of the simple plug and play WD My Passport without any power source, this have been running smoothly without an issue so far for the past 2 months, quietly sitting on my shelf next the my router~ Hope this will help some of us who had the similar problem on external hard drive with the raspberry pi.

Quick PHP Server

gulp, impactjs, nodejs, php, workflow

I’ve been playing with ImpactJS for a while, I’ve found myself needing to run a php server to use it’s level editor Weltmister.

I didn’t want to install a full server stack solution like mamp, xampp, etc… As I already use gulp for the streaming build system. The simplest solution I’ve found is to run php and nodejs side by side. You can fire up a quick php server using it’s built-in web server:

1
2
$ cd ~/impactJs
$ php -S localhost:9090

How to Settimeout in Jasmine 2

jasmine, tdd, test, timeout

The waitsFor funciton for asynchronous specs have been removed in Jasmine 2, instead we have a done callback argument that when present, will make Jasmine consider its coresponding block as asynchronous, and waits for it to be invoked before timing out or finishing the spec, very similar to how Mocha does it’s async tests.

1
2
3
4
5
6
7
8
describe "When fetched", ->
  beforeEach: (done)->
      account.fetch
          success: ->
              done()

  it "should update its stock price", ->
      expect(account.name).toEqual("Adrian")

This is all well and good, until I ran into a problem when doing intergration test with my app that includes thrid party library that I can’t really dig into, in mycase it was the Google Maps API. To use the done syntax, you require to have an entry point of knowing when your ajax call finishes to raise the done event.

To get round this you need to use the good old setTimeout method like so:

1
2
3
4
5
6
7
8
9
10
11
12
describe "on running a search", ->
    it "returns places", (done) ->
        places = null
        $(searchBox).on "placesChanged", (e, data) ->
          places = data
          expect(places.length).toBeGreaterThan 0
          done()
        setInputVal = ->
          input.val("London")
          input.focus().simulate("keydown", { keyCode: 13 })
        # No way for us to know exactly when the Google SearchBox is ready for input ...
        setTimeout(setInputVal, 1000)

In my opinion the waitsFor function still has a place in Jasmine, the done callback syntax doesn’t completely replaces waitsFor.

Should You Buy a Cheap Apple Keyboard Knockoff

apple, gear, keyboards

Should You Buy a Cheap Apple Keyboard Knockoff?

I recently stumbled on an apple ‘like’ wireless keyboard called iWantIt it looks like the apple wireless keyboard but it’s 100% cheap plastic.

It was on offer for £ 8.99 in Currys (a British electrical retailer). It so happens I was looking at an official apple wireless keyboard the day before, which is selling for £53.99 at Amazon.

Cheap apple keyboard

At a first glance the layout is very similar to the apple keyboard, and with a price of £8.99. I thought this may work, and bought it…

TLDR: Should You Buy a Cheap Apple Keyboard knockoff? No, save up if your broke. So many flaws makes this un-usable.

When I rest my hand on top of the keyboard, first thing i noticed was the angle of this is steeper than the apple keyboard, you need to raise curl your fingers a bit more to type.

steep

Whenever I press a key, the rest of the keyboard sort of cave in and bend into the pressure point of I’m typing, this may or may not be a problem for you, depending how hard you press down when typing.

There’s also a bit of a ‘recoil’ like shooting a gun in CoD. Soon as you gain some speed when typing, it would nudge and move a little on the table, and wouldn’t stay put.

Typing

This key on the top left… (You mean the esc key?) WRONG!!! It’s an home button… A freaking home button… To use it as an esc key, you have to hold down the fn key. I don’t know about you guys, but I tend press the esc key quite a lot, and so far this is driving me nuts.

esc key

I tried coming up with at least 1 good point about this keyboard, but I just can’t think of any.

So yeah kids… Don’t buy cheap apple keyboards knockoff…