This site requires JavaScript, please enable it in your browser!
Greenfoot back
Ectomorph
Ectomorph wrote ...

2018/3/29

Shooting Answers

Ectomorph Ectomorph

2018/3/29

#
I'm a programming virgin. As part of a computing diploma i'm having to build an educational game for a school. My idea was to build a game that was very simlar to space invaders. My hero sits at the bottom of the world and is able to move left and right to aviod falling asteroids. At the same time there is a maths question at the top of the world with three possible answers dotted below it. The aim of the game is to avoid the falling asteroids or blow them up whilst trying to shoot the correct answer. My question is how is the best way to get my question to print each time along with three answers that are able to be chosen by shooting them? Any pointers would be very much appreciated.
danpost danpost

2018/3/29

#
Ectomorph wrote...
how is the best way to get my question to print each time along with three answers that are able to be chosen by shooting them?
Use actors to display the question and answers. You will only need one subclass of Actor to create all these actors and you only need one field in your World subclass to hold the correct answer (well, the actor at which the player shoots at that refers to or contains the correct answer). A benefit of using just one class is that all of the actors for the QnA part can be removed with a single command.
You need to login to post a reply.