bacongamejam05-notsoalonein.../src/lib/helpers.coffee
2013-06-13 21:46:14 +02:00

8 lines
251 B
CoffeeScript

# updates the canvas
update_canvas = (width, height) ->
canvas.width = width
canvas.height = height
# a range mapper which maps 's' to 'to' based on 'from'
map_range = (from, to, s) ->
to[0] + (s-from[0]) * (to[1] - to[0]) / (from[1] - from[0])