So I know how to collide with the window edge but now I need to know how to collide with backdrops, im using a custom movement engine too. Thanks :)
Printable View
So I know how to collide with the window edge but now I need to know how to collide with backdrops, im using a custom movement engine too. Thanks :)
make sure the backdrop is set to "obstacle" in the RunTime options of the backdrop properties (under Collisions > Obstacle Type)
Then make your condition
active(player?) collides with backdrop then do (whatever) action
Backdrops also have built in "ladder" and "platform" movements, but considering you have a custom engine, you probably won't need to worry about those.
I actully know how to do the set obstacle part and when player collides with backdrop part but the thing im stuck on the "then do whatever part" :/
Well, it would depend on your custom movement.
If it's the file of yours I downloaded before, than just reverse the movement when the player overlaps the backdrop.
I can show you if you like?
That would be awsome :)
here ya go
Thanks man
In gerald999's example it just reverses the movement, so you'll notice white spaces because the collision is not accurate. To get more precise collisions, you would run fastloops, moveX and moveY (or something similar) in which you move in steps of 1 pixel each, and check collisions after each step. Instead of moving 3 then checking for a collision, it would do move 1 check, move 1 check, move 1 check. Then you won't have any white space inbetween your objects.
http://www.clickteam.com/website/usa/img/uploads/tutorials/download/fastloop_plattutorial.zip
DavidN's platformer tutorial should have this, I suggest you look at it, because the other method isn't going to work as well in more complex games.
-Eliyahu
thanks but the problem with that is im making a topd down shooter :[