[1Ed] Prototype 8: Omega Mage

Omega Mage is a game prototype that mixes the dungeon exploration of The Legend of Zelda or Rogue with element-based spell-casting and an interface that works for either mouse or touchscreen (Android, iOS, and so on).

This is the last prototype of the book and therefore the most complex. At the end, you’ll have a nice skeleton for an action-adventure game.

Errata

  • p.729 – “Change the name of Main Camera to __MainCamer” should be “__MainCamera”.
  • p.733 – The method public void BuildRoom(PT_XMLHashtable room) begins on this page, but this is incompatible with the call at the end of Awake() to BuildRoom(roomNumber) .

    To make the code on this page work properly, you will also need to add the overload of public void BuildRoom(string rNumStr) that appears on p.765 and below:

    // Build a room based on room number. This is an alternative version of
    //  BuildRoom that grabs roomXML based on  num.
    public void BuildRoom(string rNumStr) {
    	PT_XMLHashtable roomHT = null;
    	for (int i=0; i<roomsXML.Count; i++) {
    		PT_XMLHashtable ht = roomsXML[i];
    		if (ht.att("num") == rNumStr) {
    			roomHT = ht;
    			break;
    		}
    	}
    	if (roomHT == null) {
    		Utils.tr("ERROR","LayoutTiles.BuildRoom()",
    		         "Room not found: "+rNumStr);
    		return;
    	}
    	BuildRoom(roomHT);
    }

 

Unity 5 Update

Unity made a few changes to their C# code for Unity 5. The PDF below contains full code listings for the EnemyBug.cs, EnemySpiker.cs, Mage.cs, Prototools/PT_MonoBehaviour.cs, Tile.cs, and Prototools/Utils.cs code files, which all require small changes due to Unity 5. These few changes are all highlighted in yellow in the code listings.

pdf-128C35–OmegaMage–U5_Code_Changes.pdf

Starter Package

 

Tutorial Files