Coursework files for Object Oriented Programming Unit undertaken at University of Bristol. Grage Achieved - 80% (1st)
The aim was to build up a game engine for a text adventure game, which also allows game designer to construct their own game.
- object oriented programming
Players are able to interact with some entities.
- look: describes all the items and characters in their current place
- get/drop {item}: pick up / put down an item
- goto: moves the player to the next location
- inventory: lists all the items currently carried by the player
Mike:> look
You are in A log cabin in the woods. You can see:
A bottle of magic potion
A razor sharp axe
A silver coin
A locked wooden trapdoor in the floor
You can access from here:
forest
Mike:> get axe
You picked up a axe
Mike:> goto forest
You are in A deep dark forest. You can see:
A rusty old key
A tall pine tree
You can access from here:
cabin
riverbank
subgraph cluster002 {
node [shape = "none"];
forest [description = "A dark forest"];
subgraph artefacts {
node [shape = "diamond"];
key [description = "Brass key"];
}
}
-<action>
-<triggers>
<keyword>chop</keyword>
<keyword>cut</keyword>
<keyword>cutdown</keyword>
</triggers>
-<subjects>
<entity>tree</entity>
<entity>axe</entity>
</subjects>
-<consumed>
<entity>tree</entity>
</consumed>
-<produced>
<entity>log</entity>
</produced>
<narration>You cut down the tree with the axe</narration>
</action>