Skip to content

Commit 2dd76f6

Browse files
committed
adding golem information to readme
1 parent cf71a69 commit 2dd76f6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.rdoc

+14
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,26 @@ Whenever you sense an area, often one or multiple spaces (in an array) will be r
136136

137137
space.ticking?
138138
Returns true if this space contains a bomb which will explode in time.
139+
140+
space.golem?
141+
Returns true if a golem is occupying this space.
139142

140143
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.
141144

142145
warrior.feel.captive?
143146

144147

148+
== Golem
149+
150+
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.
151+
152+
warrior.form! do |golem|
153+
golem.attack! if golem.feel.enemy?
154+
end
155+
156+
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.
157+
158+
145159
== Epic Mode
146160

147161
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.

0 commit comments

Comments
 (0)