Hey jusy trying to amke a platformer game for school, this is what iv got so far
REM Project: CameronGame
REM Created: 9/07/2010 1:42:21 PM
REM
REM ***** Main Source File *****
REM
SYNC RATE 60
SYNC ON
make camera 1
position camera 1,0,15,-30
point camera 1, 0,0,0
type player
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
armour as string
endtype
dim items(1) as items
dim player(1) as player
GLOBAL jump AS INTEGER = 0
GLOBAL fall AS INTEGER = 0
player(1).fall_speed = 0.1
player(1).speed = 0.3
player(1).jumpspeed = 1.0
make object cube 10,5
position object 10,0,0,0
scale object 10, 500,100,100
sc_setupobject 10, 1, 2
make object cube 11,5
position object 11,25,-15,0
scale object 11, 500,100,100
sc_setupobject 11, 1, 2
`The player
make object cube 3,0.25
position object 3,0, 10,0
sc_setupobject 3, 2, 2
make object cube 2,2
position object 2, 0, 0, 0
`sc_setupobject 2, 2, 2
do
POSITION OBJECT 2, OBJECT POSITION X(3), OBJECT POSITION Y(3), OBJECT POSITION Z(3)
position camera 1, OBJECT POSITION X(2),15,-30
gravity()
playCont()
TEXT 0, 0, "KEY: " +str$(SCANCODE())
sync
loop
remstart
for n = 1 to 5
player(n).x = 500
next n
remend
function gravity()
if sc_groupcollision(3,1)= 0
move object down 3, player(1).fall_speed
fall = 1
endif
FOR n = 10 to 11
IF OBJECT COLLISION(3, n) = 1 AND OBJECT POSITION Y(3) > OBJECT POSITION Y(n) - 1
POSITION OBJECT 3, OBJECT POSITION X(3), OBJECT POSITION Y(n) + 2.4, OBJECT POSITION Z(3)
jump = 0
FALL = 0
player(1).jumpspeed = 1.0
ENDIF
NEXT n
endfunction
function playCont()
if rightkey()=1
move object right 3,player(1).speed
endif
if leftkey()=1
move object left 3,player(1).speed
endif
IF KEYSTATE(31) = 1 AND jump = 0 and fall = 0
jump = 1
endif
if jump = 1
move object up 3, player(1).jumpspeed
dec player(1).jumpspeed, 0.05
endif
endfunction
Just wonder if this code if good, or if there are anyways to improve it. Ill need some more help later and at the moment this works but I want to learn good codeing so i can work witha higher standard, thanks