Appreciate the tidying up job you did for me there thanks!!
I'm not being lazy when i say this, but this is just not goin well for me... Looking through the tuts on 2d tile maps on this forum has made me mor confused!
I know i make data statements n then dim the array etc... but when i try this it erased my backdrop to the original blue and more often than not it doesnt work altogether!
Im not asking for code snippets here folks
just wondering if anyone has advice on where i should go next with this!
This is what ive been attempting... creating a load o sprites and colliding off of them, but to no avail!
Rem ***** Main Source File *****
sync on : sync rate 60
backdrop off : hide mouse
randomize timer()
ScrWid = screen width() : ScrHgt = screen height()
gosub LoadImages
ink rgb(255,0,0),0
gosub Level1_main
iw4 = image width(4) : ih4 = image height(4)
DO
paste image 5,0,0,1
sprite 3,ScrWid - 100,427,6
gosub MovePLayer
TimeLeft = (time - timer()) / 1000
if TimeLeft < 0 then TimeLeft = 0
center text ScrWid / 2,10,"TIME: " + str$(TimeLeft,0)
if TimeLeft < 10 then Center text ScrWid / 2,30,"HURRY UP!!"
IF TimeLeft = 0 THEN GOSUB restart_game
sync
LOOP
end
`levels :
MovePlayer:
if upkey()=1 then dec y,2
if downkey()=1 then inc y
if rightkey()=1 then inc x
if leftkey()=1 then dec x
if x < 1 then x = 0
if x > ScrWid - iw4 then x = ScrWid - iw4
if y < 1 then y = 0
if y > ScrHgt - ih4 then y = ScrHgt - ih4
sprite 2,x,y,4
if sprite hit (2,3) = 1 then gosub hooray
if sprite hit (2,4) = 1 then dec y, 10
return
hooray:
repeat
cls rgb (100,205,100)
`hide sprite 2 : hide sprite 3
center text ScrWid / 2,10,"YOU SAVED THE CIVILIAN,CONGRATULATIONS!! Hit space to continue"
sync
until spacekey() = 1
gosub level1_main
RETURN
restart_game:
repeat
Center Text ScrWid / 2,10,"YOU FAILED THE CIVILIAN! HIT SPACE TO RETRY!"
sync
until spacekey() = 1
wait 150
GOSUB level1_main
RETURN
Level1_main:
repeat
paste image 5,0,0,1
sprite 2,5,64,4 : sprite 3,ScrWid - 100,427,6 : paste sprite 4,0,96 : paste sprite 4,10,96 : paste sprite 4, 20,96 : paste sprite 4, 30,96 : paste sprite 4, 40,96 : paste sprite 4, 50,96
center text ScrWid / 2,10,"You have 30 seconds to save the civilian!"
center text ScrWid / 2,30,"Press the SPACEKEY to start."
sync
until spacekey() = 1
time = timer() + 30000 : // add 30 seconds to the timer
x = 5
y = 64
return
LoadImages:
load image ".\Media\man1.png",4
load image ".\Media\map1.png",5
load image ".\Media\damsel.png",6
load bitmap ".\Media\map1.png"
get image 7,10,10,10,10
sprite 4, 0,0,7
return