Permalink
Browse files

simplified game class name to make everything moar ez

  • Loading branch information...
1 parent 93a471d commit 15187c538cb48bcebfc4b61e0d337ab4cfe20cbf Florian Hufsky committed Apr 19, 2008
Showing with 4 additions and 5 deletions.
  1. +1 −1 olympics/olympics.rb
  2. +1 −2 play.rb
  3. +1 −1 shufflepuit_cafe/shufflepuit_cafe.rb
  4. +1 −1 spaceinvaders/spaceinvaders.rb
@@ -5,7 +5,7 @@ module Z
end
-class OlympicsGame < Game
+class Olympics < Game
resolution [160*4, 100*4]
def setup
View
@@ -23,8 +23,7 @@
println "no game #{$game_name} found" and exit unless $game_name.is_folder?
# PLAY!
-class_name = "#{$game_name.capitalize}_game"
-$game_class = class_name.instantiate rescue quit("Your game class needs to be called #{class_name}")
+$game_class = $game_name.classify.instantiate rescue quit("Your game class needs to be called #{class_name}")
begin
$game_class.run
@@ -1,7 +1,7 @@
# http://en.wikipedia.org/wiki/Shufflepuck_Cafe
# thx http://youtube.com/watch?v=9pUmfxM9h54
-class ShufflepuitCafeGame < Game
+class ShufflepuitCafe < Game
def setup
@objects << Ball.new
end
@@ -2,7 +2,7 @@
# cc oneup
# thx kingpepe
-class SpaceinvadersGame < Game
+class Spaceinvaders < Game
attr_accessor :player
def setup

0 comments on commit 15187c5

Please sign in to comment.