Super Basic Collision Question

For questions about using Classic.

Post » Sat Oct 17, 2009 2:06 am

I have an object that is controlled by the player. This object will be invisible during run-time, but it is a 64x64 object that the camera follows. I have placed two 64x64 boxes at each side of the level to stop the object from going beyond a certain point (most importantly the edge of the level). I can't seem to make the player's object stop when it collides with one of the boxes. I have tried using the movement behaviour "stop", but that just creates a JELLO effect.
B
2
G
3
Posts: 68
Reputation: 986

Post » Sat Oct 17, 2009 3:37 am

use set position and keep setting its postion to the level boundary if goes past it.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Sat Oct 17, 2009 3:41 am

Are you using the platform behaviour? If you are you don't need to manually set the collision, just set the collision item to 'solid' under attributes. I think this is true of all the behaviours.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Sat Oct 17, 2009 1:13 pm

[quote="Davioware":1nvgl453]use set position and keep setting its postion to the level boundary if goes past it.[/quote:1nvgl453]

It isn't hitting the boundary of the level. I'm not using the platformer behaviour. So I'd have to create two objects that set PlayerSight.X to "PlayerSight.X - whatever" for the right side and "PlayerSight.X + whatever" for the left side?
B
2
G
3
Posts: 68
Reputation: 986

Post » Sat Oct 17, 2009 1:59 pm

[quote="Farmrush":dvy9rqk4]It isn't hitting the boundary of the level. I'm not using the platformer behaviour. So I'd have to create two objects that set PlayerSight.X to "PlayerSight.X - whatever" for the right side and "PlayerSight.X + whatever" for the left side?[/quote:dvy9rqk4]
It doesn't matter what it's hitting, you can just use system compare to check if the object passes a certain position and then set it to the maximum point you want it to be at. You probably don't need to make objects for this, and it doesn't matter if your using a behavior or not. A cap would help though, since I don't really know exactly what you want :) .
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Sat Oct 17, 2009 4:25 pm

Sorry, I didn't think a cap was necessary because the problem is so basic. All I'm looking for is an object to stop moving when it runs into another object, that's it.
B
2
G
3
Posts: 68
Reputation: 986

Post » Sat Oct 17, 2009 6:52 pm

[quote="Farmrush":2axpvoug]I have placed two 64x64 boxes at each side of the level to stop the object from going beyond a certain point (most importantly the edge of the level).[/quote:2axpvoug]

What Davio said. You don't need objects, just set the position it shouldn't travel beyond.
Something like this: [url:2axpvoug]http://dl.getdropbox.com/u/2306601/StopRightNow_001z.cap[/url:2axpvoug]
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sat Oct 17, 2009 10:43 pm

I've already done that, thank you for showing me, but I'm looking for an answer to the previous problem. If I had an object that is traveling, for example, along the x axis, how do I make it stop moving when it collides with another object?
B
2
G
3
Posts: 68
Reputation: 986

Post » Sat Oct 17, 2009 10:55 pm

Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Sat Oct 17, 2009 11:14 pm

That might be relevant if "bounce" does what I think, but I'm not looking for anything nearly as complicated. Maybe I'm explaining it rather poorly, because this is very basic. Say I have A BOX moving along the X AXIS and it COLLIDES with another BOX so I want it to stop moving.
B
2
G
3
Posts: 68
Reputation: 986

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests