If i understand you, the purpose of this code is to change image of some sprite that is allways drawed at center of the screen.If that's the case, i made 5 dummy images just to work with because there is no media attached.I cut 2 lines of code because the first contains few variables that aren't provided so i didnt know what values to put in there.Second line is same as the one above the 2 so it does the same and without the values of the missing variables is pointless to be there.
What i've changed is
POKeysUp flag to global boolean variable.It needs to be global or function won't work.
Also touched
sprite width and
sprite height values to match sprite number that's used, in this case
sprite 3.
@Clonkex - It wasn't that complicated after all.
Global POMarkerPosition as integer
POMarkerPosition = 3
Global POKeysUp as boolean
load image "sprite1.bmp",1
load image "sprite2.bmp",2
load image "sprite3.bmp",3
load image "sprite4.bmp",4
load image "sprite5.bmp",5
sprite 3,(screen width()/2) - (image width(3) / 2),(screen height()/2) - (image height(3) / 2),POMarkerPosition
`stretch sprite 3,INT((POScrWidth# / POScrWConst#)*POScrConversion#),INT((POScrHeight# / POScrHConst#)*POScrConversion#)
`sprite 3,(screen width()/2) - (sprite width(2) / 2),(screen height()/2) - (sprite height(2) / 2),POMarkerPosition
do
POMarkerUpdate()
sync
loop
function POMarkerUpdate()
if leftkey() = 0 and rightkey() = 0 and upkey() = 0 and downkey() = 0
POKeysUp = 1
endif
if POMarkerPosition <> 5 and POKeysUp = 1 and rightkey() = 1
POKeysUp = 0
Inc POMarkerPosition
sprite 3,(screen width()/2) - (sprite width(3) / 2),(screen height()/2) - (sprite height(3) / 2),POMarkerPosition
endif
if POMarkerPosition <> 1 and POKeysUp = 1 and leftkey() = 1
POKeysUp = 0
Dec POMarkerPosition
sprite 3,(screen width()/2) - (sprite width(3) / 2),(screen height()/2) - (sprite height(3) / 2),POMarkerPosition
endif
endfunction
Coding is My Kung Fu!
And My Kung Fu is better than Yours!