The pixel…it moves!
August 28, 2010
Posted by on
After struggling a good while to get c++ and netbeans talking, and figuring out how the netbeans ide is supposed to work, I finally got my hello world to compile.
Next stop, graphics initialization. Luckily with Allegro that is quite easy. And left me another hour trying to figure out how to get keyboard input working.
Once I got that under control, I start moving a pixel…that’s right…I got to move a pixel in the direction of my choosing. Some say I don’t have control over my life…well, I do over that damn pixel.
So I created an object : movealbeObject (good name hey!). Which now has a speed, direction, x and y coordinates. I assigned a new rectangle to another object called, gameCharacter which extends my moveableObject. Currently this one has a few more properties to be extended, it has bullets and a weapon.
I then did some work on getting my rectangle to shoot a pixel. This pixel will travel to the end of the screen and reset.
O yeah! So that is where I decided to go to bed. I got a rectangle that can move forwards and backwards, move direction and shoot one bullet.
I think the next step will be to create a bullet object. This should extend moveableObject and have some other properties like damage.
I will also need to start thinking about a weapon object. What kind of properties?
magazine size, fire rate etc.
But first, food.
I forgot about collision detection!!! Right…that will be my first task.