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

2018/4/10

How to make an object go side to side without giving explicit x coordinates.

logitechkeyboard logitechkeyboard

2018/4/10

#
Something like if(condition1){ move(3); }else{ move(-3); } The object should go right a little bit then left a little bit. Almost like it's bouncing of invisible borders. I'm planning to do this with many objects of a certain class so I don't want them to overlap.
danpost danpost

2018/4/10

#
logitechkeyboard wrote...
Something like << Code Omitted >> The object should go right a little bit then left a little bit. Almost like it's bouncing of invisible borders. I'm planning to do this with many objects of a certain class so I don't want them to overlap.
Please elaborate on the wanted movement. Are these invisible borders fixed or can the turn-about locations change for any individual object? What do you mean by "a little bit"? Is there a specific range in movement? By "overlap", do you mean they will also bounce off each other as well as these invisible borders?
logitechkeyboard logitechkeyboard

2018/4/10

#
Movement like the enemies in the first stage of this galaga game www.freegalaga.com/. There is no rotation, the borders aren't fixed. They just move gradually side to side without overlapping.
danpost danpost

2018/4/10

#
See your discussion thread using username lastaccountbanned.
You need to login to post a reply.