Skip to content

Commit

Permalink
Added Mirage.Tools
Browse files Browse the repository at this point in the history
  • Loading branch information
chrome committed May 14, 2012
1 parent 423eda5 commit 35f3357
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ unitedFiles = ->
files = [
'core/mirage'
'core/object'
'core/tools'
'entities/resources/resource'
'entities/resources/image'
'entities/resources/animation'
Expand Down
5 changes: 5 additions & 0 deletions src/core/tools.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Mirage.Tools
@distantion: (sX, sY, dX, dY) ->
dX = Math.abs(sX - dX)
dY = Math.abs(sY - dY)
Math.round(Math.sqrt(dX * dX + dY * dY))

0 comments on commit 35f3357

Please sign in to comment.