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

2014/1/17

sorry i m pestering you,

deathburrito16 deathburrito16

2014/1/17

#
sorry, but I while ago I had a question about setImage, and now its blocked. so, I would like the code to make the player's picture be Player_firing.png when the mouse is clicked, and player(3) when it's not. any help?
danpost danpost

2014/1/17

#
if (Greenfoot.mousePressed(null)) setImage("Player_firing.png");
if (Greenfoot.mouseClicked(null) || Greenfoot.mouseDragEnded(null)) setImage("Player(3).png");
If the mouse press must occur on the player then change 'null' (all three places) to 'this'.
You need to login to post a reply.