Log In  

Here is my code so far. I am trying to get the fish on the screen to move in an upward motion by itself, after I can master this I am going to try to do a collision detection for if the frog touches the fish = game over. Can anyone give me pointers on making the fish move by itself? Thank you

function _update()
fish_sprite+=18
if fish_sprite > 19 then
fish_sprite=18
end

char_sprite+=1
if char_sprite > 9 then
char_sprite=1
end

if btn(0) then char_x=char_x-1 sfx(05) end
if btn(1) then char_x=char_x+1 sfx(05) end
if btn(2) then char_y=char_y-1 sfx(05) end
if btn(3) then char_y=char_y+1 sfx(05) end
end

fish_sprite+=18
if fish_sprite > 19 then
char_sprite=18
end

function _draw()
cls()
map(0,0)
spr( char_sprite, char_x, char_y)
spr( fish_sprite, fish_x, fish_y)

print( time())
end

P#69205 2019-10-23 17:36


[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 16:17:50 | 0.008s | Q:8