Main      Site Guide    
Smash Tutorial

Sample Adventure: The Trainer


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. It is recommended that you play The Trainer on the Adventure Games Live site before browsing this source code, so you know what the code is supposed to do. You can also download the source code in a ZIP file.

Filename Description Source Code Explanation
game.txt This file provides some basic information about the game.
start.sma This is the file that gets executed when you first start a new game.
objects.txt This file contains a list of all possible inventory items.
objectactions.sma This file contains the code that should be executed when the player selects an inventory item.
lose.txt This file contains the text that gets printed when you lose the game.
win.txt This file contains the text that gets printed when you win the game.
tree.sma This is where you start. It is where the tree with the rope in it is.
rock.sma This is at the bottom of the cliff, where you can pick up the small rock.
dragon.sma This is at the top of the cliff, where the dragon is.
kobold.sma This is just outside the cave, where the kobold is initially guarding it.
coin.sma This is the woods area where you can find the coin by kicking leaves around.
cave.sma This is inside the cave, where the sword and the locked door are.
admin.sma This file provides functions that the game's author and/or administrator can use to see how players are doing in their games.