Ok iv come a far way but now have come across a strange issue iv been looking at this for ages but can't seem to find my problem
REM Project: CameronGame
REM Created: 9/07/2010 1:42:21 PM
REM
REM ***** Main Source File *****
REM
SYNC RATE 60 ` sync
SYNC ON
MAKE CAMERA 1 ` add a camera
POSITION CAMERA 1,0,15,-30
POINT CAMERA 1, 0,0,0
TYPE player ` Add type, player, set player values
walking_left AS INTEGER
walking_right AS INTEGER
faceing_right AS INTEGER
faceing_left AS INTEGER
atkPwr AS INTEGER
armCls AS INTEGER
HP AS INTEGER
MP AS INTEGER
XP AS INTEGER
speed AS FLOAT
attack AS INTEGER
fall_speed AS FLOAT
jumpspeed AS FLOAT
currentX AS FLOAT
currentY AS FLOAT
oldX AS FLOAT
oldY AS FLOAT
ENDTYPE
TYPE enemy ` Add type, player, set player values
atkPwr AS INTEGER
armCls AS INTEGER
HP AS INTEGER
MP AS INTEGER
XP AS INTEGER
speed AS FLOAT
fall_speed AS FLOAT
jumpspeed AS FLOAT
ENDTYPE
TYPE items ` Add type, Items, set types of items
armour AS STRING
ENDTYPE
DIM items(1) as items ` make a item array 1 field big
DIM player(1) as player ` make a player array 1 field big
DIM enemy(7) as enemy ` make a player array 1 field big
GLOBAL jump as integer = 0 ` make jump golbal
GLOBAL fall as integer = 0 ` make fall golbal
player(1).fall_speed = 0.5 ` set fall speed for player
player(1).speed = 0.3 ` set speed for player
player(1).jumpspeed = 0.5 ` set jump speed for player
player(1).attack = 0
player(1).walking_right = 0
player(1).walking_left = 0
player(1).faceing_right = 0
player(1).faceing_left = 0
player(1).currentX = 0
player(1).currentY = 0
player(1).oldX = 0
player(1).oldY = 0
enemy(6).jumpspeed = 1.0
enemy(6).HP = 15
enemy(6).speed = 0.05
enemy(7).jumpspeed = 1.0
enemy(7).HP = 3
enemy(7).speed = 0.1
MAKE OBJECT CUBE 10,5 ` create a cube
POSITION OBJECT 10,0,0,0
SCALE OBJECT 10, 500,100,100
SC_SETUPOBJECT 10, 1, 2
MAKE OBJECT CUBE 11,5 ` create a cube
POSITION OBJECT 11,25,-15,0
SCALE OBJECT 11, 1000,100,100
SC_SETUPOBJECT 11, 1, 2
MAKE OBJECT CUBE 12,5 ` create a cube
POSITION OBJECT 12,50,-10,0
SCALE OBJECT 12, 1500,100,100
SC_SETUPOBJECT 12, 1, 2
`The player
LOAD OBJECT "bruce.x", 3
LOAD IMAGE "bruce.bmp", 1
SCALE OBJECT 3, 10,10,10
ROTATE OBJECT 3, 0, 90 , 0
TEXTURE OBJECT 3, 1
POSITION OBJECT 3,0, 10,0
SC_SETUPOBJECT 3, 2, 2
MAKE OBJECT CUBE 2, 2 ` create a cube
POSITION OBJECT 2, 0, 0, 0
SC_SETUPOBJECT 2, 2, 2
MAKE OBJECT CUBE 4, 4 ` create a cube
POSITION OBJECT 4, 0, 10, 0
COLOR OBJECT 4, rgb(100, 0, 0)
GHOST OBJECT ON 4
LOAD IMAGE "ninja.png",2
LOAD OBJECT "ninja.X", 6
POSITION OBJECT 6, 30, -5, 0
COLOR OBJECT 6, rgb(0, 0, 100)
SC_SETUPOBJECT 6, 2, 2
LOAD OBJECT "ninja.X", 7 ` create a cube
POSITION OBJECT 7, 20, -5, 0
COLOR OBJECT 7, rgb(100, 0, 100)
SC_SETUPOBJECT 7, 2, 2
TEXTURE OBJECT 6, 2
TEXTURE OBJECT 7, 2
SCALE OBJECT 6, 10,10,10
SCALE OBJECT 7, 10,10,10
SET OBJECT SPEED 3, 20
DO ` game loop
POSITION OBJECT 3, OBJECT POSITION X(2), OBJECT POSITION Y(2), OBJECT POSITION Z(2) ` make cubes follow player
IF player(1).faceing_right =1
POSITION OBJECT 4, OBJECT POSITION X(2)+1, OBJECT POSITION Y(2), OBJECT POSITION Z(2)
ELSE
IF player(1).faceing_left =1
POSITION OBJECT 4, OBJECT POSITION X(2)-1, OBJECT POSITION Y(2), OBJECT POSITION Z(2)
ELSE
POSITION OBJECT 4, OBJECT POSITION X(2), OBJECT POSITION Y(2), OBJECT POSITION Z(2)
ENDIF
ENDIF
POSITION CAMERA 1, OBJECT POSITION X(2),15,-30 ` make camera follow player
player(1).currentX = OBJECT POSITION X(2)
player(1).currentY = OBJECT POSITION Y(2)
updatePosition()
gravity()
playCont()
hittest()
ai()
TEXT 0, 0, "KEY: " +str$(SCANCODE())
SYNC
LOOP
FUNCTION gravity() ` character falls
IF SC_GROUPCOLLISION(3,1)= 0
MOVE OBJECT DOWN 2, player(1).fall_speed
fall = 1
ENDIF
FOR n = 6 to 7
IF SC_GROUPCOLLISION(n,1)= 0
MOVE OBJECT DOWN n, player(1).fall_speed
ENDIF
NEXT n
FOR n = 10 to 12
IF OBJECT POSITION Y(2) > OBJECT POSITION Y(n) - 1
IF OBJECT COLLISION(2, n) = 1
POSITION OBJECT 2, OBJECT POSITION X(2), OBJECT POSITION Y(n) + 3.0, OBJECT POSITION Z(2)
jump = 0
FALL = 0
player(1).jumpspeed = 1.0
ENDIF
ENDIF
NEXT n
FOR n = 6 to 7
FOR i = 10 to 12
IF OBJECT POSITION Y(n) > OBJECT POSITION Y(i) - 1
IF OBJECT COLLISION(n, i) = 1
POSITION OBJECT n, OBJECT POSITION X(n), OBJECT POSITION Y(i) + 2.4, OBJECT POSITION Z(n)
enemy(n).jumpspeed = 1.0
ENDIF
ENDIF
NEXT n
NEXT n
FOR n = 10 to 12
IF OBJECT COLLISION(2, n) = 1 AND walking_right = 1 AND OBJECT POSITION Y(2) < OBJECT POSITION Y(n)
MOVE OBJECT LEFT 2, player(1).speed
ENDIF
NEXT n
ENDFUNCTION
FUNCTION playCont() ` player movents
IF RIGHTKEY()=1
player(1).faceing_right = 1
player(1).faceing_left = 0
ROTATE OBJECT 3, 0, 270 , 0
MOVE OBJECT RIGHT 2,player(1).speed
player(1).walking_right =1
IF jump = 0
IF player(1).attack = 0
LOOP OBJECT 3, 15, 34
ENDIF
ENDIF
ELSE
IF LEFTKEY()=1
player(1).faceing_left = 1
player(1).faceing_right = 0
ROTATE OBJECT 3, 0, 90 , 0
MOVE OBJECT LEFT 2,player(1).speed
player(1).walking_left =1
IF jump = 0
IF player(1).attack = 0
LOOP OBJECT 3, 15, 34
ENDIF
ENDIF
ELSE
player(1).walking_right =0
player(1).walking_left =0
IF jump = 0
IF player(1).attack = 0
LOOP OBJECT 3, 1, 8
ENDIF
ENDIF
ENDIF
ENDIF
IF KEYSTATE(31) = 1 AND jump = 0 AND fall = 0
jump = 1
PLAY OBJECT 3, 40, 50
ENDIF
IF jump = 1
MOVE OBJECT UP 2, player(1).jumpspeed
DEC player(1).jumpspeed, 0.02
ENDIF
IF KEYSTATE(30)=1
GHOST OBJECT OFF 4
player(1).attack = 1
LOOP OBJECT 3, 70, 80
ELSE
GHOST OBJECT ON 4
player(1).attack = 0
ENDIF
ENDFUNCTION
FUNCTION hittest()
FOR n = 6 to 7
IF OBJECT COLLISION(4, n) = 1
IF player(1).attack = 1
IF OBJECT POSITION X(3) > OBJECT POSITION X(n)
MOVE OBJECT LEFT n, enemy(n).jumpspeed
MOVE OBJECT UP n, enemy(n).jumpspeed
DEC enemy(n).jumpspeed, 0.01
DEC enemy(n).HP, 1
ELSE
IF OBJECT POSITION X(3) < OBJECT POSITION X(n)
MOVE OBJECT RIGHT n, enemy(n).jumpspeed
MOVE OBJECT UP n, enemy(n).jumpspeed
DEC enemy(n).jumpspeed, 0.01
DEC enemy(n).HP, 1
ENDIF
ENDIF
ENDIF
ENDIF
NEXT n
ENDFUNCTION
FUNCTION ai()
FOR n = 6 to 7
IF OBJECT POSITION X(3) < OBJECT POSITION X(n)
MOVE OBJECT LEFT n, enemy(n).speed
ELSE
IF OBJECT POSITION X(3) > OBJECT POSITION X(n)
MOVE OBJECT RIGHT n, enemy(n).speed
ENDIF
ENDIF
NEXT n
FOR n = 6 to 7
IF enemy(n).HP <= 0
POSITION OBJECT n, 1000, 0, 0
ENDIF
NEXT n
ENDFUNCTION
FUNCTION updatePosition()
FOR n = 10 to 12
IF OBJECT COLLISION(2, n) = 0
player(1).oldX = player(1).currentX
player(1).oldY = player(1).currentY
ELSE
player(1).currentX = player(1).oldX
player(1).currentY = player(1).oldY
POSITION OBJECT 2, player(1).currentX, player(1).currentY, 0
ENDIF
NEXT n
ENDFUNCTION
My issue is with the player. At the bottom of the code youll see a function called "updatePosition" this is ment to be used to determin if the player is colliding will a platform thus changing his current x,y to be the previous x,y that wasnt colliding with the platform. I know higher up is a gravity function which dose basicly this already but i want to get rid of that so I can just use this methoid as it works for both x and y not just y.
My issue is that only the first platform seems to be effected, the side collision is perfect and works as i would hope, but I can move left or right on it. The other to platforms arnt effected. Iv looked at this for hours and cant see why, any help would be great thanks.