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

2012/2/9

Create a moving sprite?

EBREEZE EBREEZE

2012/2/9

#
How do you create a moving sprite when the button is pushed down and to stop at a certian image when the button is released?
Morran Morran

2012/2/9

#
Are you asking how do you animate an Actor when a button is pushed down, and stop that animation when the button is released? Like for example, a walking animation when pressing the left key, or a firing animation when pressing the space bar? This scenario has what you're looking for . Just go through the code and check it out.
sp33dy sp33dy

2012/2/9

#
I was going to ask the same thing. You can always look at source of my gravityballs scenario. In the MyWorld and Ball classes, you'll find how to use the mouse press and put an image where clicked. Wouldn't take much to follow the mouse!
EBREEZE EBREEZE

2012/2/13

#
@ Morran Why does the left button make the image flicker back and forth?
You need to login to post a reply.