Newsgroups: rec.arts.int-fiction
Path: nntp.gmd.de!newsserver.jvnc.net!newsserver2.jvnc.net!howland.reston.ans.net!newsfeed.internetmci.com!in2.uu.net!newsflash.concordia.ca!news.nstn.ca!news.cs.indiana.edu!shulick@guava.ucs.indiana.edu
From: "Sam Hulick" <shulick@guava.ucs.indiana.edu>
Subject: Inform: Example game using physics.h
Message-ID: <199512240645.BAA02833@guava.ucs.indiana.edu>
Organization: Vallen Software
Date: Sun, 24 Dec 1995 01:45:01 -0500 (EST)
Lines: 83


here is an example game (very short and non-pretty) using my physics.h
file I posted earlier.

---cut here---
Switches xv5;

Constant Story "TEST";
Constant Headline "^A Test!^by Sam Hulick^";

REPLACE RTakeSub;
REPLACE InsertSub;
REPLACE PutOnSub;

Include "parser";
Include "verblib";
Include "physics";

Object newselfobj "yourself"
  with description "As good-looking as ever.", number 0,
       before $ffff, after $ffff, life $ffff, each_turn $ffff,
       time_out $ffff, describe $ffff, capacity 100,
       parse_name 0, short_name 0, orders 0, max_space 100
  has  concealed animate proper transparent;

Object room0 "Room Zero"
 has   light;

Nearby lst "lambskin table"
 with  short_name [;
          if (self has general) print "broken lambskin table";
          else print "lambskin table";
          rtrue;
       ],
       parse_name [ i j;
          if (self hasnt general) j = 'table';
          else j = 'broken';
          while (NextWord() == 'lambskin' or 'table' or j) i++;
          return i;
       ],
       description [;
          if (self hasnt general)
             "A lambskin table?  It's very frail and thin!  Be \
              careful what you place on it!";
          else "Well, you broke it, you klutz.";
       ],
       max_weight 8,
       max_space 10,
       too_big [; "The table isn't big enough to hold that much."; ],
       too_heavy [;
          give self general ~supporter;
          while (child(self) ~= 0) move child(self) to parent(self);
          move noun to parent(self);
          ! 'noun' refers to the object we tried to place on the table.
          ! if we don't move it, it stays in the player's hands.
          "The table breaks!  Everything that was on it falls to the floor.";
       ],
 has   supporter static;

Nearby feather "feather"
 with  name "feather",
       size 1, weight 1;

Nearby rock "rock"
 with  name "rock",
       size 4, weight 15;

[ Initialise;
   ChangePlayer(newselfobj);
   location = room0;
   player.max_weight = 30;
   player.max_space = 20;
   "^^^^^A test..^^";
];

Include "grammar";
end;

-- 
============================| "This lies very badly for the violin." --?
Sam Hulick                  | "Do you think, when the spirit moves me, I
shulick@indiana.edu         | think of your damn violin?"
http://129.79.1.4/~shulick/ |    --Ludwig van Beethoven (1770-1827)
