Infinite floor

Get help using Construct 2

Post » Thu Dec 19, 2013 9:16 am

Hello there!
I am pretty new with construct 2 and wanted to start an auto-runner.
I started with the basic template and moved on with random generated blocks as obstacles but now my problem is that I just don't know how to make an infinite floor,I tried with every idea that got trough my head but just can't get it started...
So,for a recap:I want to make the floor to be endless.
B
6
S
1
Posts: 37
Reputation: 600

Post » Thu Dec 19, 2013 11:03 am

You could have a tiled floor, and span it longer than your screen. Now, suppose the floor is always moving to the left with bullet behavior or whatever, you can:

+ if floorObject.x < floorObject.width
- set floorObject.x = floorObject.x+floorObject.width

This will make the floor jumps back by its width amount giving an impression of infinite floor.
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Thu Dec 19, 2013 11:15 am

Thanks for the tip,gonna use that later on but for now I just gave the system the event that will do something like this: System,every 1 second:spawn object floor.
Now one of my problems is that I want to make a jump strength and by that I mean that if you press the button longer you will jump longer,tried the "vector y" method but the problem is that it will have infinite jumping,how do I stop that?
B
6
S
1
Posts: 37
Reputation: 600

Post » Thu Dec 19, 2013 11:33 am

Ahh... variable jumping.

do this:

+ if jump key is released,
- + if player is NOT falling
- - set player's platformer's vector y to player's platformer's vector y / yourThreshold

yourThreshold shall be the variable you should try play around until you feel right.

If the player doesn't let go of the jump key, he will achieve max jumping value imstead.
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Thu Dec 19, 2013 12:50 pm

I am sorry but I didn't quite understand you,could you give me an example with more details?
I tried tutorial from MozayKnows (Can't post links unfortunately) but if I press the jump key fast I am getting just some infinite jumping...
B
6
S
1
Posts: 37
Reputation: 600

Post » Thu Dec 19, 2013 1:34 pm

Which part do you not understand?
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Thu Dec 19, 2013 4:35 pm

This is achieved easily by doing [on button released]/[player is jumping]>[player set vector Y to 0]
While you hold your jump button you go up, and letting go of the key stops you dead in your vertical tracks and gravity takes over.
B
10
S
3
Posts: 8
Reputation: 716


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 42 guests