A First Crack at HTML5/JavaScript Game Development

Posted on

For a while now I’ve been wanting to start writing JavaScript/HTML5 based games for the web.  I’ve always been drawn to simple games like the old Asteroids and Galaga where you have a ship and a bunch of bad stuff trying to destroy you. They’re easy to learn, play and waste your time with and yes, they give you that easy, addictive sense that you are actually accomplishing something worthwhile when you break your high score by one point.

One of the coolest modern versions of these old arcade classics is actually kind of useful. Ztype  is a simple shooter game along the lines of Galaga but you are shooting words and you have to type them in correctly or your ship doesn’t shoot. It’s an addictive game with great graphics and sounds.

ZTYPE

 

But I needed something simpler to get me started and familiar with the game engine I had chosen to start with – Phaser. I found an amazing tutorial on how to re-build Asteroids over on zekechan.net. It is surprisingly straightforward, provides full code to check yours against, is easy to follow but goes in depth enough to take you through developing an entire game.

Asteroids screenshot

 

However, by the time I was finished building the game, I was a little bored with the idea of a ship trying to destroy asteroids so I switched it up a bit to include a political theme appropriate for the current presidential race. You can check it out at http://ryanrandom.com/ted .

Ted Cruz vs Donald Trump

 

Keeping My House From Burning

Posted on

Late last year my family and I moved to a two story, 1970’s era house on 1 1/2 acres of land. Since then I’ve been thinking about retrofitting the house with Ethernet cable to most rooms. This is just one of many projects I have planned to update the house and add a few “smart home” features to make management of it and the property easier.

But before I can move on to the fun stuff (or the Ethernet cabling which I don’t consider much fun) there are a few projects that have to be finished out of necessity. I undertook one of them last weekend in the hopes of preventing the house from burning down. Let me explain.

A couple of months ago we finished up a project converting the garage into livable space. In the process of the renovation we discovered that the existing 30 amp dryer circuit was wired using aluminum wire. This wasn’t necessarily a bad thing since the wire was sized right but our building inspector wanted to see a four prong dryer outlet which meant running a new four wire cable.

So my electrician pulled the breaker and put in a new circuit. That problem was solved but now, all of a sudden, my irrigation pump wasn’t getting power. We started poking around and discovered that someone, years ago, had simply continued the dryer circuit from the laundry room, through the wall and out to the pump.

This was a major problem for two reasons:

1. The spliced-in wire going to the pump was only 12 gauge which is only big enough for a 20 amp circuit.
2. The splice combined copper and aluminum wires under the same screw.

The smaller gauge wire basically caused it to act as a giant fuse that, technically, could have burned up. Almost all of it was in conduit, however, so it probably wouldn’t have caused much damage. But it was still a problem.

The bigger issue to me was the mixing of copper and aluminum wire. That combination can lead to a chemical reaction called electrolysis which can cause oxidation, which increases the resistance of the wire dramatically leading to excessive heat build-up and potentially causing a fire.

 

None of this was of immediate concern since the circuit was dead and the dryer was on its own now. But I needed my irrigation pump back on so I could:

1. Keep my landscape from dying.
2. Put in an automatic irrigation system and potentially add wifi connectivity so I can turn my sprinklers on from Fiji – just in case I need to.

Thankfully my irrigation pump only needed a 20 amp circuit so the 12 gauge wire could stay. I also wanted to reuse the existing aluminum wire since it wouldn’t cost anything to keep it and it was already run through the house. All I really needed to do was take care of the aluminum to copper problem. There is a special connector called Alumicon but my aluminum wiring was too big (8 gauge) for it.

I opted for tin-plated aluminum splicing blocks which are approved for both copper and aluminum wire. The copper wire goes in one side of the block and gets screwed down while the aluminum wire goes in the other side and gets secured. The two metals never touch! Wrapped with some rubber splicing tape they actually look pretty good.

Now I can water my grass, not worry about my house burning down (at least for one reason) and start thinking about my next, hopefully more fun, project. Not a bad weekend.

Please Update Old ESRI JavaScript API Samples

Posted on

I’m confused – why does ESRI insist on keeping JavaScript API samples written in a legacy (non-AMD) module require style? I can understand keeping the legacy code in the API reference since a lot of developers probably wrote a lot of code using it. But current sample code should reflect current programming styles. And yes, the samples I’m talking about are the current ones.

ESRI Javascript API screenshot

Somebody actually goes in and updates the CDN reference to the current JavaScript API. Would it be that difficult to convert the requires to an AMD wrapper and change a few module references? Just a thought.