Skip to content

Commit

Permalink
foo
Browse files Browse the repository at this point in the history
  • Loading branch information
David O'Toole committed Dec 11, 2009
1 parent 006074d commit 2340ad2
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 3 deletions.
Binary file added forest/flowers-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added forest/flowers-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified forest/forest.fasl
Binary file not shown.
83 changes: 81 additions & 2 deletions forest/forest.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ It has begun to snow."
:water-grain 0.2
:water-density 90
:water-cutoff 0.2))
(3 (list '=passage=))))
(3 (list '=passage=))
(4 (list '=monastery=))))

;;; Text overlay balloons

Expand Down Expand Up @@ -318,7 +319,6 @@ It has begun to snow."
(defcell mountain
(tile :initform "mountain")
(categories :initform '(:obstacle :opaque)))


;;; The stone wall

Expand Down Expand Up @@ -928,8 +928,87 @@ It has begun to snow."

;;; Monastery approach world

(defcell hill-1
(tile :initform "hill-1"))

(defcell hill-2
(tile :initform "hill-2"))

(defcell hill-3
(tile :initform "hill-3"))

(defcell flowers-1
(tile :initform "flowers-1"))

(defcell flowers-2
(tile :initform "flowers-2"))

(define-prototype monastery-gateway (:parent =gateway=)
(tile :initform "monastery-gateway")
(sequence-number :initform (genseq))
(address :initform (generate-level-address 2)))

(define-method step monastery-gateway (stepper)
[say self "The mountain pass opens to the foothills by the Monastery here.
Press ENTER to continue on."])

(define-prototype monastery (:parent xe2:=world=)
(height :initform *forest-height*)
(width :initform *forest-width*)
(ambient-light :initform :total)
(description :initform
"Morning has broken, and Valisade Monastery has come into view to the
south. You can hear the monks singing in the distance.")
(edge-condition :initform :block))

(define-method drop-hill monastery (&key (graininess 0.3)
(density 60)
distance
(cutoff 0.3))
(clon:with-field-values (height width) self
(let ((plasma (xe2:render-plasma height width :graininess graininess))
(plasma2 (xe2:render-plasma height width :graininess graininess))
(value nil))
(dotimes (i height)
(dotimes (j width)
[drop-cell self (clone =hill-3=) i j]))
(dotimes (i height)
(dotimes (j width)
(setf value (aref plasma i j))
(when (or (null distance)
(< (distance j i row column) distance))
(percent-of-time density
[drop-cell self (if (< cutoff value)
(clone =hill-1=)
(clone =hill-2=))
i j :no-collisions t]))))
(dotimes (i height)
(dotimes (j width)
(setf value (aref plasma i j))
(when (or (null distance)
(< (distance (+ j r0) (+ c0 i) row column) distance))
(percent-of-time density
[drop-cell self (if (< cutoff value)
(clone =flowers-1=)
(clone =flowers-2=))
i j :no-collisions t])))))))

(define-method generate monastery (&key (height *forest-height*)
(width *forest-width*)
sequence-number)
(setf <height> height)
(setf <width> width)
(setf <sequence-number> sequence-number)
[create-default-grid self]
[drop-hill self]
(let ((row (1+ (random 10)) )
(column (+ 15 (random 6))))
[drop-cell self (clone =drop-point=) row column
:exclusive t :probe t]))

(define-method begin-ambient-loop monastery ()
(play-music "rain" :loop t)
(play-sample "monks"))

;;; Controlling the game

Expand Down
1 change: 1 addition & 0 deletions forest/forest.org
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
** TODO overworld map? (FUTURE)
** TODO in-game map!
** TODO don't place bodies in walls
** TODO fix arrows not dying
** TODO record music/chant vox samples for monastery approach
Expand Down
9 changes: 8 additions & 1 deletion forest/forest.pak
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
(:name "unh-3" :type :sample :file "unh-3.wav" :properties (:volume 20))

(:name "snowflake" :type :image :file "snowflake.png")
(:name "monastery" :type :image :file "monastery.png")
(:name "monastery-gateway" :type :image :file "monastery-gateway.png")

(:name "water-1" :type :image :file "water-1.png")
(:name "water-2" :type :image :file "water-2.png")
Expand Down Expand Up @@ -69,7 +71,7 @@
(:name "character-pink" :type :image :file "character-pink.png")
(:name "ball" :type :image :file "ball.png")
(:name "wall" :type :image :file "wall.png")
(:name "monks" :type :sample :file "monks.wav" :properties (:volume 20))
(:name "monks" :type :sample :file "monks.wav" :properties (:volume 25))
(:name "talk" :type :sample :file "talk.wav" :properties (:volume 10))
(:name "lutey" :type :sample :file "lutey.wav" :properties (:volume 31))
(:name "groar" :type :sample :file "groar.wav" :properties (:volume 25))
Expand All @@ -79,6 +81,11 @@
(:name "mountain" :type :image :file "mountain.png")
(:name "firefly-1" :type :image :file "firefly-1.png")
(:name "firefly-2" :type :image :file "firefly-2.png")
(:name "hill-1" :type :image :file "hill-1.png")
(:name "hill-2" :type :image :file "hill-2.png")
(:name "hill-3" :type :image :file "hill-3.png")
(:name "flowers-1" :type :image :file "flowers-1.png")
(:name "flowers-2" :type :image :file "flowers-2.png")
(:name "nightbird" :type :music :file "nightbird.ogg" :properties (:volume 20))
(:name "passageway" :type :music :file "passageway.ogg" :properties (:volume 20))
(:name "rain" :type :music :file "rain.ogg" :properties (:volume 20))
Expand Down
Binary file added forest/hill-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added forest/hill-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added forest/monastery-gateway.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added forest/river.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2340ad2

Please sign in to comment.