Skip to content

Commit

Permalink
adding golem information to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanb committed Jun 7, 2010
1 parent cf71a69 commit 2dd76f6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,26 @@ Whenever you sense an area, often one or multiple spaces (in an array) will be r

space.ticking?
Returns true if this space contains a bomb which will explode in time.

space.golem?
Returns true if a golem is occupying this space.

You will often call these methods directly after a sense. For example, the "feel" sense returns one space. You can call "captive?" on this to determine if a captive is in front of you.

warrior.feel.captive?


== Golem

Along your journey you may discover the ability to create a golem. This is a separate unit which you also control. The turn handling is done through a block. Here is an example.

warrior.form! do |golem|
golem.attack! if golem.feel.enemy?
end

Complex logic can be placed in this block just like in the player turn method. You may want to move the logic into its own class or create multiple classes for different types of golems. You can create multiple golems in a level, but each one will take half of the warrior's health.


== Epic Mode

Once you reach the top of the tower, you will enter epic mode. When running rubywarrior again it will run your current player.rb through all levels in the tower without stopping.
Expand Down

0 comments on commit 2dd76f6

Please sign in to comment.