How do I step up by one pixel?

Get help using Construct 2

Post » Mon Feb 16, 2015 11:12 am

Default Platform Movement behavior

Player can normally walk onto things, but if he's standing (not moving) next to an object that is 1px higher than the ground he doesn't walk up to it. Is there a method to determine the height of an object's "step" (in this case, the player object using Platform behavior)?
B
25
S
6
G
6
Posts: 262
Reputation: 3,690

Post » Mon Feb 16, 2015 7:38 pm

this normal roracle since it triggers a collision even if its one pixel
t
you can probably workaround this by checking if the player is colliding then set the Y of the player to that objects y+objects pixels height

since this will act like a teleport it wont work very well with bigger object height than few pixels
Image
B
28
S
11
G
2
Posts: 139
Reputation: 3,299

Post » Tue Feb 17, 2015 10:37 am

Well I'm obviously off by 1 pixel and I might just change it to where it doesn't go up that far. It's an elevator so it shouldn't matter too much. I have it determine how high and low to go based on a variable. I'll just set that variable to one pixel lower/higher (y axis is so confusing some times lol)

Also I should make note: Though it's 1 pixel higher than the platform, if my character is walking he will step up onto it. But if he's starting right next to it, he will not.
B
25
S
6
G
6
Posts: 262
Reputation: 3,690

Post » Tue Feb 17, 2015 2:31 pm

if you can share a capx i can help you make it work better
Image
B
28
S
11
G
2
Posts: 139
Reputation: 3,299

Post » Tue Feb 17, 2015 5:28 pm

I'm encountering the same issue.

On a horizontal sprite which has a 45° angle (purple), the player can walk up.

On a slope which was drawn that way (blue), the player can't.

What is the best way to make the player properly walk up on the blue ones ?

edit : okay my bad, the collision box were messed up on the blue ones. I had to remove some points and now it works perfectly. Also, it was not the same issue as roracle.
You do not have the required permissions to view the files attached to this post.
B
12
S
7
G
7
Posts: 450
Reputation: 4,276


Return to How do I....?

Who is online

Users browsing this forum: istero, joliemoc, XMatrix and 10 guests