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

2016/6/23

How to replace 4 objects with 4 other objects with key command.

AlfPacino AlfPacino

2016/6/23

#
I'm making a trivia game mixed with arcade. The thing is that each answer is a diferent object in sub-subclass of Answer and i can't figure out how to replace 3 answers with another 3 and each question with another one. This must happen with a key command for the correct answer. Any ideas?
danpost danpost

2016/6/23

#
You can remove the current answer and question with the correct answer (maybe show a message about the correct answer being picked with a delay); then, have the world check to see if they are still in the world, and if not, add a new set of answers and a new question. The world can count the number of times it finds none in the world to determine what set to show next; and also, if needed, know when to stop supplying questions (maybe print final results on a game over screen or something like that).
AlfPacino AlfPacino

2016/6/23

#
The thing is that i don't know the code that i should use. I can make it dissapear. But i don't know how to put the new actor in the same coordinates. And that for each answer (both correct and incorrect) and the question given after answering correctly.
danpost danpost

2016/6/24

#
AlfPacino wrote...
The thing is that i don't know the code that i should use. I can make it dissapear. But i don't know how to put the new actor in the same coordinates. And that for each answer (both correct and incorrect) and the question given after answering correctly.
Please show your world class code.
You need to login to post a reply.