Permalink
Browse files

refactoring

  • Loading branch information...
hoshi-sano committed Dec 12, 2016
1 parent 4879637 commit 348e8b0e085cb9cb7a35b39830e402acddf40b51
Showing with 2 additions and 4 deletions.
  1. +2 −4 main.rb
View
@@ -183,8 +183,8 @@ def combo_break
cursor = Cursor.new(chara)
gage = PowerGage.new
tb = TrashBox.new
-sprites = [chara, tb, cursor, gage]
balls = []
+sprites = [chara, tb, cursor, gage, balls]
update_targets = [balls, gage, tb]
playing = false
@@ -222,9 +222,7 @@ def combo_break
gage.show
elsif Input.key_release?(K_Z)
power = gage.hide
- ball = Ball.new(power, cursor, tb)
- balls << ball
- sprites << ball
+ balls << Ball.new(power, cursor, tb)
end
Sprite.draw(sprites)
Sprite.update(update_targets)

0 comments on commit 348e8b0

Please sign in to comment.