However, I have had time for a little tinker this week. I decided to brush off some old sprites and have a go at recreating Joust, an old arcade game from the 80s. I'm doing it in Python/Pygame, using an object-oriented method.
I have the following classes:
playerClass: A class which will only really contain the player sprite
platformClass: a class for platforms, which can have different positions and image attributes. I know the platforms in Joust don't move, but this allows me some flexibility to re-use code if I need it.
I can foresee the need for:
enemyClass: the enemies will need to be able to think for themselves a little. Not sure how, yet.
eggClass: when you hit an enemy, it turns into an egg. It needs to roll around, come to a halt and eventually hatch if left alone.
lavaClass: ? To detect if the player or an egg has landed in the lava?
Anyway, I may not get that far. At the moment I have been concentrating on the control and "feel" of the player sprite. It needs to have momentum, be affected by gravity and respond properly to the player's "flap" command. It needs to detect when it is close to a platform, and switch between walking and flying as appropriate. When flying, it needs to bounce off the sides of platforms. I think I have done most of this so far. At present I have only populated the level with one platform, and the player seems to behave itself around that platform. I haven't programmed what happens if it approaches a platform from below yet.