I did some major upgrades to my original code. Still can't figure out how to jump, or how to add enemies. Help would be greatly appreciated.
sync on : hide mouse : sync rate 500
`globals for window
width= Desktop width()
height= desktop height()
set display mode width, height, 32, 1
set window off
`music
load music "musictestlink.mp3", 1
play music 1
set music speed 1, 125
loop music 1
`sound effects
load sound "OOT_AdultLink_Attack1.wav", 1
` sprites
load image "trees3.png", 4
load image "BG_concept_7.3field.jpg", 1
load image "player.png" , 2
load image "playersword.png", 3
`integers
x= 0
y= 400
x2= 0
y2= 410
x3= x
y3=y
sprite 5, 0, 0, 1
sprite 4, width/10, 0, 1
sprite 1, x, y, 2
sprite 2, x, y, 3
sprite 3, x2, y2, 2
sprite 6, x, y3, 3
do
sprite 6, x, y3, 3
if spacekey()
y3= y- 50
hide sprite 1
show sprite 6
else hide sprite 6
endif
if spacekey()=1
if sprite mirrored(1)= 1 then mirror sprite 6
endif
sprite 3, x2, y2, 2
if keystate(17)
y2 = y2-4
endif
if y2 < 350
y2 = 350
endif
if keystate(31)
y2 = y2 + 4
endif
if y2 > (height/25)*24
y2=(height/25)*24
endif
if keystate(30)
x2 = x2- 4
endif
if keystate(30)
if sprite mirrored(3)= 0 then mirror sprite 3
endif
if x2 < 0
x2=0
endif
if keystate(32)
x2 = x2 + 4
endif
if keystate(32)
if sprite mirrored(3)= 1 then mirror sprite 3
endif
if x2> (width/50)*49
x2= (width/50)*49
ENDIf
sprite 2,x,y, 3
if returnkey()=1 and sprite mirrored(1)= 0 and spacekey()=0
hide sprite 1
show sprite 2
else
hide sprite 2
show sprite 1
endif
if returnkey()=1 and sprite mirrored(1)=0 and sprite mirrored(2)= 1 and spacekey()= 0 then mirror sprite 2
sprite 1,x,y, 2
if upkey()
y = y-4
endif
if y < 350
y= 350
endif
if y > (height/25)*24
y=(height/25)*24
endif
if downkey()
y = y + 4
endif
if leftkey()
if sprite mirrored(1)= 0 then mirror sprite 1
endif
if x < 0
x=0
endif
if leftkey()
x= x-4
endif
if rightkey()
x=x+4
endif
if rightkey()=1
if sprite mirrored(1)= 1 then mirror sprite 1
endif
if x> (width/50)*49
x= (width/50)*49
ENDIf
if spacekey()
hide sprite 1 : show sprite 6
else hide sprite 6
endif
if returnkey()=1 and spacekey()= 0 then play sound 1
if returnkey()=1 and sprite mirrored(1)= 1 and spacekey()= 0
hide sprite 1
show sprite 2
endif
if returnkey()=1 and sprite mirrored(1)= 1 and sprite mirrored(2)= 0 and spacekey()= 0
mirror sprite 2
endif
if escapekey()
end
ENDIF
sync
loop
Just delete the lines for music and trees. I can't get them to place in the right loaction anyway.
We all come to a time when we look at the entire picture and think... "Oh dear God, what horrible abomination of a code have I made?"