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

2021/8/15

How to make an actor point towards north, south, east or west without keys?

FunnyBoys-123 FunnyBoys-123

2021/8/15

#
Hi, am new to greenfoot. I wanted to ask a question. as the title says how can I move an actor in north, south, east or west without using keys. It would be a great help if anyone can tell how to do that. Thanks.
Super_Hippo Super_Hippo

2021/8/15

#
setLocation(getX()+dx, getY()+dy);
dx<0 moves left. dx>0 moves right. dy<0 moves up. dy>0 moves down.
You need to login to post a reply.