Posted By
|
Message
|
WallMeat
Registered 01/11/2009
Points 5
|
3rd June, 2010 at 23:28:55 -
Hey everyone,
I need to know, how do you push objects around safely, without having them get stuck in walls or float through them? For example, pushing a player or enemy back when they take damage, or something like that.
The main problem is keeping the Object from working its way through walls. After that is restricting it from doing anything else during the "push" before returning the movement back to normal. Changing Movement to Bouncing Ball Movement seemed like a solution at first, until I found out that it likes to go through walls...Lowering the speed only sometimes works, and it just ends up looking sluggish and floaty.
Is there a better way?
n/a
|
Ricky loves Left For Dead 2
Registered 28/12/2006
Points 4075
|
3rd June, 2010 at 23:57:11 -
make an engine, i'm sure you could find an article for it with a little searching
-
|
Silveraura God's God
Registered 08/08/2002
Points 6747
|
4th June, 2010 at 00:34:43 -
First of all, don't use default movement if you don't have to. This is where a simple custom engine would work perfectly fine:
Set X Position of object to position of object + 1 will cause the object to move +1 pixel each time the event loops.
With this said, simple sensors around the object will allow you to detect which side comes in contact with the wall and when it does, flip a flag or something that will make it so that the object can no longer be pushed that direction.
http://www.facebook.com/truediamondgame
|
Hernan
Registered 04/03/2003
Points 707
|
4th June, 2010 at 09:26:08 -
Super duper useful article about giving objects detectors without needing extra active objects: http://www.create-games.com/article.asp?id=1639
Having detectors for your objects makes things much easier instead of constantly trying to push them out of the walls.
This space is for rent
|
WallMeat
Registered 01/11/2009
Points 5
|
23rd June, 2010 at 16:30:20 -
I'm trying to get started on the embedded detectors thing, but I'm...still not sure I understand it completely. I'd look at the example in the article, but it seems to have expired (though are .cca files compatible with MMF2?). Is there another example file available?
n/a
|
|
|