[SOLVED] Sprite through walls ...

For questions about using Classic.

Post » Sun Dec 19, 2010 3:45 am

Hello community, I have a problem with the game I'm developing right now.
When I run the hero (sprite + 8 movements Behavior + drop shadow effect, collision per pixel) to a right angle represents a wall (sprite attribute + solid), forcing a little, he crosses the wall ...
Excuse me for my English is not very good.
Thank you in advance!
B
1
G
2
Posts: 9
Reputation: 643

Post » Sun Dec 19, 2010 9:07 am

Yes, because the way frame rate is handled it's possible to miss a collision when the frame rate changes..
Your best bet is to not allow the player to continuously run into the wall.
Something like:
>sprite on collision with wall
->sprite (8direction) bounce.

That or make the walls bigger.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Sun Dec 19, 2010 3:42 pm

That's what I finally did but it looks risky collisions when the hero has to maneuver in an emergency or spend some door ...
B
1
G
2
Posts: 9
Reputation: 643

Post » Sun Dec 19, 2010 4:53 pm

Try using custom movement's 'push out' action.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Sun Dec 19, 2010 10:31 pm

Unfortunately it does not work ... :cry:
B
1
G
2
Posts: 9
Reputation: 643

Post » Sun Dec 19, 2010 11:18 pm

You could try overlap at offset, with set speed.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Sun Dec 19, 2010 11:57 pm

I tried various things with the "at offset overlapping" but I'm not sure I understood what you advice me, you can be more specific?
B
1
G
2
Posts: 9
Reputation: 643

Post » Mon Dec 20, 2010 12:38 am

Basically, you can slow it down before it hits the object.
Warning "OR" is somewhat buggy, but it seems to work fine in this case.

+ Sprite2: overlaps "Solid" : offset (-5,0)
+ System: OR
+ Sprite2: overlaps "Solid" : offset (5,0)
+ System: OR
+ Sprite2: overlaps "Solid" : offset (0,5)
+ System: OR
+ Sprite2: overlaps "Solid" : offset (0,-5)
-+ System: Trigger once
--> Sprite2: Set speed to 10
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Mon Dec 20, 2010 1:47 am

It's not work .... The hero slowed, but if the player continues to force on the right corner of the wall, it disappears ... :|
B
1
G
2
Posts: 9
Reputation: 643

Post » Mon Dec 20, 2010 2:22 am

5 things you could try-

1, Make your walls a bit thicker.
2, Place an overlapping dummy wall (invisible and wider than your normal wall on top.
3, Check the collision mode your player is using.
4, Use Time Delta in your events.
5, Slow the player down

Good luck
B
19
S
6
G
7
Posts: 1,206
Reputation: 7,300

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests