Friday, March 9, 2012

A New Game

I'm pretty much done coding Color Coder and my puzzle game so I've started working on a new game in the last couple days. Well, it's a new Android game. It's a conversion of the Zombie Maze game I worked on when I was playing around with OpenGL. You can see a video of that project HERE. I have a lot of the basic code done already from that project, so this new project has been going very well. There are only a couple conversion issues that have been hard to deal with switching from OpenGL C++ to AndEngine Java. With the OpenGL I did all the collision detection myself, and now I can handle it with AndEngine. This sounds like it would be way easier, but it has actually left me with a couple of problems to work through. For example, with the OpenGL project, the walls were all individual, but with the Android project, the walls were all a single image so they couldn't be differentiated. The solution I came up with was to use the AndEngine Line class to outline all the walls and then detect collisions with those instead of the wall pictures.

Right now the game is actually a tiny bit playable. I've added an AndEngine control that looks a bit like a thumb stick and that moves around the player. Eight zombies randomly spawn, each in one of 16 predetermined spawn points. When the game starts, the zombies move through the maze towards the player. When a zombie reaches the player and makes contact, the zombie dies, and the player takes a point in damage. If the player takes 4 hits, they also die. The zombie movements are the extremely simple for now. If the player is above the zombie, the zombie moves up. If the player is below the zombie, the zombie moves down. Same deal with left and right. I'll be making the movement stuff better like it was the OpenGL version. That way the zombies negotiate around walls instead of just stopping at them if they are lined up with the player. I'm going to take this opportunity to clean it up a bit from the way it was in old version. A lot of my work today was creating a hero class and a zombie class, and then the different playable characters will inherit from the hero class.

I'm going to start with just the first character, get the game all working with that, then make the rest of the characters. Getting the game working means I need to add projectiles and weapons, zombie respawning, at least 2 more maps, and a few smaller things like player/zombie animations depending on what direction they are moving, etc. But the next thing I'll be working on is the better zombie movements.

No comments:

Post a Comment