News on Twitter

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.

2 comments to Code regarding Vehicles (cars, etc.)

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>