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

2015/11/17

scrolling map problem

jaaack98 jaaack98

2015/11/17

#
I am currently making a stay in the line type game for my computing project, and i am having problems creating a scrolling map. I have currently got a world that is 500 x 800 pixels and an actor class with a the map as an image that is 500 x 3000 pixels. I have set the location for the object in the world class and have got the object to scroll down. the problem is that not all of the map is being displayed, and it only displays a small section of the image when i run it. Is there anything i can do so that the whole image is displayed, or is there a limit on the size of an object? any help would be much appreciated, thanks.
danpost danpost

2015/11/17

#
Your issue may be due the the fact that a world is bounded unless otherwise created. That is, you are probably using:
super(500, 800, 1);
to create your world, which does not allow actors to be located outside the world window. Try creating it with the other World class constructor, which lets you tell it whether the world should be bounded or not:
super(500, 800, 1, false);
jaaack98 jaaack98

2015/11/18

#
thank you
You need to login to post a reply.