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

2014/7/1

Letter generation

IeuanMcCrushems IeuanMcCrushems

2014/7/1

#
I need to make certain text appear when I press space, I know how to do the basic code like if(Greenfoot.isKeyDown("space")) but I'm not that great, any ideas?
danpost danpost

2014/7/1

#
Is the text to be part of the world background or separate? Will the text be changed or removed at a later time? 'isKeyDown' will register the key being down multiple times during one stroke of the key. You will either need to track the state of the key or use 'getKey', which only registers once (when the key is released), instead.
IeuanMcCrushems IeuanMcCrushems

2014/7/3

#
It will be separate and it will only be removed when I reset the game, it's also a bingo type game
danpost danpost

2014/7/3

#
If it is separate, you should create an actor class to display the text. Create an instance of that class with the text required when the space keystroke is detected.
You need to login to post a reply.