During the collision
callback method, we will set the collision markers and objects, so that we can act on them during the OnObjectUpdate
method.
1. Start with a
Select
statement on the first object's collision group.Method OnObjectCollision:Int(obj:ftObject, obj2:ftObject) Select obj.GetColGroup()
2. Check whether it is a wall.
Case g.grpWall
3. If the second object is in the player's second collision zone (128 pixels away), then set
g.hitWall2
toTrue
. We do this by checking the collision group of the second object.If obj2.GetColGroup()=g.grpPlayer2 Then g.hitWall2=True
4. Now, check whether the second object is the first collision zone of the player (64 pixels away), and if yes, set
g.hitWall
toTrue
.If obj2.GetColGroup()=g.grpPlayer Then g.hitWall=True
5. Check whether the first object is a crate.
Case g.grpCrate
6. If the second object is the first collision zone of the player, then set
g.hitCrate
with the first object.If obj2.GetColGroup...