Progress with ‘Pit’
Today i made serious progress with ‘Pit’. Starting from scratch i began by displaying the sprite representing the ground (yeah, great achievement…). After that i did the three blockades that stop the stones from falling on your head but slowly deteriorate from the impacts. Implementing the falling stones presented me with the first real challenge. I wanted to code them as a list of a struct, but that approach grinded to a sudden hold when i didn’t manage to change the struct values (namely the y-position) in a foreach loop. After almost two hours of trying to get that to work (searching the web din’t help much) i decided to screw that and went for an array instead. Feels a bit clumsy but works, so who cares - it’s my first XNA project anway.
The next thing was to code the collision detection between the stones and the barrier - using ‘higher’ programming languages as blitz basic i was accustomned to do that by calling already existing functions - here i had to do it all by myself. After a short time i realised it wasn’t that big of a problem though, it went quite smoothly.
So here is what i have as of now:
Falling stones, randomly generated. Collision detection between stones and barriers with code that handles the decay of the barrier. A player sprite that can move and collision detection between that sprite and the falling stones. So what do do now is implement further game logic (score, loosing life if hit by stone and the collecting/delivering of the main objective, namely the money bag). I also have to do the title and instruction screens and plan to do a little intro simulating the loading of the game using the VIC-20’s LOAD “PIT”,8 command.
In the screenshot on the upper left you can see the number 597 which actually is not the score but represents the x-position of the player sprite and is generated by an instance of my CommodoreTextscreen class - that class came in quite handy for providing realtime debugging information right on the game screen several times today.
I realise this is a very simple and primitive game but considering that i did not have any C# nor C++ (and very little C) experience before starting this blog i am quite pleased with the progress i made. If there are no more big obstacles to overcome the game may even be finished tomorrow. I will definately make an xbox 360 version of it and coding the gamepad control system may be the biggest remaining challenge as i don’t know yet if i should go for analog or digital controls, so there may be some experimenting to do.