Monday, December 10, 2012

Chipping Away

Nothing dramatic to report for this last week, just grinding away at script tweaks and small art assets, trying to bring the overall picture of a single level of gameplay into focus. A few details:

I finally implemented the player's follow camera, fixing the main camera on an invisible child GameObject of the player called "playerFocus" and located a few dozen pixels over the player's head. Once I could move the player around while keeping them onscreen, I of course had to expand the level, which required a new batch of tiles for the sides of the dirt/sidewalk elevations, and got me excited about expanding the map up and down which will require tiles for fire escapes and the underground bus tunnel ... it's starting to look like the gameplay template here is less Mario and more Ghosts and Goblins; the level will be about half the width of a Mario level but with three distinct vertical regions (ground, air, underground). We'll have a "door" of some kind at the right to leave the level, and some sort of collectible "key pieces" at various places on the map, so you get a few minutes of exploration / scavenger hunt, some combat, maybe a puzzle or two, then it's on to the next level. There are nine levels, each with their own backgrounds, objects and enemies, most of which will be unique but a few will be palette swapped or duplicated from other levels to cut down on overall asset workload (although it is still going to be a heinous amount of work).

I also sketched in the sprite and walk cycle of one of the first Pioneer Square enemies, sort of visible as a blob up there, a skeleton with a leather jacket and green army helmet, wielding a kitchen knife. I needed some generic baddies for this game, I considered robots (may still add some) but I kept coming back to my love for the humble Fighting Skeleton, a classic gaming staple who has fortuitously eluded this decade's rampart overuse of ... certain types of undead. I pictured a classic "lead miniature" type of skeleton, but replacing the traditional buckler and scimitar with accouterments from 70's era gangsploitation schlock like The Warriors. Coming soon, a skeleton with combat boots, a rainbow mohawk and a broken bottle, also a skeleton dog with a spiked collar. that will probably be the next big code bottleneck too (once I get some bugs with the acoustic waves sorted properly): coming up with lunges and stabs and other attack movements for these guys.

The only code funkiness I dealt with this week was a little quirk of C#: while in Javascript it's perfectly fine to manipulate a Vector3 like this:

var cameraPosition : Vector3 = (1,1,1);
cameraPosition.x += 5;


C# will not allow you to change individual components of a complex variable like a Vector3. Instead you have to change the whole thing, formulating it like this:

public Vector3 cameraPosition = (1,1,1);
public float cameraXDelta = 5.0f;
cameraPosition =  new Vector3(cameraPosition.x + cameraXDelta, cameraPosition.y, cameraPosition.z);


I'm not sure why this is the case, but generally the answer to such things is: javaScript is doing it the hard way too, it's just nice enough to hide a lot of the work under the hood. I'm sure one day I'll appreciate the convenience and go back to simpler scripting languages for simpler tasks, but right now I'm all about looking under the hood whenever I can, even if I don't understand half of what's going on down there.




No comments:

Post a Comment