Yet another terrain generator...

This forum is currently in read-only mode.
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • Yes, it's another one. Except this ones a little different. I don't (yet) know much about arrays, or things such as that, but I wanted to create a sort of terrain generator that created a random terrain for a side scrolling "survival game". So I created the most simple one I could think of.

    This is created only with a single "rock" object, with ten image points on random spots, and each rock at the beginning of the layout spawns another rock at a random angle and image point, which in turns spawns another rock etc... until 4 seconds, and each rock stops spawning more rocks, and the "terrain" is complete. After that, the rocks are pasted onto a canvas object and deleted, which makes the game run far faster than having hundreds of rock objects on the screen.

    <img src="http://i56.tinypic.com/ke9jjd.jpg">

    I know its not as fancy or good as the other countless generators on this forum, but I thought it worked OK and it works well anyway for the game I'm building. It's also not very efficient, but, tell me what you think!

    CAP:

    http://dl.dropbox.com/u/31490769/terraingen.zip

  • one question. is there a limit with size of canvas object?

    If your layout is 5000x480 and you generate your objects, and then save them as canvas it will create one giant texture in canvas. Am i thinking corectly?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Well... it should. But I'm having the problem of the canvas only actually "grabbing" the screen size. In other words, if you try and create a much bigger terrain than the screen size the canvas will still only grab the texture of the screen size. Uh... I hope that made sense...

    Basically, if the layout was 5000x480, and the screen size was only 1024x768, the canvas would only end up grabbing 1024x768 of the terrain, and the rest would delete itself. I'm not sure if I'm doing something wrong, there's got to be some way to increase the canvas size. Anyone know how?

  • Canvas uses the gpu, and since all textures not on the screen are not drawn.....

    Canvas draw point, or line on the other hand....

  • I'm not sure I understand...

  • hey man!! why can't I open your files of terrain generation? they are vey interesting for my project!

  • You can't open it because it is a file for construct classic, this thread hasn't been active for nearly 2 years.

  • Still an interesting idea though. Wasn't aware you could do that. :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)