diff --git a/forest/README b/forest/README index 86aa463..b154825 100644 --- a/forest/README +++ b/forest/README @@ -1,5 +1,11 @@ Welcome to Sanctuary, a Novella Rogue-like in Common Lisp. +This is the help screen. Press F2 to if you wish to return to playing +the game. Press N and P (for "next" and "previous", respectively) to +scroll through the document. + +STORY + You are an archer and initiate monk of the Sanctuary Order. Humanity and the four continents of the Known World have fallen into a dark age, where undead horrors from the deeps of the earth have scoured the @@ -18,9 +24,25 @@ wilderness toward your destination, Valisade Monastery. You've been summoned to Valisade for unknown reasons, and commanded to make haste through the mountains instead of the safer route to the southwest. +GAMEPLAY + +Your monk and his surroundings are viewed from a top-down perspective, +with North at the top of the screen. You can move in any of the eight +directions (north, northeast, east, southeast, south, southwest, west, +and northwest) by pressing the corresponding key in one of the two +options below: + + Q W E 7 8 9 North + \ | / \ | / | + A -+- D or 4 -+- 6 with West -+- East + / | \ / | \ | + Z X C 1 2 3 South + +There are four inventory slots, activated by pressing 1, 2, 3, or 4. +One may equip items such as a bow and arrows, or consume healing herbs +and such, by pressing the corresponding digit for the item's inventory +slot. Firing the bow is permitted only straight up, down, left, or +right, and the arrows take time to travel. Firing the bow is +accomplished with SHIFT-direction. - - - - diff --git a/forest/base.lisp b/forest/base.lisp new file mode 100644 index 0000000..ac93747 --- /dev/null +++ b/forest/base.lisp @@ -0,0 +1,119 @@ +(in-package :forest) + +;;; Status widget + +(defvar *status* nil) + +;;; Turn on timing after SDL init + +(add-hook 'xe2:*initialization-hook* + #'(lambda () + (xe2:enable-timer) + (xe2:set-frame-rate 15) + (xe2:set-timer-interval 0) + (xe2:enable-held-keys 1 3))) + +;;; The World addresses of the levels in the game. + +(defun generate-level-address (n) + (ecase n + (1 (list '=forest= + :description +"You are outside of Nothbess town, heading south toward the +Monastery. It is cold and rainy." + :level n + :sequence-number (xe2:genseq) + :height *forest-height* + :width *forest-width* + :fireflies 200 + :graveyards 2 + :ruins 3 + :raining t + :tree-grain 0.5 + :tree-density 30 + :water-grain 0.2 + :water-density 0 + :water-cutoff 0.2)) + (2 (list '=forest= + :level n + :description +"The river has swelled beyond its banks with meltwaters, and flooded +an old hamlet whose name is forgotten. +It has begun to snow." + :sequence-number (xe2:genseq) + :height *forest-height* + :width *forest-width* + :fireflies 100 + :graveyards 4 + :ruins 10 + :snowing t + :tree-grain 0.2 + :tree-density 30 + :water-grain 0.2 + :water-density 90 + :water-cutoff 0.2)) + (3 (list '=passage=)) + (4 (list '=monastery=)))) + +;;; Text overlay balloons + +(defcell balloon + (categories :initform '(:drawn :actor :balloon)) + text timeout following + (stroke-color :initform ".white") + (background-color :initform ".gray40")) + +(define-method initialize balloon (&key text (stroke-color ".white") (background-color ".blue") + (style :balloon) (timeout nil) following) + (setf text) + (setf stroke-color) + (setf following) + (setf background-color) + (setf