How do I “jump” in a Top-Down game.

Get help using Construct 2

Post » Thu Jul 03, 2014 8:20 pm

Hello,
What I try to achieve is for a solid object, to be able to “jump over” (passing through) a solid obstacle when a button is pressed. This without using physics and without passing through other solids.
I have attached a simple .capx as an example.
As the game world is filled with solids (jumpable obstacles, not jumpable obstacles and enemies that keep following the player), the player should be able to only “jump” over the obstacles but not being able to jump over (passing through, other solid.
In the .capx, attached, I try to explain the scenario that is composed by:
-a player
-a enemy that follows the player
- an obstacle (like a fence)
-And a box
The player and the enemy cannot pass through any other solids. But by pressing a button, the player should be able to jump over the obstacles, but not over the box.
At the same time, the enemy will still not b able to jump over the obstacles.
Any contribution would much appreciate!
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 10
Reputation: 220

Post » Thu Jul 03, 2014 8:55 pm

Not yet had time to check the capx sorry, but one solution would probably be to switch to an animation "jump" and during that animation disable the behaviors on the player (solid and movement), and then force the player to move forward until the animation ends. Do a check before triggering the jump to make sure the player is facing towards an obstacle and is allowed to jump over it (eg: overlapping a sprite made invisible called AllowJump).
"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
116
S
40
G
17
Posts: 2,199
Reputation: 19,435

Post » Thu Jul 03, 2014 10:10 pm

I made an example...

Test.capx


The problem is, I'm tweaking the fences solid behavior, so, when the player jumps, the enemies can cross the fences too. I'll try to work around this issue, but, for now, you can check this version! :)
You do not have the required permissions to view the files attached to this post.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
16
S
4
G
1
Posts: 416
Reputation: 2,313


Return to How do I....?

Who is online

Users browsing this forum: darkrealos, DharmaOne and 23 guests