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

2014/7/9

I'm having some issues with some Move methods...

1
2
MusicPenguin MusicPenguin

2014/7/10

#
Did you just have a while(true) loop going in your Shifty class?
danpost danpost

2014/7/10

#
MusicPenguin wrote...
Did you just have a while(true) loop going in your Shifty class?
No. The act method has the keystroke detection and calls a method called 'shift' with the direction. The 'shift' method has a double-'for' loop -- the outer loop for the four axes of movement and the other for getting the tiles along each axis and moving them. Also a local field is declared before the inner 'for' loop to track the number of tiles found along the second axis (so the new tile positions can be easily determined).
You need to login to post a reply.
1
2