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

2016/10/21

How do i get camera to move with character?

FutureCoder FutureCoder

2016/10/21

#
I need to get the camera to move with my character, how can i do this?
danpost danpost

2016/10/21

#
FutureCoder wrote...
I need to get the camera to move with my character, how can i do this?
Basically, you keep a reference to the character in your World subclass and have that world's act method determine when the character is outside its bounds. Anytime it is, move all actors (including the character) so that the character is back in bounds and adjust the background, if needed.
FutureCoder FutureCoder

2016/10/21

#
Is there any way to get the camera to scroll up and down with the character, as the world is quite big
danpost danpost

2016/10/21

#
FutureCoder wrote...
Is there any way to get the camera to scroll up and down with the character, as the world is quite big
I gave a brief description of what was needed for this. Yes, there is a way. Mind you, however, there are limits that may need to be addressed -- such as heap space and excessive CPU usage that can cause lagging.
FutureCoder FutureCoder

2016/10/21

#
thanks
You need to login to post a reply.