A Very Simple Game
|
We'll start with about the simplest game possible: two rooms, and no objects. (We could conceivably start with only one room, to make things even simpler, but then there would be nothing to do while playing the game; with two rooms, we at least can move between them.)
|
|
-DMESSAGESTYLE=neu
-Fy obj -Fo obj
-o goldskull.t3
-lib system
-lib adv3/adv3
-source goldskull
|
|
"This is the starting room. "
;
|
|
#include <adv3.h>
#include <en_us.h>
If not, you will need to add them. You will also need to ensure that your source file contains:
|
/* the initial player character is 'me' */
initialPlayerChar = me
;
/* You could customize this if you wished */
versionInfo: GameID
/* The IFID can be any random set of hexadecimal digits in this format */
IFID = '5b252939-8c87-0a51-dd3f-eafb1c07da05'
name = 'Gold Skull'
byline = 'by A TADS 3 Tyro'
htmlByline = 'by <a href="mailto:$EMAIL$">
$AUTHOR$</a>'
version = '1'
authorEmail = '$AUTHOR$ <$EMAIL$>'
desc = '$DESC$'
htmlDesc = '$HTMLDESC$'
;
Then you can start adding the new code (or adapting the definition of startroom that starta3.t already provides):
startroom: Room /* we could call this anything we liked */
roomName = 'Outside cave' /* the "name" of the room */
desc = "You're standing in the bright sunlight just
outside of a large, dark, foreboding cave, which
lies to the north. "
north = cave /* the room called "cave" lies to the north */
;
+ me: Actor /* This may already be there if you started from start3at */
;
cave: Room
roomName = 'Cave'
desc = "You're inside a dark and musty cave. Sunlight
pours in from a passage to the south. "
south = startroom
;
|
|
t3make -d -f goldskull
|
|
t3run mygame
|
|
|
|
|
|
|
|
|
|
|
Getting Started in TADS 3
[Main]
[Previous] [Next]