Sha256: 1ea0945ace2a449752bd56b95d38bf77d6d14ff7b14cf57e03d48ae790d7236e

Contents?: true

Size: 881 Bytes

Versions: 3

Compression:

Stored size: 881 Bytes

Contents

# lib/gemwarrior/game.rb
# Main launching point for Gem Warrior

require_relative 'constants'
require_relative 'world'
require_relative 'player'

require_relative 'repl'
require_relative 'evaluator'

module Gemwarrior
  class Game
    include AttributePools

    def initialize
      # create new world and player
      @world = World.new
      @player = Player.new(
        PLYR_LEVEL_DEFAULT,
        PLYR_XP_DEFAULT,
        PLYR_HP_CUR_DEFAULT,
        PLYR_HP_MAX_DEFAULT,
        PLYR_STAM_CUR_DEFAULT,
        PLYR_STAM_MAX_DEFAULT,
        PLYR_ATK_LO_DEFAULT,
        PLYR_ATK_HI_DEFAULT,
        Inventory.new,
        PLYR_ROX_DEFAULT,
        @world.loc_by_id(0)
      )
      @world.player = @player

      # create the console
      @eval = Evaluator.new(@world)
      @repl = Repl.new(@world, @eval)

      # enter Jool!
      @repl.start('look')
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gemwarrior-0.3.1 lib/gemwarrior/game.rb
gemwarrior-0.3.0 lib/gemwarrior/game.rb
gemwarrior-0.2.0 lib/gemwarrior/game.rb