How do I check players position

Get help using Construct 2

Post » Sat Nov 29, 2014 6:00 pm

Hello I'm trying to figure out a way to check on collision first if the player is below it, beside it (right) beside it (left) or ontop.. I want the action to proceed only if the player is above the object and is landing... as if to be jumping down on it busting it open...

makes sense?


capx file would be appreciated for better understanding on my art
Need Sprites For Your Next Project?
100% Vector Animated Sprites
B
8
S
2
Posts: 170
Reputation: 1,086

Post » Sat Nov 29, 2014 6:10 pm

The platform tutorial should help you: https://www.scirra.com/tutorials/253/ho ... ame/page-7

You can check positions with the conditions compare x or compare y.
Image
B
74
S
28
G
17
Posts: 256
Reputation: 15,125

Post » Sat Nov 29, 2014 6:36 pm

Ok so implemented this and from my understanding this is saying " when the player comes in contact with the box object" - "Check to see first if at that time he is falling" - "IF he is falling, then check to see if he is ABOVE the box on the Y axis"

If all is true destroy the box.


when I play this - I can't get the box to destroy i'm standing on top the darn thing jumping and falling on top of it.. I'm clearly above it and clearly after jumping i'm falling
You do not have the required permissions to view the files attached to this post.
Need Sprites For Your Next Project?
100% Vector Animated Sprites
B
8
S
2
Posts: 170
Reputation: 1,086

Post » Sat Nov 29, 2014 6:44 pm

player.Y<box.Y :D
You do not have the required permissions to view the files attached to this post.
Image
B
65
S
23
G
7
Posts: 1,501
Reputation: 10,888

Post » Sat Nov 29, 2014 9:07 pm

Hey Korbaach so I get that point now I have made the changes to the player.Y<box.Y however given the same expression with changes I can still be jumping on the top of the box and it does nothing????? what am I missing...
Need Sprites For Your Next Project?
100% Vector Animated Sprites
B
8
S
2
Posts: 170
Reputation: 1,086

Post » Sat Nov 29, 2014 9:15 pm

I don't know if it makes a difference but try adding the solid behavior to the box. Otherwise share the .capx so we can check the problem.
B
74
S
28
G
17
Posts: 256
Reputation: 15,125

Post » Sat Nov 29, 2014 9:31 pm

I tried the solid prior to asking and it did nothing different - i can't share says file is too big :(
Need Sprites For Your Next Project?
100% Vector Animated Sprites
B
8
S
2
Posts: 170
Reputation: 1,086

Post » Sat Nov 29, 2014 9:34 pm

............
You do not have the required permissions to view the files attached to this post.
Last edited by korbaach on Sat Nov 29, 2014 9:36 pm, edited 1 time in total.
Image
B
65
S
23
G
7
Posts: 1,501
Reputation: 10,888

Post » Sat Nov 29, 2014 9:35 pm

if the files is to big then ether take screenshots of the events or make a new basic project that only include the events needed. if the you cant fix with the above. also did you clock the link Xavier posted it covers what you want using the same events hey posted thats why i think maybe you didn't copy them correctly
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Sat Nov 29, 2014 9:42 pm

plafform is falling... don't working on solid box...because on colision with solid box (player.Y<box.Y) player don't falling ..box is solid ..he landed..
I think ;)
Image
B
65
S
23
G
7
Posts: 1,501
Reputation: 10,888


Return to How do I....?

Who is online

Users browsing this forum: rayolf and 17 guests