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

2012/4/19

Wombats Key Control

loz4 loz4

2012/4/19

#
Can someone give me accurate code that will allow me to move my wombats using key control, thank you
-nic- -nic-

2012/4/19

#
//this goes in your wombat class

public void act()
{
  moveandturn();
}

public void moveandturn()
{
  if (Greenfoot.isKeyDown("//keyyouwant\\")
    {
      move(4);
     //or\\
    turn(3);
    }
}
the paramiters in the move and turn can be changed:) please post if you have anymore problems:)
You need to login to post a reply.