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.

FilenameDescription SourceCode Explanation
game.txt This file provides some basic information about the game. Source Explanation
start.sma This is the file that gets executed when you first start a new game. Source Explanation
objects.txt This file contains a list of all possible inventory items. Source Explanation
objectactions.sma This file contains the code that should be executed when the player selects an inventory item. Source Explanation
lose.txt This file contains the text that gets printed when you lose the game. Source Explanation
win.txt This file contains the text that gets printed when you win the game. Source Explanation
tree.sma This is where you start. It is where the tree with the rope in it is. Source Explanation
rock.sma This is at the bottom of the cliff, where you can pick up the small rock. Source Explanation
dragon.sma This is at the top of the cliff, where the dragon is. Source Explanation
kobold.sma This is just outside the cave, where the kobold is initially guarding it. Source Explanation
coin.sma This is the woods area where you can find the coin by kicking leaves around. Source Explanation
cave.sma This is inside the cave, where the sword and the locked door are. Source Explanation
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.   Explanation


Back to the Smash Tutorial.