Hey just having a problem with something.
Basically I've set an array of cubes for a game I'm making to be collided with by the player, I have him colliding fine with the top and bottom of each cube, but it's going through the sides.
FOR i = 1 TO 16
IF OBJECT COLLISION (10 + i , player.objNum)
` TO THE LEFT OF THE BRICK
` TO THE RIGHT OF THE BRICK
` ABOVE THE BRICK
IF (OBJECT POSITION Y(player.objNum)) > OBJECT POSITION Y (10 + i) AND OBJECT POSITION X(player.objNum) < (OBJECT POSITION X (10 + i) + (100.26 / 10.0)) AND OBJECT POSITION X (player.objNum) > (OBJECT POSITION X (10 + i) - (100.26 / 10.0))
IF playerMovement.y < 0
playerMovement.y = 0
bJumping = 0
ENDIF
` BELOW THE BRICK
ELSE
IF (OBJECT POSITION Y(player.objNum)) < OBJECT POSITION Y (10 + i) AND OBJECT POSITION X(player.objNum) < (OBJECT POSITION X (10 + i) + (100.26 / 10.0)) AND OBJECT POSITION X (player.objNum) > (OBJECT POSITION X (10 + i) - (100.26 / 10.0))
IF playerMovement.y > 0
playerMovement.y = playerMovement.y * -1
ENDIF
ENDIF
ENDIF
ENDIF
NEXT i
The 100.26 is just the size of the cube.
It's in a for loop because I've loaded all of the cubes in my level via an array (10 + i).
Does anyone have a idea how I could make the player collide with the sides of the object without going through it?
Any help / code will be greatly appreciated!