hey im a beginner at darkbasic pro and im having a problem spotting whats wrong with this code and this error, if anyone could give me a hand I would be very grateful.
Here is the error and code
Runtime error 506 - could not load image at line 9
sync on
sync rate 30
set dir "content\textures"
gosub vars
load image "background.jpg", bgID
for i = 1 to 3
load image "platform.jpg", platformID(i)
next i
load image "NormalCT.jpg", 1
load image "NormalCT.jpg", 2
load image "Left CT.jpg", 3
load image "Right CT.jpg", 4
load image "mjump.jpg", 5
load image "mfall.jpg", 6
REM start of main game loop REM LOOP AREA!!!
DO
anim = 0
paste image bgID, 0, 0
for i = 1 to 3
sprite platformID(i), platform1_x(i), platform1_y(i), platformID(i)
next i
if jumping = 0
old_y = playery
old_x = playerx
endif
sprite playerID, playerx, playery, imgnum
jumpmax = old_y - 150
jumpmax = old_x + 2
REM GOTO AREA!!!
gosub playerinput
gosub playeranim
gosub title
gosub gravity
gosub collision
sync
LOOP
vars: REM VARIABLES!!!
REM player and floor variables
playerID = 1
bgID = 100
gravity# = 3
jumping = 0
jumpspeed = 2
playerx = 25
playery = 0
falling = 0
return
REM animation REM LEVEL ANIMATION!!!
anim = 0
fright = 1
frame = 0
imgnum = 1
dim platformID(3)
dim platform1_x(3)
dim platform1_y(3)
ground1_x(1) = 0
ground1_y(1) = 200
for i = 1 to 3
platformID(i) = 100 + i
next i
platform1_x(1) = 0
platform1_y(1) = 460
platform1_x(2) = 233
platform1_y(2) = 460
platform1_x(3) = 466
platform1_y(3) = 460
REM tutorial title variables REM SCOREBOARD!!!
ink RGB(255,0,0), 1
title$ = "gravity"
tx = screen width()
ty = 0
title: REM TITLE!!!
text tx, ty, title$
tx = tx - 1
if tx+text width(title$) < 0
tx = screen width()
endif
if jumping = 0 and falling = 0
text 550, 75, "On ground"
endif
if jumping = 1
text 550, 35, "Jumping"
endif
if jumping = 3
text 550, 50, "Falling"
endif
if falling = 1
text 550, 50, "Falling"
endif
return
gravity: REM GRAVITY!!!
if falling = 1
playery = playery + gravity#
imgnum = 6
endif
if jumping = 1
imgnum = 5
playery = playery - (jumpspeed*3)
endif
if playery <= jumpmax
falling = 1
jumping = 3
endif
return
playeranim: REM ANIMATION!!!
if anim = 1
imgnum = 2 + (frame/2)
frame = frame + 1
if frame >= 4 then frame = 0
else
imgnum = 1
endif
collision: REM COLLISION!!!
if sprite collision (playerID, platformID(1)) = 1
falling = 0
jumping = 0
playery = playery
endif
if sprite collision (playerID, platformID(3)) = 1
falling = 0
jumping = 0
playery = playery
endif
if sprite collision (playerID, platformID(2)) = 1
falling = 0
jumping = 0
playery = playery
endif
if falling = 0 and sprite collision (playerID, 0) = 0
falling = 1
endif
return
playerinput: REM CONTROLS!!!
if rightkey() = 1
if controlkey() = 1
REM running right
playerx = playerx + 3
endif
playerx = playerx + 2
if fright = 0
mirror sprite 1
fright = 1
endif
anim = 1
endif
REM walking left
if leftkey() = 1
if controlkey() = 1
playerx = playerx - 3
endif
playerx = playerx - 2
if fright = 1
mirror sprite 1
fright = 0
endif
anim = 1
endif
REM jumping
if upkey() and rightkey() = 1 and jumping = 0 and falling = 0
playery = playery - 1
playery = playery - 2
playery = playery - 3
playery = playery - 4
playery = playery - 5
playery = playery - 6
playerx = playerx + 1
playerx = playerx + 2
playerx = playerx + 3
playerx = playerx + 4
playerx = playerx + 5
playerx = playerx + 6
playerx = playerx + 1
playerx = playerx + 2
playerx = playerx + 3
playerx = playerx + 4
playerx = playerx + 5
playerx = playerx + 6
playerx = playerx + 1
playerx = playerx + 2
playerx = playerx + 3
endif
if upkey() = 1 and jumping = 0 and falling = 0
playery = playery - 1
playery = playery - 2
playery = playery - 3
playery = playery - 4
playery = playery - 5
playery = playery - 6
playery = playery - 1
playery = playery - 2
playery = playery - 3
playery = playery - 4
playery = playery - 5
playery = playery - 6
playery = playery - 1
playery = playery - 2
playery = playery - 3
endif
if upkey() and leftkey() = 1 and jumping = 0 and falling = 0
playery = playery - 1
playery = playery - 2
playery = playery - 3
playery = playery - 4
playery = playery - 5
playery = playery - 6
playerx = playerx - 1
playerx = playerx - 2
playerx = playerx - 3
playerx = playerx - 4
playerx = playerx - 5
playerx = playerx - 6
playerx = playerx - 1
playerx = playerx - 2
playerx = playerx - 3
playerx = playerx - 4
playerx = playerx - 5
playerx = playerx - 6
playerx = playerx - 1
playerx = playerx - 2
playerx = playerx - 3
endif
REM player reset
if inkey$() = "r"
playerx = 25
playery = 0
endif
return
Yello http://www.youtube.com/user/Rikukarasuma?feature=mhee