Page 1 of 2

How do I make an endless slope?

PostPosted: Thu Apr 21, 2016 10:16 am
by YamDragon
So I want to make a ski game (side-view, like Ski Safari) , with actual winding slopes, but I also want it random and endless, how do I do this? Also how do I have different colored sections of this slope.

Re: How do I make an endless slope?

PostPosted: Thu Apr 21, 2016 4:18 pm
by gumshoe2029
Maybe try a tileset and tile it vertically?

Re: How do I make an endless slope?

PostPosted: Thu Apr 21, 2016 6:01 pm
by alextro

Re: How do I make an endless slope?

PostPosted: Thu Apr 21, 2016 6:17 pm
by YamDragon
@alextro It doesn't go on forever, and I want it like loopy, and to make it go up and down as well, how do I do that?

Re: How do I make an endless slope?

PostPosted: Thu Apr 21, 2016 7:04 pm
by alextro
Well I just throw the basic idea how slopes generated so you can work out from there. To make all mechanics work a lot of logic need to be dig more.

Re: How do I make an endless slope?

PostPosted: Fri Apr 22, 2016 5:05 am
by rustbeard
you may want to make each slope as an art asset in an art program such as photoshop or gimp, and then build each like a room setting up the collisions and such on each, and then implement java or possibly a large series of events to perform "procedural generation" where it calls in the next frame (into memory) ahead of time and uses a random number generator to determine each (possibly with if then statements to prevent certain slopes from occurring after specific slopes if you wanna get complicated or run into issues with how they blend) otherwise your looking at a lot of math if you want to create an algorithm that actually graphs out each slope randomly and if you aren't careful with coding it you may end up with impossible slopes that break your game. there are some decent java game programming tutorials on youtube that may be of help if you are looking to go that route, instead of trying to manage with strictly events (which can probably be done, but in a lot more lines id imagine)

anyhow i hope this was at least somewhat helpful in pointing you in the right direction.

Re: How do I make an endless slope?

PostPosted: Fri Apr 22, 2016 5:23 am
by R0J0hound
It's rather simple to do, and JavaScript isn't needed at all. As alextro showed you can do it with only one event. Why not get creative and try experimenting and see what you can come up with?

Re: How do I make an endless slope?

PostPosted: Sat Apr 23, 2016 11:56 am
by YamDragon
@R0J0hound, I just end up ruining what @Alextro already gave me. Help?!

Re: How do I make an endless slope?

PostPosted: Sun Apr 24, 2016 3:11 am
by R0J0hound
I'm not sure how much help I'll be. I mean I could come up with something like alextro, but nothing would be exactly what you had in mind. I guess we could go back and forth with you saying what's wrong and me then fixing them, but that would just be me making your game.

Re: How do I make an endless slope?

PostPosted: Sun Apr 24, 2016 10:39 am
by mikehive
Ayolabi12345 study the events that Alextro gave you and work out exactly what everything does! I hate using other peoples' code because I always break it if I don't understand how it works. When you've figured out how it works you can work out what you can change without ruining it :)