Friday, 26 August 2011

Let's Shoot!

Thursday 25th August 2011

Okay, so I got the Sheep to jump, got the background to scroll. So what now? Well, this phase was quite a short phase for yesterday, but it was worth the effort. Since I last worked on Woolly Jumper, I got the player to jump, and also shoot, but there was still something missing. Yes, that's right. No collision or animation.

The first thing I worked on was the collision detection. A simple software Collision routine which uses the box-type collision (Sometimes that cannot be reliable, but if adjusted correctly the box collision should work okay. That's the method that I used for Sub Hunter :). The first thing I did was to write a subroutine that would read the player's virtual/ghost position and store it into a table of four bytes. I did this for the player's collision, and I also did that for the player bullet collision.

Now for the most interesting part. To get the collision working, I had to type in a string of code (quite a long string to be honest) for the player/enemy collision and enemy/bullet collision. Mainly by simply comparing whether or not the player, the bullet or the enemy collides into the target range of each other. If that happens, then something happens. At the moment I got it where the player crashes into an enemy, the border flashes (a temporary indicator to show the player dead). Also if the player bullet's sprite hits the enemy, both bullet and enemy disappears.

I got the aliens to move at different speed, but that was just a temporary thing. I also added temporary animation frames for the enemies and their bullet as well.

I received an email from Shaun about the jumping, it still does not seem to be right yet. Also the player stops at the very top border when jumping. It has been suggested that the player should be able to leave the screen if jumping at a high position, otherwise it would make the game unfair. I have a possible solution, but it could probably affect other sprites (after being shot). Basically open the top border, which the player can jump over.

He also suggested to me that the sheep should also jump on to the barrels (and possible crates as well). Which I originally thought was just simple background. Also the player seems to sink in part of the background by a few pixels. Well, those should hopefully be no problem for me to fix. As on Saturday (Because I'm taking a programming break tomorrow) I will be fixing this, and also (if I have the time) make the enemies trigger happy. Then it's the random movements for the enemies - some bouncing ones too) . This should then turn into a game to play :)

No comments:

Post a Comment