Skip to content
This repository has been archived by the owner on Dec 7, 2017. It is now read-only.

Commit

Permalink
create new tower and the first stage
Browse files Browse the repository at this point in the history
  • Loading branch information
siuying committed Sep 14, 2011
1 parent 54de3cb commit 2ec7381
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/js_warrior/abilities/direction_of_stairs.coffee
@@ -0,0 +1,12 @@
{Sense} = require('./sense')
{_} = require('underscore')

class DirectionOfStairs extends Sense
description: ->
"Returns the direction ('left', 'right', 'forward', 'backward') the stairs are from your location."

perform: ->
@unit.position.relativeDirectionOfStairs()

root = exports ? window
root.DirectionOfStairs = DirectionOfStairs
19 changes: 19 additions & 0 deletions towers/intermediate/level_001.coffee
@@ -0,0 +1,19 @@
# ------
# | |
# |@ |
# | |
# | > |
# ------

exports.level = ->

@description "Silence. The room feels large, but empty. Luckily you have a map of this tower to help find the stairs."
@tip "Use warrior.direction_of_stairs() to determine which direction stairs are located. Pass this to warrior.walk() to walk in that direction."

@time_bonus 20
@ace_score 19
@size 6, 4
@stairs 2, 3

@warrior 0, 1, 'east', ->
@add_abilities 'walk', 'feel', 'direction_of_stairs'

0 comments on commit 2ec7381

Please sign in to comment.