Body of a game type file

From CookieCraft

Jump to: navigation, search

This article describes the general body of a game type file. From game type to game type there are minor differences which you can find out by looking into these game type files. These files are located in data1.jar, a zip file inside the Cookie Craft directory. The graphics used in the game are located in data2.jar and data3.jar.

Body of a game type file:

<?xml version="1.0" encoding="UTF-8"?>
 
<world width="800"                                         <!-- Width of the background image. -->
       height="600"                                        <!-- Height of the background image. -->
       players="2"                                         <!-- Number of players. -->
       background="com/sjc/foot/field/FootFieldRound.jpg"  <!-- Path to background image. -->
       gameControl="FootballControl"                       <!-- Defines the game rules. -->
       description="Mein erstes Spiel">                    <!-- Name of the game type. -->
  <obstacles>
    <!-- Here the obstacles (walls) are specified. -->
    <!-- Walls can be lines (defined by start and end point). -->
    <line startX="80.0" startY="223.0" endX="80.0" endY="175.0" />
    <line startX="80.0" startY="175.0" endX="84.0" endY="148.0" />
    <!-- Or circles. innerWall specifies if the wall is inside or outside. -->
    <circle x="300.0" y="300.0" radius="282.0" innerWall="true" />
  </obstacles>
  <icons>
    <!-- Here you can set icons for each player shown in the player list. -->
    <!-- with color you can set the text color in the chat. -->
    <icon player="0" image="com/sjc/foot/player/RedBall.png" color="#bb0000" />
    <icon player="1" image="com/sjc/foot/player/GreenBall.png" color="#00bb00" />
  </icons>
  <players>
    <!-- The pieces and game objects. -->
    <!-- player specifies the player number of the owner. -->
    <ball player="-1" x="399.0" y="290.0" radius="12.0" weight="1.0" image="com/sjc/foot/player/Adidas.png" slowdownAlive="0.975" />
    <ball player="0" x="109.0" y="290.0" radius="16.0" weight="1.0" image="com/sjc/foot/player/Player0.png" />
    <ball player="1" x="689.0" y="290.0" radius="16.0" weight="1.0" image="com/sjc/foot/player/Player1.png" />
  </players>
  <zones>
    <!-- Zones can be polygons or cirlces. They are identified by type or name depending on the gameControl. -->
    <zone type="0">
      <polygon>
        <point x="19.0" y="233.0" />
        <point x="19.0" y="347.0" />
        <point x="80.0" y="347.0" />
        <point x="80.0" y="233.0" />
      </polygon>
    </zone>
    <zone name="mainCircle">
      <circle x="300" y="300" radius="180.0" />
    </zone>
  </zones>
</world>
Personal tools
In other languages