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

2014/1/1

Generation of Terrain

TheMissingKey TheMissingKey

2014/1/1

#
So my current problem is that I am trying to generate terrain for a 2D scroller game, and have done the method of reading a txt file filled with X's and O's and figuring out where to place the terrain based on it's location in the file. However, I have run into a problem where if the terrain is generated outside of the frame, it instantly gets moved to the edges of the frame. I am just curious what is causing this and any possible ways to work around it.
danpost danpost

2014/1/1

#
Any objects placed outside the bounds of a world are placed at the nearest location within bounds. If you want to have your actors able to be placed and moved outside the edges of the world dimensions, use an unbounded world. To make your world unbounded, use the world constructor that allows you to set the bounding of the world (bounded or unbounded): super(int width, int height, int cellsize, boolean isBounded) Refer to the World class API for more information on this constructor.
TheMissingKey TheMissingKey

2014/1/1

#
wow, thank you so much, never realized it was such a simple solution, props for carefully reading the api aye? thanks again
You need to login to post a reply.