Code: Select all
If (*me\y + 16) > *box\y And *me\y < (*box\y + 16) And (*me\x + 15) > *box\x And (*me\x + 15) < (*box\x + 16)
*me\x = *box\x - 16
EndIf

Code: Select all
If (*me\y + 16) > *box\y And *me\y < (*box\y + 16) And (*me\x + 15) > *box\x And (*me\x + 15) < (*box\x + 16)
*me\x = *box\x - 16
EndIf


Code: Select all
Procedure CheckCollisions(*me.Player, *box.Point, *sys.Options)
;*me.Player= AllocateMemory(SizeOf(Player))
;*box.Point= AllocateMemory(SizeOf(Point))
;*sys.Options= AllocateMemory(SizeOf(Options))
If SectorCollision(*me\x, *me\y, 16, 16, *box\x, *box\y, 16, 16) = 1
*me\y = *box\y - 16
*me\Jumps = *sys\Jumps
*me\JumpTimer = *sys\JumpTime
*me\v = 0
EndIf
If SectorCollision(*me\x, *me\y, 16, 16, *box\x, *box\y, 16, 16) = 3 ;Collision with BOTTOM of platform
*me\v = 0
*me\y = *box\y + 16
EndIf
;If (*box\x - 16) < *me\x And *me\x < (*box\x + 16) And (*box\y - 16) < *me\y And *me\y < (*box\y + 16) ;Collision with RIGHT of platform
If SectorCollision(*me\x, *me\y, 16, 16, *box\x, *box\y, 16, 16) = 2
*me\x = *box\x - 16
EndIf
If SectorCollision(*me\x, *me\y, 16, 16, *box\x, *box\y, 16, 16) = 4 ;Collision with LEFT of platform
*me\x = *box\x + plWidth
End
EndIf
EndProcedure