Class: UI::VoltorbFlip::Animation
- Inherits:
-
SpriteStack
- Object
- SpriteStack
- UI::VoltorbFlip::Animation
- Defined in:
- scripts/01450 Systems/09000 Games/00002 VoltorbFlip/02200 VoltorbFlipSprites.rb
Overview
Animations of the VoltorbFlip game
Constant Summary
Constants inherited from SpriteStack
Instance Attribute Summary
Attributes inherited from SpriteStack
#animated, #data, #moving, #stack, #viewport, #x, #y
Instance Method Summary collapse
-
#animate(tile)
Animate a tile.
-
#initialize(viewport) ⇒ Animation
constructor
Create a new animation.
-
#update_animation ⇒ Boolean
Update the animation.
Methods inherited from SpriteStack
#[], #add_background, #add_line, #add_text, #anime, #anime_delta_set, #dispose, #each, #execute_anime, #move, #move_to, #opacity, #opacity=, #push, #push_sprite, #set_origin, #set_position, #simple_mouse_in?, #size, #stop_animation, #translate_mouse_coords, #update, #update_position, #visible, #visible=, #with_cache, #with_font, #with_surface, #z, #z=
Constructor Details
#initialize(viewport) ⇒ Animation
Create a new animation
380 381 382 383 384 |
# File 'scripts/01450 Systems/09000 Games/00002 VoltorbFlip/02200 VoltorbFlipSprites.rb', line 380 def initialize() super() @animation = nil @sprite = push(0, 0, '') end |
Instance Method Details
#animate(tile)
Animate a tile
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 |
# File 'scripts/01450 Systems/09000 Games/00002 VoltorbFlip/02200 VoltorbFlipSprites.rb', line 388 def animate(tile) if (@animation = tile.content) == :voltorb @sprite.set_bitmap('voltorbflip_explode', :animation) @sprite.set_rect_div(0, 0, 8, 1) @sprite.ox = 4 @sprite.oy = 5 else @sprite.set_bitmap('voltorbflip_number', :animation) @sprite.set_rect_div(0, 0, 4, 1) @sprite.ox = 1 @sprite.oy = 2 end @counter = 0 @sprite.x = tile.x @sprite.y = tile.y @sprite.ox += @sprite.src_rect.width / 4 @sprite.oy += @sprite.src_rect.height / 4 @sprite.visible = true end |
#update_animation ⇒ Boolean
Update the animation
410 411 412 413 414 415 416 417 418 419 420 |
# File 'scripts/01450 Systems/09000 Games/00002 VoltorbFlip/02200 VoltorbFlipSprites.rb', line 410 def update_animation case @animation when :voltorb update_voltorb_animation when 1, 2, 3 update_number_animation else return false end return true end |