How do I Make This Jumping Game Work???

Get help using Construct 2

Post » Tue Aug 11, 2015 1:52 pm

Hi guys!
I'm trying to make a cave jumper (akin to Amsoft's Roland In The Caves, if anyone remembers it) and am wanting randomly generated platforms - however at present I can't stop them from being too uniform, too far to jump to or out of the playing field. So, I have a few questions:

I'm starting with a platform of a random position (horizontally), and a height variable based off that and the players jump height. How do I:

A) stop the platforms generating out of the playing field
B) keep them within jumping distance of the player
C) keep them random enough to avoid boredom (or a staircase)

The event sheet looks thusly:
Image

Any advice would be greatly appreciated

TIA
B
6
Posts: 30
Reputation: 298

Post » Tue Aug 11, 2015 2:58 pm

Assuming max jump distance is about 200, try something like:

Add random(-200, 200) to VAR_Plat

After that add sub events to verify that VAR_Plat is within playing field:

VAR_Plat < 96 -> Add 200 to VAR_Plat
VAR_Plat > 864 -> Subtract 200 from VAR_Plat

Then you can create the platform.
Lokkim Games: Constructor Dude - Fun platformer game, PuzCro - Difficult puzzle game demo
B
9
S
3
G
1
Posts: 38
Reputation: 795

Post » Sun Aug 16, 2015 1:32 pm

Hi Lumik

Thank your for your response -- it is greatly appreciated.
I'll get on to it and let you know of my progress :)
B
6
Posts: 30
Reputation: 298

Post » Sun Aug 16, 2015 3:17 pm

Is this what you meant? Because if so, the game just hangs on loading....
Image

I think I may have created an infinite loop, but I'm not sure....
B
6
Posts: 30
Reputation: 298

Post » Fri Aug 21, 2015 2:56 pm

Anyone able to help?
B
6
Posts: 30
Reputation: 298

Post » Sun Aug 23, 2015 8:06 pm

https://drive.google.com/file/d/0BzbX-wj9E7SrVHRBVlh0bDJLR28/view?usp=sharing

Here is capx. I hope this is what you were trying to do.
Lokkim Games: Constructor Dude - Fun platformer game, PuzCro - Difficult puzzle game demo
B
9
S
3
G
1
Posts: 38
Reputation: 795

Post » Mon Aug 24, 2015 7:01 am

Hi Lumik

this IS a better effect than I could acheive, but its still a little too, um, "staircasey"
platforms are all still over one side....
B
6
Posts: 30
Reputation: 298

Post » Mon Aug 24, 2015 4:19 pm

Sometimes they are on one side and sometimes not. That is random.

You could try replacing "random(-200, 200)" with "choose(random(-200, -70), random(70, 200))"

This will prevent getting platforms too close to previous platform.
Lokkim Games: Constructor Dude - Fun platformer game, PuzCro - Difficult puzzle game demo
B
9
S
3
G
1
Posts: 38
Reputation: 795

Post » Mon Aug 24, 2015 8:40 pm

You know what, I never thought of that! I'll give it a go :D
B
6
Posts: 30
Reputation: 298


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 22 guests