Set sprite dimensions as attributes, and allow for easing abortion

feature/coffeescript
Sven Slootweg 10 years ago
parent 3a8ed9bd36
commit c4c22ee529

File diff suppressed because one or more lines are too long

@ -113,6 +113,9 @@ class Ease
@finished = false @finished = false
@next = @next.next @next = @next.next
abort: =>
@finished = true
updateValue: (current_frame) => updateValue: (current_frame) =>
# We recalculate here, to deal with 'stacked' easings. If we don't do this, letting multiple # We recalculate here, to deal with 'stacked' easings. If we don't do this, letting multiple
# easings operate on each other will result in the final value being different from 'end', # easings operate on each other will result in the final value being different from 'end',

@ -1,6 +1,6 @@
class Sprite class Sprite
constructor: (@engine, @name, @image) -> constructor: (@engine, @name, @image) ->
pass {width: @width, height: @height} = @getSize()
draw: (x, y, options = {}, surface = "") => draw: (x, y, options = {}, surface = "") =>
surface = @engine.getSurface(surface) surface = @engine.getSurface(surface)
@ -9,4 +9,4 @@ class Sprite
surface.drawImage(@image, x, y) surface.drawImage(@image, x, y)
getSize: => getSize: =>
return {width: @image.width, height: @image.height} return {width: @image.width, height: @image.height}

Loading…
Cancel
Save