Exploding zombies, classic
Point sprite code:
function pointSprite(spriteID,x#,y#,adjust#)
dx# = x#-getSpriteXbyOffset(spriteID)
dy# = y#-getSpriteYbyOffset(spriteID)
setSpriteAngle(spriteID,atanfull(dx#,dy#)+adjust#)
endfunction
Move sprite code:
function moveSprite(spriteID, amount#)
a# = getSpriteAngle(spriteID)
x# = getSpriteXbyOffset(spriteID)
y# = getSpriteYbyOffset(spriteID)
setSpritePositionByOffset(spriteID,x#+cos(a#)*amount#,y#+sin(a#)*amount#)
endfunction
Move sprite up:
function moveSpriteUp(spriteID, amount#)
a# = getSpriteAngle(spriteID)
x# = getSpriteXbyOffset(spriteID)
y# = getSpriteYbyOffset(spriteID)
setSpritePositionByOffset(spriteID,x#+sin(a#)*amount#,y#-cos(a#)*amount#)
endfunction
The main issue here I think was it helps to use the atanfull command rather than atan.
this.mess = abs(sin(times#))