Main      Site Guide    
Smash Tutorial

Smash is a language designed for writing adventure games (interactive fiction), although it can be used to write other types of single-player, turn-based games as well. It is platform-independent and interface-independent; the same Smash code that runs on a web-based Smash engine for UNIX will also run on a GUI-based client for Windows, etc.

Learning Smash

  • About Smash -- This page tells you what Smash is and what it's all about.
  • Overview of Smash -- This page discusses the concepts and ideas behind Smash.
  • Required Files -- Each Smash game is required to have a few standard files in addition to the location code. Here's what they are and what they should contain.
  • Expression Syntax -- This page lists the expression syntax of Smash, including operators, operator precedence, etc.
  • Command Documentation -- This page lists all Smash commands and specifies how they are used. Examples are included.
  • Program Flow -- This page illustrates what code is executed when. This is essential to keep in mind when writing code.

Examples

Most of the time, the Smash code required to write a game is pretty straightforward, but here are some examples that will help you circumvent some of the tricky situations you might encounter.

  • Picking Up an Object -- Picking up objects involves more consideration than you might at first think. It's not hard, but there are a couple things to keep in mind. This page contains a few different ways to allow objects to be picked up.
  • Using String Encoding -- Smash's string encoding feature provides the ability to do lots of different things that may not be immediately obvious. This page provides a few different examples of things you can do with string encoding.
  • Displaying Pluralized Nouns -- This page illustrates the use of string encoding and the p: and P: operators to display quantities of items that may or may not be plural, depending on the state of the game.

Sample Adventure

The following is the complete source code for "The Trainer" as it appears on Adventure Games Live. This makes use of a great many standard devices that are used in implementing games in Smash.

  • The Trainer -- Source code and step-by-step explanation.
  • The Trainer: admin.sma -- An explanation of what the admin.sma file can be used for, with an example pertaining to The Trainer.

Writing Games

What is an adventure game? What is interactive fiction? Generally speaking, they are games in which a story unfolds according to the actions the player, typically playing the role of the central character, chooses to take. The terms "adventure game" and "interactive fiction" are more or less equivalent; the former implies greater emphasis on "game" than "story," while the latter term implies the reverse.

Writing Games for Adventure Games Live

  • Rules for Smash Games -- If you have aims for writing a Smash game for inclusion on the Adventure Games Live site, this is a very important page to read. The Adventure Games Live site, which is a repository on RinkWorks of adventure games written in Smash, has several rules and conditions about games that are posted there.
  • Implementing Your Game In Smash -- After your design is done, it's time to implement it in Smash. Here is how to go about that.
  • Coding Standards -- Any game that will be posted on Adventure Games Live must adhere to these rules of formatting and code styling. Even for games that are not bound for the Adventure Games Live site, you might want to adhere to these rules anyway, as they promote consistency and readability.