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

2018/5/4

How to make an actor move a certain amount

1
2
OfficerRiot OfficerRiot

2018/5/7

#
danpost wrote...
OfficerRiot wrote...
Ok that worked but now it plays before i click run
Alright. Time to go back a bit. Remove the constructor and start the sound in the act method using this line:
if (AT_AT_Walk != null) AT_AT_Walk.playLoop();
Then do the following:
// change this line
if (getX() < 300) AT_AT_Walk.stop();

// to this
if (getX() < 300)
{
    AT_AT_Walk.stop();
    AT_AT_Walk = null;
}
That worked :)
You need to login to post a reply.
1
2