Skip to content

Commit

Permalink
Display the help for each level in output at the right time
Browse files Browse the repository at this point in the history
  • Loading branch information
deadprogram committed Dec 23, 2011
1 parent c27d73e commit 39bbc8f
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions lib/kidsruby/rubywarrior.rb
Expand Up @@ -17,12 +17,29 @@ class Game
def verify_setup
make_game_directory unless File.exist?(Config.path_prefix + '/rubywarrior')
end

alias_method :prepare_next_level_original, :prepare_next_level
def prepare_next_level
prepare_next_level_original
next_level.display_description
end
end

# do not load player class from rubywarrior directory, cause it should be in kid editor
# do not load player class from rubywarrior directory, because it should be in kid's editor
class Level
def load_player
def load_player; end

def display_description
load_level
UI.puts PlayerGenerator.new(self).level_description
end
end

class PlayerGenerator
def level_description
read_template(templates_path + '/README.erb')
end
end

end

0 comments on commit 39bbc8f

Please sign in to comment.