Code regarding Vehicles (cars, etc.)

Had a couple requests to implement cars in IF. This uses an object called a “vehicle.”

Look at this code:

The Parking Lot is a room. “Main Street is to the north.”

The Maserati GranTurismo is a vehicle in the parking lot. The description is “Nice. This baby will hit 60 mph in 5.2 seconds and is capable of a maximum speed of 178 mile per hour.” Understand “car” as Maserati GranTurismo.

Main Street is north of the parking lot.

To get into the vehicle, the player types “get in maserati”. Note something new at the end of the description of the Maserati object: a sentence that allows the player to also use the word car instead of having to type maserati.

To drive vehicles, the player types in directions as they normally would.

One Comment

  1. Gabe
    Posted October 19, 2008 at 8:45 pm | Permalink

    Thank you very much! I didn’t understand what to type on the Inform,

One Trackback

  1. [...] ridden and am anxious as to how this can be achieved. At first I was going to slightly modify the vehicle example John Timmons posted on the New Media Log but now I am also going to try to find an example of code [...]

Post a Comment

Your email is never shared. Required fields are marked *

*
*