Permalink
Browse files

Merge branch 'master' of github.com:ChicoTeam/chingu

  • Loading branch information...
2 parents 17338cb + b4d3dc7 commit 7c07e13a004dee5d20d31c7e14cd8da4aa615a4f @kgraves kgraves committed Sep 25, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 examples/game1.rb
View
@@ -39,6 +39,10 @@ def initialize(options = {})
@bg1 = Color.new(0xFFCE28FF)
@bg2 = Color.new(0xFF013E87)
+ @text = Text.create("Score:", :size => 20, :x => 30, :y => 10) #initialize score string
+ @text1 = Text.create("0", :size => 20, :x => 90, :y => 10 ) #initialize score value to 0
+
+
end
#
@@ -95,6 +99,9 @@ def update
bullet.die
if enemy.hit_by(bullet)
@player.score += 20
+ @text1.destroy! #destroy old score
+ @text1 = Text.create(@player.score, :size => 20, :x => 90, :y => 10 ) #update the new score
+
end
end

0 comments on commit 7c07e13

Please sign in to comment.