How do I jump off a cliff? not collide on different layers?

Get help using Construct 2

Post » Thu Jun 25, 2015 8:19 am

Hello everyone!

I am making a game similar to Legend of Zelda a link to the past. and am I trying to figure out how link is able to jump off a cliff.
I'm also trying to figure out how depending on a layer it seems that you can collide with some monsters but not others depending on which plan the main character is on.

any idea's???
B
5
S
1
Posts: 88
Reputation: 653

Post » Thu Jun 25, 2015 8:25 am

The first question is unclear to me..

The second question could be handled by layers depending on how you have your game set up..

Player on collision with monster
system compare two values player.layername = monster.layername
> player destroy
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Jun 25, 2015 8:40 am

LittleStain wrote:The first question is unclear to me..

The second question could be handled by layers depending on how you have your game set up..

Player on collision with monster
system compare two values player.layername = monster.layername
> player destroy


@LittleStain Incredibly, you have solved my biggest problem without knowing it, thank you for .layerX, I dont seen it before! :D
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Fri Jun 26, 2015 9:16 am

in response to the first question, the game is bird eye view, somehow the main character can press against a ledge/cliff and seemingly jump off of it as if the wall isnt a solid object anymore and land on the floor below it
Image
Image

i'm basically trying to achieve this wondrous feat!
B
5
S
1
Posts: 88
Reputation: 653

Post » Fri Jun 26, 2015 9:27 am

If I'm correct, those only happen on specific places of the cliff right, you can't jump from any cliff (for example on the second picture, only the edge on top of the square where Link actually is can be jumped from, no other part (darkened) of the cliff, right ?)

A possibility is to have an invisible sprite to act as a "way" on top of the ledge to act as "possibility trigger".

Image

When Link is overlapping the blue box/trigger and actually moving at a greater Y than the bottom of the box, it is considered that the jump is effective.
From there, you ignore the player's inputs, and actually move Link by yourself down the yellow arrow for X pixels (the amount can be an instance variable of the blue block).

Once the amount of pixels travelled, you give back the hand to the player and "situates" back the character in the world where it should be (that is to say, down at the foot of the cliff, on a new layer likely. The next layer name can also be an instance variable in the blue rectangle.)
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,293

Post » Fri Jun 26, 2015 9:28 am

Fall is not the problem. (Physic Behavior)
The problem is to walk on a solid or solid like... I think thats currently impossible in this kind of game, isnt it?
We need a upgrade on Physic for topview games. But nobody probably do this.

@Kyatric Yes, or a workaround. I have almost only workarounds...
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Mon Jun 29, 2015 7:49 am

i suppose its worth a try when you collide with the the object to make the event function to have the wall solid behavior disabled for the duration of the jump... although it would mean that npc's and monsters would just merge into the wall if they move. hmm
B
5
S
1
Posts: 88
Reputation: 653

Post » Mon Jun 29, 2015 3:26 pm

I've solved this in my game. I have the same mechanic where you can jump down off of ledges but not back up. Here's an image for how I have it set up:

Image

My events are basically if you're moving down, it disables the solid, changes the player animation, and accelerates the player downwards until they hit the landing object. Everything is reset back to normal controls at that point. Just be sure the landing is wide enough that someone wouldn't be able to get around it and accelerate downwards forever or something crazy (or disable lateral movement, which I don't).

Image

Some of that is for state management in my game, and I use the bullet behavior in tandem with the 8-direction behavior for a number of environmental things. I'm sure someone has some magnificent way to make it more efficient or whatever, but this works perfectly well.
B
103
S
38
G
19
Posts: 962
Reputation: 17,996

Post » Thu Jul 02, 2015 7:34 am

It looks great thanks! ill have to give it a try when i get the chance!
B
5
S
1
Posts: 88
Reputation: 653


Return to How do I....?

Who is online

Users browsing this forum: DiabloOvermind, Google [Bot] and 14 guests