Rafael Fajardo
Director, SWEAT collaborative
Associate Professor,
Emergent Digital Practices
University of Denver

 

Projects: Generic Game Engine Sample Data Set

<?xml version="1.0" encoding="UTF-8"?>
<world version="1.0">
  //This is the map section of the file.  Each of the individual characters
  //refrences a tile in the main code of the widget.  The characters are read
  //into the code and then character by character turned into the
  //corresponding image.
<map>
dddddddddddddddddd
dggggggggggggggggd
dggggggggggggggggd
dggggggggggggggggd
dggggggggggggggggd
dggggggggggggggggd
dggggggggggggggggd
dggggggggggggggggd
dggggggggggggggggd
dggggggggggggggggd
dddddddddddddddddd
</map>
   
<resources>
   //eventMap is an array that stores possible events...the hloc and vloc correspond to the position
   //of the event on the world grid...however the image associated with the event can be in a different
   //position than the actual event by utilizing the hOff and vOff variables which will change the
   //placement of the image.  The image path points to the event's image.  The event code is the
   //code that will be executed when the event is walked over by the character.  Multiple functions
   //or code can be called by putting a ';' between the calls(all within the quotes).  The
   //function call killEvent(number in array) will eliminate the event from the screen.
   //NOTE: number in array starts at 0 so 0, 1, 2, etc.
   //addToInventory takes (name of item, path to image file, value of item);

   <events>
   eventArray = [
   {
      hloc: 9,
      vloc: 6,
      hOff: 0,
      vOff: 0,
      eventImagePath: "images/tiles/power_up.png",
      eventCode: "alert('POWER UP...You have just gained 100 points as well as an extra life, way to go');updateLife(1);updateScore(100); " + "killEvent(0);",
      eventImage: null
   },
   {
     hloc: 10,
     vloc: 6,
     hOff: 0,
     vOff: 0,
     eventImagePath: "images/tiles/power_up.png",
     eventCode: "alert('POWER UP...You have just gained 100 points as well as a shiny rock...so shiny...check your inventory!  I will figure out how to let you all use it later.');updateScore(100);addToInventory('Shiny Rock', 'images/tiles/shinyRock.gif', '10'); " + "killEvent(1);",
     eventImage: null
   },
   {
     hloc: 11,
     vloc: 6,
     hOff: 0,
     vOff: 0,
     eventImagePath: "images/tiles/power_up.png",
     eventCode: "alert('In case you did not notice the game now keeps track of the going on in scenes and will remember if you picked up things, so you will not see this power pellet again.');" + "killEvent(2);",
     eventImage: null
   },
   {
      hloc: 1,
      vloc: 2,
      hOff: 0,
      vOff: -1,
      eventImagePath: "images/tiles/gjc_house.gif",
      eventCode: "readFile('scenes/insideHouse.gges')",
      eventImage: null
      }


]

   </events>

  //The hloc and vloc of the character are the characters starting location on the map.  each of
  //the images are for all of the four directions, but you can use the same image for multiple
  //directions if you don't want the character to face all four directions.
  //Characters is an array and with small adjustments to the main code multiple characters can be
  //added here to create 2, 3, however many player games you want.  Remember though, this section
  //is for playable characters only NPC(non-player characters) should fall under the events section.
   <characters>
characters = [
{
   hloc: 7,
   vloc: 5,
   imageRight : "images/tiles/right.gif",
   imageRightTwo : "images/tiles/rightwalk.gif",
   imageLeft : "images/tiles/left.gif",
   imageLeftTwo : "images/tiles/leftwalk.gif",
   imageDown : "images/tiles/frontwalk1.gif",
   imageDownTwo : "images/tiles/frontwalk2.gif",
   imageUp : "images/tiles/backwalk1.gif",
   imageUpTwo : "images/tiles/backwalk2.gif",
   image: null
}
]
</characters>

</resources>

</world>