HuskyGames Dev Diary 003

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…

– ARTICLE CONTINUES BELOW –

Once again, I’d like to thank the team at Ansca Mobile for their support with the Corona SDK.

– PAGE CONTINUES BELOW –

18 Comments

  1. Sony is going to kill for you posting the PS3 jailbreak code.

  2. Great read. I assume you need an Apple dev account to run the current builds?

    Just had a look at the Corona website and I can get a subscription for about £30. Might try it out sometime and have a mess around. It would be beneficial to try and learn some of this stuff before university I think.

  3. Not much of a tech-head, but it’s great to get a break down of what you lads are doing. I have £0.61 left on my iTunes account, eagerly awaiting this, you know…

  4. Ah, takes me back to times spent peeking and poking on my Commodores, looking forward to hearing more about it.

  5. @Pemberton_ You can run stuff on the Corona simulator so you don’t necessarily need to build to the device. However, the simulator only does so much eg it can’t do multitouch. Corona is free if you are building to your own device. But, yeah, you’ll need an Apple Dev sub so you can build to a device.

  6. Can we expect a *rough* release date?

  7. Allowing the implementation to be changed at run-time isn’t anything new, is it? Design principle: “Program to an interface, not an implementation”. Or am I missing something…?

  8. Er, yes, roughly this year!

  9. @Gadbury I’ve no idea if you are missing anything. I wasn’t suggesting Corona is full of new concepts, merely that its support for its display objects is something that I like.

  10. Corona seems similar to C#…
    Hey, I made a game in that… maybe I can do this.

Comments are now closed for this post.