public
Created

orbit spell in the wizard game

  • Download Gist
orbit.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12
self.say(' ')
self.move(self.whatDist('wizard:f91e'))
var phi = 0
 
self.think(function () {
var d = self.whatDist('wizard:f91e')
self.move({x:d.x+Math.cos(phi*Math.PI)*150,y:d.y+Math.sin(phi*Math.PI)*150})
self.say(round(phi) + 'π', { fill : 'white', color : 'purple' })
phi += 0.1
})
 
function round (n) { return Math.round(n*1000)/1000 }

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.