Previously my Dodger game had the goal of avoiding the obstacles. Then I made the symbols mimic Pacman. Now it is time to change the rules of the game. Instead of avoiding obstacles, you are supposed to try to run into the obstacles. In other words, you need to chomp them like Pacman would.
I got rid of the ghosts from Pacman. You normally don't eat them unless you munch a power pellet. I am experimenting with what I should replace the ghosts with. Right now I have some balls that have their colors move around. The effect is nice, except it is monotonous because all the balls change their colors at the same rate.
Today I made some changes to the symbol in my Dodger game. I made everything look like Pacman. Yeah. It might be a bit confusing because this is still a game where you dodge obstacles that fall down the screen. However this puts me ahead of the game when I get around to implementing Pacman.
Things are starting to get out of place in the code. I got one big class that draws everything and controls the movement. Really want to break things up into a few objects. I mean I should have a ghost object, a Pacman object, etc. It will make the cose a lot cleaner I think.
The goal here was just to get practice implementing the game of obstacle dodge. However I would like to come out with some objects I can reuse in future games. I don't think it will take much time to refactor into a couple classes. This is just a repackaging of the method names and where they reside.
Next I am supposed to work on a memory puzzle. You know, the one where you uncover two pieces and try to get them to match. But instead I might jump ahead and make a slider puzzle. That's the one where there are 15 tiles in a big square, with one empty tile. You can slide adjacent tiles into the empty spot. You try to get the 15 tiles in numerical order. Should be fun.
All right now. I added rudimentary scoring to my Dodger game. You get one point for every time the obstacles move and you do not get hit. Yep. That means I implemented some collision detection. At first I thought I would have to check each of the corners of the obstacles to figure out if they bumped into the player. Later that seemed like a waste. I ended up figuring out the region where the upper left hand corner of the obstacle would need to be for there to be a hit.
Where do we go from here? Well if the player hits an obstacles, I just reset the score to zero. I would rather decrement the number of lives the player has. Game will be over when you get to zero lives. Then I will have to use some sexier graphics than just circles and squares. Maybe I could turn the symbology to Pacman and ghosts? Ha ha.
I have been working on a very simple game called Dodger. Previously I just had obstacles moving. Now I added a player symbol. Put up a black background. Added colors for obstacles and the player. The big coup is I got keyboard input working. You can use the arrow keys to move the player left and right.
Next big challenge is to add collision detection. I want there to be a penalty if you crash into an obstacles. This is a dodging game after all. After that I might give the player a couple lives, implement scoring, and we might just have a minimal game on our hands. Go team.
Previously I decided I wanted to write a clone of Pac Man. Sounded legit. But now I think that may have been too ambitious a project. I start school in a week and a half. Wanna get something completed before school demands become too high. Therefore I have reverted back to coding a game called Dodger.
I got the idea from reading a post by Al Sweigart. He is the author of some books about writing games with Python. Al recommends you write a lot (50+) of simple games to learn game development. The first he recommends is this Dodger style game. Bad guys zoom down the screen and you need to avoid them.
I decided to write my game in Java. This is a good excuse to brush up on my Java GUI programming. So far I have randomly placed the bad guys on the screen. And they move downward. Now I need to put up some symbology for the player. Maybe a space ship? I am looking forward to another idea from Al - writing a snake style game. First things first though.
Earlier this summer, I learned how to write Windows 8 apps. It was a tough education. Actually learned most of the lessons by reading a book on writing Windows 8 Apps with C#. Translated the ideas to my C++ apps. Created about 10 apps in all. Six of them are now featured in the Windows store. As soon as I get some cash, I am going to put up a nice web site to market my apps. Right now I have some placeholders on a free web site.
Learned how to write Windows 8 Apps took a toll on me. I was staying up late every night. Stopped exercising. Stopped working on projects out in the yard. Pretty much got into a funk. Ever since I completed the apps, I have not been doing much programming. I think I created maybe 1 mickey mouse sized utility in Java. Whew. I need to get back to coding.
Today I decided I would write a Pacman clone. That is a sizeable task. I think I am up to it. Only have a month before the fall semester starts at school. This semester I am taking a tough class (intro to PHP). So I need to knock out Pacman in the next month or so. Baby steps though. First chore is to write the Pacman Level Editor (PLE). This will allow me to draw and save the maze. That will be a cool little tool. I think I shall write it in Java for kicks.