hello friends coders !
Here are a function equivalent to the move command DB PRO
Hoping to be useful for everyone!
Enjoy !!!
function move(sprite,speed)
rem if angle out of 0 - 360
repeat
setSpriteAngle(sprite,getspriteangle(sprite)-5)
until GetSpriteAngle(sprite)<=360
repeat
setSpriteAngle(sprite,getspriteangle(sprite)+5)
until GetSpriteAngle(sprite)>=0
rem move
if getspriteangle(sprite)=>0 and getspriteangle(sprite)<=90
setSpritePositionByOffset(sprite,GetSpriteXByOffset(sprite)+speed*(sin(GetSpriteAngle(sprite))*1),GetSpriteYByOffset(sprite)-speed*(cos(GetSpriteAngle(sprite)*1)))
endif
if getspriteangle(sprite)>90 and getspriteangle(sprite)<=180
setSpritePositionByOffset(sprite,GetSpriteXByOffset(sprite)+speed*(sin(GetSpriteAngle(sprite))*1),GetSpriteYByOffset(sprite)-speed*(cos(GetSpriteAngle(sprite)*1)))
endif
if getspriteangle(sprite)>180 and getspriteangle(sprite)<=270
setSpritePositionByOffset(sprite,GetSpriteXByOffset(sprite)+speed*(sin(GetSpriteAngle(sprite))*1),GetSpriteYByOffset(sprite)-speed*(cos(GetSpriteAngle(sprite)*1)))
endif
if getspriteangle(sprite)>270 and getspriteangle(sprite)<=360
setSpritePositionByOffset(sprite,GetSpriteXByOffset(sprite)+speed*(sin(GetSpriteAngle(sprite))*1),GetSpriteYByOffset(sprite)-speed*(cos(GetSpriteAngle(sprite)*1)))
endif
endfunction
Captain-Ouais !
I do what i do !!!