How can the sprite move objects?

For questions about using Classic.

Post » Thu Mar 26, 2009 3:15 pm

Hi! :)
Please, tell me how to make that one object in a collision with another moves it?
When I set condition "Collision with another object" and action "Move at angle", object "jumps" over some pixels.. But I want to move an object smoothly, i.e. main sprite walks, collides with the box and begin to move it. When sprite stops, then the box stops.

Thanks!
B
2
G
3
Posts: 30
Reputation: 910

Post » Thu Mar 26, 2009 3:21 pm

Hmm, you could use "is overlapping" condition and move the object while it is overlapped. If the box seems to jump, be sure to use a TimeDelta multiplier; it will move a tiny fraction each frame then.

Like:

+Player is overlapping Box
> Set Player speed to half
> Move box at player's speed into player's angle

That would make the player character move slowly when overlapping the box while moving the box. When you stop, the box is moved just enough to stop overlapping and then stops.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Thu Mar 26, 2009 5:32 pm

If you're trying to make realistic collisions, go for the Physics behavior. Otherwise, you could try something like giving the other object a Bullet movement, and start the movement when it collides.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests