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

Comments for Scrolling Landscape

Return to Scrolling Landscape

DutaDuta

2012/3/14

Is it generating terrain on the fly or pre-generating a set width of terrain. If the latter option, does it repeat once it reaches the set width or does it just end? Just wondering because the one time I made a terrain generator (inspired by @nccb's one) I had it generating on the fly, but I'd be interested to see what method you've gone for. Oh and finally, are you using Graphics2d's gradient fill method?
sp33dysp33dy

2012/3/14

Yes, it's 255 strips wide and using Graphic2d's gradient fill yes.
sp33dysp33dy

2012/3/14

...so it wraps.
A new version of this scenario was uploaded on Wed Mar 14 23:51:20 UTC 2012 Added additional parallel scrolling. For some reason scrolling is breaking up the rebuild of the terrain; need to figure that one out.
A new version of this scenario was uploaded on Wed Mar 14 23:52:49 UTC 2012 Added additional parallel scrolling. For some reason scrolling is breaking up the rebuild of the terrain; need to figure that one out.
A new version of this scenario was uploaded on Thu Mar 15 00:06:50 UTC 2012 Fixed a few bugs. Doh.
A new version of this scenario was uploaded on Thu Mar 15 10:58:37 UTC 2012 Scrolling now sorted! Surprised to find that drawing each frame is quicker than trying to shift pixels and drawing at the end! The terrain tearing has now been fixed. I'm going to change the scrolling to float rather than int based; which should result in smoother scrolling. My other task is to remove the current control and implement the standard gravity/thrust/turn type. All pretty basic, but I needed to suss scrolling out in Greenfoot/Applets.. Code isn't as tidy as I would like, but thought it might inspire someone. As usual, please feel free to use code, but please do credit the use.
A new version of this scenario was uploaded on Thu Mar 15 11:01:22 UTC 2012 Ooops, the front 'crater' landscape layer wasn't scrolling fast enough.. Fixed.
A new version of this scenario was uploaded on Thu Mar 15 21:38:37 UTC 2012 Some rudimentary physics added. I.E. Gravity and inertia. Now need to fix X travel etc. Time for bed though :( Will provide code when ready.
A new version of this scenario was uploaded on Tue Mar 20 09:45:09 UTC 2012 Still working on this. Managed to get the physics right. Needs a tweak in terms of 'feel'. Hitting the ground results in a complete stop. Will soon have landing and explosions! Where next? Got lots of ideas for game. I.E. Collect and drag around type, or strategy build a colony or something else?? Thoughts?
A new version of this scenario was uploaded on Tue Apr 03 11:57:00 UTC 2012 Completely rewritten the background scrolling. I wanted the Sun to revolve around the world. I've also optimised the scrolling (although there are two other areas I need to focus on). I've added a compass and can scale the world if required. I'm now thinking about 'what' to do for the game. Three ideas: (1) Typical fly round, pick up objects (via track beam) (2) Command spacemen around world, picking up/dropping off (3) the first two in a strategic based game.. The code has been published with this release. Please don't just copy wholesale. If you like it, please 'LIKE' and credit me in any releases. My next action will be to add a purpose to the engine (which will include a level map builder). Yep, going to add in a builder as if this was a typical map type game.
A new version of this scenario was uploaded on Tue Apr 03 11:59:34 UTC 2012 Completely rewritten the background scrolling. I wanted the Sun to revolve around the world. I've also optimised the scrolling (although there are two other areas I need to focus on). I've added a compass and can scale the world if required. I'm now thinking about 'what' to do for the game. Three ideas: (1) Typical fly round, pick up objects (via track beam) (2) Command spacemen around world, picking up/dropping off (3) the first two in a strategic based game.. The code has been published with this release. Please don't just copy wholesale. If you like it, please 'LIKE' and credit me in any releases. My next action will be to add a purpose to the engine (which will include a level map builder). Yep, going to add in a builder as if this was a typical map type game.
sp33dysp33dy

2012/4/3

Please remember this is WIP; therefore I'm aware of plenty of bugs (i.e. when hitting ground etc, etc). I just wanted to update the scenario to show progress.
A new version of this scenario was uploaded on Tue Apr 03 19:02:52 UTC 2012 Thought I'd add an Earth; given I've decided this game will be on Mars. Do look at how easy parallex scrolling is to mimic.
A new version of this scenario was uploaded on Sat Apr 07 17:07:56 UTC 2012 Changed the landscape code to work correctly with a speed value; thus improving parallex scrolling whilst maintaining correct positioning with homebase. Homebase added. Earth/Sun speeded up to meet game expectations. I've now made scribbles on the game plan! Will start to implement them. This is going to be a resource collecting game. First step, get spaceman added with controls via mouse.
ShoutToUsShoutToUs

2012/12/6

I think that this is a very cool concept to use in a sidescrolling game, It would be very cool to see if there were some enemies to fight as you flew