Red elephant
I had a hard time trying to go to sleep last night. I finally fell asleep at about midnight and woke up at about 8 a.m. or so. I decided to attempt to put a moving red elephant in the game. But I had a problem. The widest an object can be is 8 pixels. So I needed to put two objects side by side to make a decent looking elephant. At first I had to double the x and y positions for the two things and make x's position 7 pixels to the right of the left half of the elephant sprite. Having to find just the right way to put two sprites side by side with no weirdness in the middle of it was a pain. But once I did that, I thought "Instead of using precious lisu's, why not just make it so when it comes time to draw the second sprite, just increase the x's position by 7." Skeptical of myself, I thought I wasn't going to be able to do this but lo and behold, I had my elephant moving down the screen with animated legs.
Each half of the elephant is 8 pixels wide, making for a 16-pixel wide thing, but in order to not mess things up, I don't think I can move it left and right without causing havoc. Which is okay because I only wanted the elephant to move down the screen anyway. If you count the pixels, you'll find it's only 14 pixels wide. The extra two pixels are for boundary and have been zeroed out.
So now the next things to do are:
- make the elephant come down at a random x position (one of 16 x positions should be a wide enough play area.
- put the celery in the game at the bottom.
- make celery able to move its x position.
- collision detection.
- and a score.
I changed the font of the title screen. I don't want every game I do to just use Arial, so I try to mix fonts up a little so they don't look the same.
I really wanted the background to be light blue while having the middle stripes of the celery be light green, but I guess I can't.
- 1
1 Comment
Recommended Comments