Questions about creating a game, with HGE!

Hello!

Our class has been asked to create a game in C++, with the HGE library, now during the holidays. We got some requirements to fulfill to pass the course, which are:

* Atleast 3 classes (1 base-class and 2 inherited)
* A container (array, vector, list, etc.) that stores game event in its base form and then through polymorphism calling the right methods for updating and printing
* Collision
* Some kind of "AI" (switch case/FSM/behaviour tree... etc)

My idea is to create a game like "Catch the Beer", since it is kinda simple (I am not very good at programming, so I need something that is easy!). The character will be a crab that is trying to catch coconuts falling from the trees, into the box he is carrying. So, here are my questions:

- Is it possible to make some kind of intro before the game starts, like some snapshots with "lore"?

- Is it hard or easy to make an AI that stands in the corner of the screen, changing his mood, depending on: if I miss or catch a lot?

- Any thoughts or recommendations before I start?

If you know some good links or guides, I would be really glad if you could share them!

Thanks and have a nice day!

I recently learned about finite-state-machines, which is a great way to organize a game.

A finite-state-machine is a virtual class you create which only has one method, "run". You then make a few class which inherit from this one. Each subclass represents a different game state (splash screen, menu, playing) and has its own "run" method.

The advantage of having a parent class is that you can then make a list of pointers to the different game states. std::list<gamestate*> gamestates; When the game starts, there is an iterator pointing on the first element of the gamestates list, which points to the splash screen object. It executes the run() method of that object, showing a splash screen. You also need a way to tell the list which gamestate to call next. This could be made with a return from the run method (1 means next state, 0 means repeat same state, -1 means previous state...). So at the end of the run() method of the splashscreen object, you return 1; The iterator then moves to the second element of the list, which points to the menu object...

You could probably use better structures than lists for that, I'm not sure how I'll do it for my own game...

A good way to see this finite-state machine is to imagine a tape reader, where each image of the film is a game state.
Last edited on
closed account (iAk3T05o)
HGE seems deserted ... since 2008. You could use polycode (if it wasn't mandatory to use HGE)
Last edited on
Topic archived. No new replies allowed.