**** Commodore16.com ****

Commodore 16/Plus 4 website to provide support and gaming

Dark Mansion (Complete)



Dark Mansion (Complete)

This is where my real experience of coding on the C16/+4 really started.  Although not using machine code, it used Rachy’s ‘Adventure Building System’.  Which wasnt like the original adventure creators as you have to learn a new sort of language.  As you look through my source code, you should get a better understanding.

Back to ‘Dark Mansion’, released in April 2007, 32k in size.  It was my first game, which was aimed at seeing if I was capable of writing something playable.

Download the game in PRG format.

Screenshot

alt

Csabo (from Plus4World) even created a map.
alt

Source code  ( I am going to take some time and explain how I put the game together )

/* DARK MANSION ADVENTURE FROM
CHRIS SNOWDEN APRIL 2007 */

STARTROOM 1

DICTIONARY

NOUNS
1 KEY
2 ZOMBIE
3 GUN
3 SHOTGUN
4 PAINTING
5 WITCH
6 LOCKPICK
7 CHEST
8 GOLD
9 JUG
10 OGRE
11 TREASURE
12 DOOR
13 SWAMP
255 IT
END/* NOUNS */

VERBS
1 N
1 NORTH
2 S
2 SOUTH
3 E
3 EAST
4 W
4 WEST
5 U
5 UP
6 D
6 DOWN
7 GET
7 T
7 TAKE
8 DROP
9 L
9 LOOK
10 INVENTORY
10 LIST
10 INV
11 EXIT
11 QUIT
14 SAVE
15 LOAD
15 RESTORE
16 EXAMINE
17 LIGHT
19 UNLOCK
19 OPEN
20 SCORE
22 HELP
23 SHOOT
24 USE
24 THROW
END /* VERBS */

ADVERBS END
END /* DICTIONARY */

PICTURES
1 “1”
END

DESCRIPTIONS

1 1 “OPEN CLEARING. YOU THINK WHAT THE HELL  AM I DOING HERE                         YOU CAN GO: SOUTH OR EAST”
2 1 “FOREST ENTRANCE.  THE TREES LOOK VERY   SPOOKY                                  YOU CAN GO: EAST OR WEST”
3 1 “DEEP DARK FOREST, THE WIND IS PICKING UPMAKING THE LARGE OAK TREES LOOK ALIVE   YOU CAN GO: EAST OR WEST”
4 1 “GRAND ENTRANCE, A PORCH TO THE SOUTH OF A MAGNIFICANT HOUSE WITH A LOCKED DOOR  YOU CAN GO: EAST OR WEST”
5 1 “GRAVEL DRIVE WAY. LOOKS LIKE A CAR WAS  HERE AS THERE IS A FRESH OIL PATCH ON   THE GROUND                              YOU CAN GO: WEST OR SOUTH”
6 1 “MURKY SWAMP, SOMETHING IS MOVING IN     THERE                                   YOU CAN GO: NORTH”
7 1 “BEDROOM WITH A SINGLE BED IN THE CORNER OF THE ROOM. YOU CAN SEE THE MOONLIGHT  SHINING THROUGH THE SMALL BARRED WINDOW YOU CAN GO: SOUTH”
8 1 “LARGE MASTER BEDROOM.  THERE IS A GRAND FOUR POSTER BED IN THE CENTRE OF THE    ROOM                                    YOU CAN GO: SOUTH”
9 1 “GRAND HALLWAY, WHO COULD LIVE IN A PLACELIKE THIS.  YOU HEAR A EVIL LAUGH IN THEDISTANCE                                YOU CAN GO: NORTH OR SOUTH”
10 1 “YOUR IN A DOUBLE GARAGE WITH NO CARS    PRESENT                                 YOU CAN GO: NORTH”
11 1 “HALLWAY AT THE TOP OF THE ELEGANT       STAIRCASE                               YOU CAN GO: SOUTH OR EAST”
12 1 “PASSAGE WAY WITH PAINTINGS ON THE WALLS YOU CAN GO: NORTH, EAST OR WEST”
13 1 “END OF THE PASSAGE WAY, WAIT… WHAT WASTHAT, YOU’RE SURE A PAINTING OF A OLD   WOMAN JUST WINKED AT YOU                YOU CAN GO: NORTH OR WEST”
14 1 “GRAND HALLWAY, THE LIGHT IS BEGINNING TOFADE AS YOU MOVE FORWARDS.  THE FRONT   DOOR SLAMS SHUT BEHIND YOU              YOU CAN GO: NORTH OR SOUTH”
15 1 “A WELL STOCKED PANTRY, YOU SEEMS SOME   TASTY LOOKING OLIVES AND THINK MMMM     MIGHT EAT THEM LATER                    YOU CAN GO: SOUTH”
16 1 “LANDING AT THE TOP OF THE STAIRCASE     YOU CAN GO: NORTH OR DOWN”
17 1 “OPENING OF A LARGE ELEGANT STAIRCASE,   YOU SEE SOME STEPS GOING DOWN TO A DARK CELLAR                                  YOU CAN GO: UP, DOWN OR EAST”
18 1 “DINING ROOM.  PLATES ARE SET OUT AS IT  IS DINNER TIME, WONDER WHATS TO EAT…  YOU CAN GO: EAST, WEST OR SOUTH”
19 1 “PASSAGE WAY                             YOU CAN GO: NORTH, SOUTH, EAST OR WEST”
20 1 “A WELL FITTED OUT KITCHEN, APART FROM   THE ROTTING FRUIT IN A BOWL             YOU CAN GO: WEST, SOUTH OR NORTH”
21 1 “VAST UNDERGROUND HALL WITH BONES LAYING AROUND ON THE FLOOR                     YOU CAN GO: EAST OR SOUTH”
22 1 “DIMLY LIT CELLAR. THERE IS A MUSTY SMELL                                        YOU CAN GO: UP OR WEST”
23 1 “BACK OF THE DINING ROOM WITH A DRINKS   CABINET ON THE BACK WALL.  THERE IS A   WINDOW TO THE SOUTH, SOMETHING RUSHES   PAST IT.                                YOU CAN GO: NORTH”
24 1 “STUDY WITH A LARGE OAK DESK IN THE CORNER.  BOOKCASES SURROUND THE ROOM.        YOU CAN GO: NORTH”
25 1 “PATIO AREA WITH GARDEN FURNITURE LAYING AROUND                                  YOU CAN GO: NORTH OR SOUTH”
26 1 “A BRIGHT GOLDEN ROOM WITH A IMPRESSIVE  STAINED GLASS WINDOW.  YOU CANT WORK OUTWHERE THE LIGHT IS COMING FROM          YOU CAN GO: NORTH”
27 1 “POOL HOUSE, YOU WISH YOUR HOUSE WAS AS  GRAND AS THIS                           YOU CAN GO: EAST”
28 1 “SWIMMING POOL, BUT NO WATER IN IT.      YOU CAN GO: EAST OR WEST”
29 1 “A VAST LAWNED AREA                      YOU CAN GO: EAST OR WEST”
30 1 “FLOWERED GARDEN,  YOU CAN SMELL THE     ROSES FROM WHERE YOUR STOOD             YOU CAN GO: NORTH OR WEST”
31 1 “SPARE ROOM FOR CODER”
END /* DESCRIPTIONS */

MESSAGES
1 “IT IS A LARGE BRONZE KEY, LOOKS LIKE A  FRONT DOOR KEY”
2 “IT IS A FULLY LOADED TWO BARREL SHOTGUN”
3 “IT IS A WONDERFUL PAINTING, THINK IT    MIGHT BE WORTH A PRETTY PENNY”
4 “IT IS A SMALL GOLD KEY THAT LOOKS USEFUL”
5 “IT IS A BAG OF GOLD COINS”
6 “IT IS A VERY FULL JUG OF WATER”
7 “THE ZOMBIE CORNERS YOU AND STARTS TO EATYOU ALIVE.  YOU DIE”
8 “THE WITCH PULLS OUT A SMALL VOODOO DOLL AND STABS IT IN THE HEART.  YOU REALISE THE DOLL IS YOU AND THEN IS ALL OVER.   YOU DIE”
9 “CONGRATULATIONS, YOU HAVE MANAGED TO    STEAL ALL THE GOLD FROM THE DARK MANSON.NOW YOU WILL RETIRE TO A TROPICAL ISLANDAND ENJOY THE HULA HULA GIRLS”
10 “THE DOOR UNLOCKS AND SWINGS OPEN.”
11 “WITH A LITTLE EFFORT THE CHEST OPENS    WIDE, DISPLAYING ALL ITS GLORY”
12 “YOU BLAST OFF A SHOT FROM YOUR SHOTGUN  AND BLOW THE ZOMBIES HEAD CLEAN OFF”
13 “AS YOU THROW THE JUG OF WATER OVER THE  WITCH, SHE SCREAMS I’M MELTING.  THE    WITCH MELTS INTO A PUDDLE ON THE FLOOR. SHE IS DEAD”
14 “YOU DECIDE THERE IS ONLY ENOUGH ROOM IN THIS HOUSE FOR YOURSELF, YOU LOAD THE   SHOTGUN WITH SHELLS AND BLAST THE OGRE  INTO THE NEXT WORLD”
15 “THE OGRE SLOWLY WALKS UPTO YOU, YOU     THINK IT WANTS TO COMMUNICATE WITH YOU. OH YOUR SO WRONG IT SWINGS ITS CLUB IN  THE DIRECTION OF YOUR HEAD.  OOOH THATS MESSY, YOUR DEAD”
16 “YOU TURN THE KEY WITHIN THE LOCK OF THE CHEST, OPENING SLOWLY YOU SEE A         SPARKLING TREASURE INFRONT OF YOU.  NOW YOU MUST GET OUT WITH YOUR LIFE”
17 “YOU CANT MAKE OUT WHATS LURKING WITHIN  THE SWAMP, BETTER TO LEAVE IT ALONE”
19 “WHAT IS THAT?”
20 “THE ZOMBIE BLOCKS YOUR WAY”
239 “YOU ARE CARRYING:”
240 “WHAT NOW?…”
241 “YOU CAN’T.”
242 “PARDON?”
243 “PRESS A KEY FOR ANOTHER GAME.”
244 “ARE YOU SURE (Y OR N)?”
245 “YOU’VE ALREADY GOT THAT.”
246 “YOU HAVEN’T GOT THAT.”
247 “YOU CAN’T SEE THAT.”
252 “I CAN’T FIND THAT ANYWHERE.”
253 “YOU CAN ALSO SEE:”
254 “OKAY.”
304 “ALL RIGHT NOW.”
819 ”    
WELCOME TO DARK MANSION ADVENTURE.        BY CHRIS SNOWDEN APRIL 2007             ………………………………….”
END /* MESSAGES */

OBJECTS /* NUM. STARTR. WEIGHT DESC. */
1 10 10  “A BRONZE KEY”
3 15 15  “A SHOTGUN”
4 23 23  “A BEAUTIFUL PAINTING”
6 8 8  “A OLD LOCKPICK”
9 8 7  “A LARGE JUG OF COLD WATER”
2 100 24 “A VILE ZOMBIE”
10 100 22 “A VAST OGRE WHO LOOKS AT YOU IN A GRUMPY WAY”
5 100 28 “A CACKLING WITCH”
7 100 26 “A ORNATE CHEST”
11 10 31 “A GREAT TREASURE”
8 10 27 “SOME GOLD”

END /* OBJECTS */

CONNECTIONS
/*ROOMNUM VERBNUM DESTROOM VERBNUM…*/
1 3 2 END/* IN ROOM 1 – EAST->2 */
1 2 6 END/* IN ROOM 1 – SOUTH->6 */
2 4 1 END/* IN ROOM 2 – WEST->1 */
2 3 3 END/* IN ROOM 2 – EAST->3 */
3 4 2 END/* IN ROOM 3 – WEST->3 */
3 3 4 END/* IN ROOM 3 – EAST->4 */
4 4 3 END/* IN ROOM 4 – WEST->3 */
4 3 5 END/* IN ROOM 4 – EAST->5 */
4 2 9 END/* IN ROOM 4 – SOUTH->9 */
5 4 4 END/* IN ROOM 5 – WEST->4 */
5 2 10 END/* IN ROOM 5 – SOUTH->10 */
6 1 1 END/* IN ROOM 6 – NORTH->1 */
7 2 12 END/* IN ROOM 7 – SOUTH->12 */
8 2 13 END/* IN ROOM 8 – SOUTH->13 */
9 1 4 END/* IN ROOM 9 – NORTH->5 */
9 2 14 END/* IN ROOM 9 – SOUTH->14 */
10 1 5 END/* IN ROOM 10 – NORTH->5 */
11 3 12 END/* IN ROOM 11 – EAST->12 */
11 2 16 END/* IN ROOM 11 – SOUTH->16 */
12 4 11 END/* IN ROOM 12 – WEST->11 */
12 3 13 END/* IN ROOM 12 – EAST->13 */
12 1 7 END/* IN ROOM 12 – NORTH->7 */
13 4 12 END/* IN ROOM 13 – WEST->12 */
13 1 8 END/* IN ROOM 13 – NORTH->8 */
14 1 9 END/* IN ROOM 14 – NORTH->9 */
14 2 19 END/* IN ROOM 14 – SOUTH->19 */
15 2 20 END/* IN ROOM 15 – SOUTH->20 */
16 1 11 END/* IN ROOM 16 – NORTH->11 */
16 6 17 END/* IN ROOM 16 – DOWN->17 */
17 5 16 END/* IN ROOM 17 – UP->16 */
17 6 22 END/* IN ROOM 17 – DOWN->22 */
17 3 18 END/* IN ROOM 17 – EAST->18 */
18 6 22 END/* IN ROOM 18 – DOWN->22 */
18 3 18 END/* IN ROOM 18 – EAST->18 */
19 1 14 END/* IN ROOM 19 – NORTH->14 */
19 2 24 END/* IN ROOM 19 – SOUTH->24 */
19 3 20 END/* IN ROOM 19 – EAST->20 */
19 4 18 END/* IN ROOM 19 – WEST->18 */
20 1 15 END/* IN ROOM 20 – NORTH->15 */
20 2 25 END/* IN ROOM 20 – SOUTH->25 */
20 4 19 END/* IN ROOM 20 – WEST->19 */
21 2 26 END/* IN ROOM 21 – SOUTH->26 */
21 3 22 END/* IN ROOM 21 – EAST->22 */
22 5 17 END/* IN ROOM 22 – UP->17 */
22 4 21 END/* IN ROOM 22 – WEST->21 */
23 1 18 END/* IN ROOM 23 – NORTH->18 */
24 1 19 END/* IN ROOM 24 – NORTH->19 */
25 1 20 END/* IN ROOM 25 – NORTH->20 */
25 2 30 END/* IN ROOM 25 – SOUTH->30 */
26 1 21 END/* IN ROOM 26 – NORTH->21 */
27 3 28 END/* IN ROOM 27 – EAST->28 */
28 4 27 END/* IN ROOM 28 – WEST->27 */
28 3 29 END/* IN ROOM 28 – EAST->29 */
29 4 28 END/* IN ROOM 29 – WEST->28 */
29 3 30 END/* IN ROOM 29 – EAST->30 */
30 1 25 END/* IN ROOM 30 – NORTH->25 */
30 4 29 END/* IN ROOM 30 – WEST->29 */
END /* CONNECTIONS */

LOCCOND /* ROOMNUM CONDITIONS */

1 /* ROOM */
IF VERB 3 THEN GOTO 2 WAIT END
IF VERB 2 THEN GOTO 6 WAIT END
END/* ROOM 1 */
2 /* ROOM */
IF VERB 4 THEN GOTO 1 WAIT END
IF VERB 3 THEN GOTO 3 WAIT END
END/* ROOM 2 */
3 /* ROOM */
IF VERB 3 THEN GOTO 4 WAIT END
IF VERB 4 THEN GOTO 2 WAIT END
END/* ROOM 3 */
4 /* ROOM */
IF ( VERB 19 ) AND ( NOUN 12 ) AND
( CARR 1 ) THEN
MESS 10 HOLD 200 GOTO 9 WAIT END
IF VERB 4 THEN GOTO 3 WAIT END
IF VERB 3 THEN GOTO 5 WAIT END
END/* ROOM 4 */
5 /* ROOM */
IF VERB 4 THEN GOTO 4 WAIT END
IF VERB 2 THEN GOTO 10 WAIT END
END/* ROOM 5 */
6 /* ROOM */
IF ( VERB 16 ) AND ( NOUN 13 ) THEN
MESS 17 HOLD 200 WAIT END
IF VERB 1 THEN GOTO 1 WAIT END
END/* ROOM 6 */
7 /* ROOM */
IF ( VERB 7 ) AND ( NOUN 9 ) THEN
( GET 9 ) WAIT END
IF VERB 2 THEN GOTO 12 WAIT END
END/* ROOM 7 */
8 /* ROOM */
IF ( VERB 7 ) AND ( NOUN 6 ) THEN
( GET 6 ) WAIT END
IF VERB 2 THEN GOTO 13 WAIT END
END/* ROOM 8 */
9 /* ROOM */
IF ( VERB 19 ) AND ( NOUN 12 ) AND
( CARR 11 ) THEN
MESS 10 HOLD 200 GOTO 5 WAIT END
IF VERB 2 THEN GOTO 14 WAIT END
IF VERB 1 THEN GOTO 4 WAIT END
END/* ROOM 9 */
10 /* ROOM */
IF VERB 1 THEN GOTO 5 WAIT END
END/* ROOM 10 */
11 /* ROOM */
IF VERB 3 THEN GOTO 12 WAIT END
IF VERB 2 THEN GOTO 16 WAIT END
END/* ROOM 11 */
12 /* ROOM */
IF VERB 1 THEN GOTO 7 WAIT END
IF VERB 3 THEN GOTO 13 WAIT END
IF VERB 4 THEN GOTO 11 WAIT END
END/* ROOM 12 */
13 /* ROOM */
IF VERB 1 THEN GOTO 8 WAIT END
IF VERB 4 THEN GOTO 12 WAIT END
END/* ROOM 13 */
14 /* ROOM */
IF VERB 1 THEN GOTO 9 WAIT END
IF VERB 2 THEN GOTO 19 WAIT END
END/* ROOM 14 */
15 /* ROOM */
IF VERB 2 THEN GOTO 20 WAIT END
END/* ROOM 15 */
16 /* ROOM */
IF VERB 1 THEN GOTO 11 WAIT END
IF VERB 6 THEN GOTO 17 WAIT END
END/* ROOM 16 */
17 /* ROOM */
IF VERB 5 THEN GOTO 16 WAIT END
IF VERB 6 THEN GOTO 22 WAIT END
IF VERB 3 THEN GOTO 18 WAIT END
END/* ROOM 17 */
18 /* ROOM */
IF VERB 3 THEN GOTO 19 WAIT END
IF VERB 4 THEN GOTO 17 WAIT END
IF VERB 2 THEN GOTO 23 WAIT END
END/* ROOM 18 */
19 /* ROOM */
IF VERB 1 THEN GOTO 14 WAIT END
IF VERB 2 THEN GOTO 24 WAIT END
IF VERB 3 THEN GOTO 20 WAIT END
IF VERB 4 THEN GOTO 18 WAIT END
END/* ROOM 19 */
20 /* ROOM */
IF VERB 1 THEN GOTO 15 WAIT END
IF VERB 2 THEN GOTO 25 WAIT END
IF VERB 4 THEN GOTO 19 WAIT END
END/* ROOM 20 */
21 /* ROOM */
IF VERB 2 THEN GOTO 26 WAIT END
IF VERB 3 THEN GOTO 22 WAIT END
END/* ROOM 21 */
22 /* ROOM */
IF ( VERB 23 ) AND ( NOUN 10 ) AND
( CARR 3 ) THEN SET 1
MESS 14 HOLD 200 10 TO 0 WAIT END
IF VERB 5 THEN GOTO 17 WAIT END
IF VERB 4 THEN GOTO 21 WAIT END
END/* ROOM 22 */
23 /* ROOM */
IF ( VERB 16 ) AND ( NOUN 4 ) THEN
( MESS 3 ) WAIT END
IF VERB 1 THEN GOTO 18 WAIT END
END/* ROOM 23 */
24 /* ROOM */
IF ( VERB 1 ) AND ( HERE 2 ) THEN
( MESS 20 ) HOLD 200 GOTO 24 WAIT END
IF ( VERB 23 ) AND ( NOUN 2 ) AND
( CARR 3 ) THEN SET 1
MESS 12 HOLD 200 2 TO 0 WAIT END
END/* ROOM 24 */
25 /* ROOM */
IF VERB 1 THEN GOTO 20 WAIT END
IF VERB 2 THEN GOTO 30 WAIT END
END/* ROOM 25 */
26 /* ROOM */
IF ( VERB 24 ) AND ( NOUN 6 ) AND
( CARR 6 ) THEN
MESS 16 HOLD 200 11 TO 26 WAIT END
IF ( VERB 7 ) AND ( NOUN 11 ) THEN
( GET 11 ) WAIT END
IF VERB 1 THEN GOTO 21 WAIT END
END/* ROOM 26 */
27 /* ROOM */
IF ( VERB 7 ) AND ( NOUN 8 ) THEN
( GET 8 ) WAIT END
IF VERB 3 THEN GOTO 28 WAIT END
END/* ROOM 27 */
28 /* ROOM */
IF ( VERB 24 ) AND ( NOUN 9 ) AND
( CARR 9 ) THEN SET 1
MESS 13 HOLD 200 5 TO 0 WAIT END
IF VERB 3 THEN GOTO 29 WAIT END
IF VERB 4 THEN GOTO 27 WAIT END
END/* ROOM 28 */
29 /* ROOM */
IF VERB 3 THEN GOTO 30 WAIT END
IF VERB 4 THEN GOTO 28 WAIT END
END/* ROOM 29 */
30 /* ROOM */
IF VERB 1 THEN GOTO 25 WAIT END
IF VERB 4 THEN GOTO 29 WAIT END
END/* ROOM 30 */
END /* LOCCOND */

LOWCOND

IF ( NO1 = 0 ) AND ( VERB 7 ) THEN
MESS 19 WAIT END
IF ( NO1 = 0 ) AND ( VERB 8 ) THEN
MESS 19 WAIT END
IF ( NO1 = 0 ) AND ( VERB 16 ) THEN
MESS 19 WAIT END
IF ( VERB 8 ) AND ( NOUN 1 ) AND
( CARR 5 ) THEN DROP 5 RESE 2 OKAY END
IF ( NO1 < 5 ) AND ( VERB 7 ) THEN
GET NO1 OKAY END
IF ( NO1 < 5 ) AND ( VERB 8 ) THEN
DROP NO1 OKAY END
IF ( NO1 < 5 ) AND ( VERB 16 ) AND
( AVAI NO1 ) THEN MESS NO1 END
IF VERB 11 THEN QUIT END
IF ( VERB 9 ) THEN LOOK WAIT END
IF VERB 10 THEN MESS 239 LIST WITH END
IF VERB 14 THEN SAVE OKAY END
IF VERB 15 THEN LOAD OKAY END
IF VERB 22 THEN MESS ( ROOM + 300 ) END

END /* LOWCOND */

ATSTART

STRE 200 2 CSET 1 MESS 819

END /* ATSTART */

HIGHCOND
IF ( AT 4 ) AND ( CARR 11 ) THEN
MESS 9 HOLD 200 EXIT END
IF ( AT 24 ) AND NOT ( CARR 3 ) THEN
MESS 7 HOLD 200 EXIT END
IF ( AT 28 ) AND NOT ( CARR 9 ) THEN
MESS 8 HOLD 200 EXIT END
IF ( AT 22 ) AND NOT ( CARR 3 ) THEN
MESS 15 HOLD 200 EXIT END
END /* HIGHCOND */
/* PROGRAM MANSION */ END


Categorized as: General Projects



Leave a Reply