Welcome to the forum TTSE.
A few pointers on your coding style. If you group similar lines together and in the order INPUT > PROCESS > OUTPUT, besides making it look neater, this makes the program flow easier to follow and so fewer bugs will appear.
sync on : sync rate 500
`globals for window
width= Desktop width()
height= desktop height()
set display mode width, height, 32, 1
set window off
_Game:
` sprites
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/5, 0, 1
sprite 1, x, y, 2
sprite 2, x, y, 3
sprite 3, x2, y2, 2
sprite 6, x, y3, 3
// MAIN ---------------------------------------------------
do
// INPUT //
if spacekey()
y3= y- 50
hide sprite 1
show sprite 6
else
hide sprite 6
endif
if spacekey()
if sprite mirrored(1)= 1 then mirror sprite 6
endif
if spacekey()
hide sprite 1 : show sprite 6
else
hide sprite 6
endif
if keystate(17) then y2 = y2-4
if keystate(31) then y2 = y2 + 4
if keystate(30) then x2 = x2- 4
if keystate(30)
if sprite mirrored(3)= 0 then mirror sprite 3
endif
if keystate(32) then x2 = x2 + 4
if keystate(32)
if sprite mirrored(3)= 1 then mirror sprite 3
endif
if upkey() then y = y-4
if downkey() then y = y + 4
if leftkey() then x= x-4
if rightkey() then x=x+4
if rightkey()=1 and sprite mirrored(1)= 1 then mirror sprite 1
if leftkey() and sprite mirrored(1)= 0 then mirror sprite 1
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
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() then end
// PROCESS
if x < 0 then x=0
if x > (width/50)*49 then x= (width/50)*49
if x2 < 0 then x2=0
if x2 > (width/50)*49 then x2= (width/50)*49
if y < 350 then y= 350
if y > (height/25)*24 then y=(height/25)*24
if y2 < 350 then y2 = 350
if y2 > (height/25)*24 then y2=(height/25)*24
// OUTPUT //
sprite 1,x,y, 2
sprite 2,x,y, 3
sprite 3, x2, y2, 2
sprite 6, x, y3, 3
sync
loop
Now I'll just clean it up a bit more and remove the duplicates.
sync on : sync rate 500
`globals for window
width= Desktop width()
height= desktop height()
set display mode width, height, 32, 1
set window off
_Game:
` sprites
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/5, 0, 1
sprite 1, x, y, 2
sprite 2, x, y, 3
sprite 3, x2, y2, 2
sprite 6, x, y3, 3
// MAIN ---------------------------------------------------
do
// INPUT //
if spacekey()
y3= y- 50
hide sprite 1
show sprite 6
if sprite mirrored(1)= 1 then mirror sprite 6
else
hide sprite 6
endif
if keystate(17) then y2 = y2-4
if keystate(31) then y2 = y2 + 4
if keystate(30)
x2 = x2- 4
if sprite mirrored(3)= 0 then mirror sprite 3
endif
if keystate(32)
x2 = x2 + 4
if sprite mirrored(3)= 1 then mirror sprite 3
endif
if upkey() then y = y-4
if downkey() then y = y + 4
if leftkey()
x= x-4
if sprite mirrored(1)= 0 then mirror sprite 1
endif
if rightkey()
x=x+4
if sprite mirrored(1)= 1 then mirror sprite 1
endif
// contradiction here! ---------------------
if returnkey()=1 and spacekey()=0
if sprite mirrored(1)= 1
hide sprite 1
show sprite 2
if sprite mirrored(2)= 0 then mirror sprite 2
endif
if sprite mirrored(1)= 0
hide sprite 1
show sprite 2
if sprite mirrored(2)= 1 then mirror sprite 2
else
hide sprite 2
show sprite 1
endif
endif
// --------------------------------------------
if escapekey() then end
// PROCESS
if x < 0 then x=0
if x > (width/50)*49 then x= (width/50)*49
if x2 < 0 then x2=0
if x2 > (width/50)*49 then x2= (width/50)*49
if y < 350 then y= 350
if y > (height/25)*24 then y=(height/25)*24
if y2 < 350 then y2 = 350
if y2 > (height/25)*24 then y2=(height/25)*24
// OUTPUT //
sprite 1,x,y, 2
sprite 2,x,y, 3
sprite 3, x2, y2, 2
sprite 6, x, y3, 3
sync
loop
I don't know what's going on with this section, it contradicts itself:
if returnkey()=1 and spacekey()=0
if sprite mirrored(1)= 1
hide sprite 1
show sprite 2
if sprite mirrored(2)= 0 then mirror sprite 2
endif
if sprite mirrored(1)= 0
hide sprite 1
show sprite 2
if sprite mirrored(2)= 1 then mirror sprite 2
else
hide sprite 2
show sprite 1
endif
endif
I would suggest getting rid of all this sprite mirroring, it's very silly and a bit cruel on the computer to keep asking it to mirror and unmirror images for no apparent reason. Instead it would be better to store a mirrored version of the images before the main loop, that way you can just switch images instead of mirroring all the time.
Formerly OBese87.