It’s been an interesting week at HG HQ…wait, exciting idea incoming…I shall write this week’s blog using only capitalised two-letter codes, each letter representing a word. TW BA.
TF PT SD TS WW AP. TP WB AC FA FD OO GW IS.
It took a long time for me to figure out the above sentences, so long that I’ve given up on the idea of doing it for the rest of the blog. Excitement over, let’s begin.
Husky Games HQ has been busy this week because our first prototype of the main game mechanic was ready. The Corona SDK has made it possible for me to code so quickly, but not only that, the prototype is also playable on the iPhone’s of those in the know. Oh, yes indeed.
The interesting bit of the week was the ensuing back-and-forth between myself and Nofi as we tried to tweak the main formula. The game has awesome written all over it – local gameRating = display.newText(“Awesome”) for the technically inclined – but the prototype immediately threw up some issues that pre-production images failed to highlight. This is the point where the development process can hit a brick wall, but a calm approach combined with the speed of prototyping offered by Corona meant that we identified the major problems and, we think, their solutions.
Next week’s task then is to implement the changes, and playtest to make sure we’ve got them right.
Before I continue with some more technical stuff for the geeks – so that’s all of you then – I want to mention our stance with regards to revealing what the game actually is. Stance: Not going to reveal. Yet.
We don’t want to tease you so much that you lose interest, but equally we don’t want to divulge too much information as we have to protect ourselves. We will be letting slip bits of info along the way, but please don’t take the teasing as a deliberate means of inciting violence, but as a way of giving you info without it harming our IP.
IP! Get me!
There now follows some technical blogging for those interested in that part of the process. I’m not yet an expert in either the Corona SDK or Lua, but I’ve been programming for more years than many readers have been alive so I know my For..While from my Repeat..Next loops
Despite my overly dramatic statements last time, Corona doesn’t actually write the game for you. I see this as a flaw, but given what Corona does provide it’s a flaw I can work around. In essence, Corona provides a mechanism for the constant update of your device’s screen, at either 30 or 60 fps. If you draw something to the screen it stays drawn until you remove it. This contrasts with other environments I’ve used where you would need to draw to the screen yourself every frame. The first thing that I really liked about Corona though was how it handled these drawn objects, or display objects in Corona-speak.
A display object is the unit of currency as far as drawing to the screen. The beauty of Corona is that all objects that are drawn to the screen are of the same type, i.e. a display object. Those of you with OOP tendencies are salivating now, and you’d be right to. Because of this simple Corona truth you can write code to handle your objects’ updates, and easily switch the type of object by only altering one line of code. For example:
local myShape = display.newRect(100, 100, 100, 100)
This will draw a rectangle on the screen, 100 x 100 pixels in size. As games go, that’s pretty boring, so you might jazz it up with some other code like this:
myShape.x = myShape.x + 50
myShape.y = myShape.y – 10
This would move the rectangle to another point on the screen. Corona’s brilliance with display objects comes to the fore when you decide you don’t want a rectangle anymore, but you want that delicious sprite that Nofi drew. So, to put the sprite into the game you change your original line of code to:
local myShape = display.newImage(“delicious-sprite.png”)
Do that, and suddenly it’s the sprite moving around the screen and not the rectangle. It may seem a trivial point, but as a developer it’s very useful. In our game we started out prototyping using rectangles. However, after play-testing we decided to try out some sprites instead, and just one code change later it was done. Now we can easily switch between the two as we decide on the final look for the game.
That’s enough for this week, but tune-in again next week when hopefully we can reveal a little more and I can continue my coding masterclass. Right after I’ve worked out the difference between global and local variables…
Once again, I’d like to thank the team at Ansca Mobile for their support with the Corona SDK.