Skip to content

Instantly share code, notes, and snippets.

@PJensen
Last active April 28, 2016 03:33
Show Gist options
  • Save PJensen/789378d249e84d07032f5e44e9770e18 to your computer and use it in GitHub Desktop.
Save PJensen/789378d249e84d07032f5e44e9770e18 to your computer and use it in GitHub Desktop.
Dungeon XML (Experimental)
<?xml version="1.0" encoding="utf-8"?>
<Map>
<Rooms>
<Room Id="Room0" Length="20" Width="20">
<Decorations>
<Decoration Id="Room0_Altar" Type="Altar" OnEvent="Room0_Altar__Pray"/>
</Decorations>
<Thresholds>
<Door Orientation="Right" Alignment="Center" Id="Room0_Door0" Locked="True"/>
<Opening Orientation="Left" Alignment="Center" Id="Room0_Opening0"/>
</Thresholds>
<Environment>
<Sound Name="WaterDripping" X="3" Y="6" Volume="50">
<DSP Echo="True" Amount="20"/>
</Sound>
</Environment>
</Room>
<Room Id="Room1" Length="10" Width="10">
<Decorations/>
<Thresholds>
<Door Orientation="Left" Alignment="Center" Id="Room1_Door0" Locked="True"/>
</Thresholds>
</Room>
<Room Id="Room2" Length="5" Width="5">
<Decorations/>
<Thresholds>
<Opening Orientation="Right" Alignment="Center" Id="Room2_Opening0"/>
</Thresholds>
<Items>
<Item X="2" Y="2" Type="Key">
<Attributes>
<Attribute Name="Opens" Value="Room0_Door0"/>
<Attribute Name="Opens" Value="Room1_Door0"/>
</Attributes>
</Item>
</Items>
</Room>
</Rooms>
<Connectors>
<Connector From="Room0_Door0" To="Room1_Door0" Length="5"/>
<Connector From="Room0_Opening0" To="Room2_Opening0" Length="5"/>
</Connectors>
<Script>
function Room0_Altar__Pray(sender, args) {
if (args.EventName == "Pray) {
if (Roll(1/6)) {
Player.Health = 100;
Message("You feel much better!");
}
}
}
</Script>
</Map>
@PJensen
Copy link
Author

PJensen commented Apr 28, 2016

This rendition tries to do away with absolute positioning for every tile; instead it everything is relative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment