Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/docs/examples/lvl-1.mlvl
blob: f0788f6271dd17af3fac669f431897052482bfe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?xml version="1.0" encoding="UTF-8"?>
<muthris>
	<level name='Demo Level 1' description='The first demo level' version='1'>
	
		<!-- TODO Need to figure out how localization fits in with all the raw text -->
	
		<!-- The optional list of authors who created this level, how to contact the person, and what they did (graphics, design, code, tester, etc...) -->
		<authors>
			<author name='dpk3062' contact='dpk3062@rit.edu' did='Everything'/>
		</authors>

		<!--
			* 'sprites' is an image that holds all/most the images used by the level
			* 'preview' is an image that displays a small preview of what the level is
		-->
		<graphics>
			<sprites image='dl1/sprites.png'/>
			<preview image='dl1/preview.png'/>
		</graphics>

		<!-- 
			* An action is something that happens ingame.
			* User actions are done by the player by pressing a key.
			* System actions are done automatically by the game or level.
			* Each user action should have a mapped key binding.
		 -->
		<actions>
			<user>
				<!-- These actions are redefined for this level -->
				<action name='rotate-left'  script='dl1/rotate-left.py'  description='Rotates the falling block counter-clockwise'/>
				<action name='rotate-right' script='dl1/rotate-right.py' description='Rotates the falling block clockwise'/>
				
				<!-- The game's generic functions work fine for these actions -->
				<action name='move-left'  script='../game/usr-actions/move-left.py'  description='Moves the falling block to the left'/>
				<action name='move-right' script='../game/usr-actions/move-right.py' description='Moves the falling block to the right'/>
				<action name='drop'       script='../game/usr-actions/drop.py'       description='Drops the falling block straight down'/>
			</user>
			
			<system>
				<action name='Fall'         script='../game/sys-actions/Fall.py'         description='Occurs when all falling blocks are supposed to drop one spot'/>
				<action name='BlockChanged' script='../game/sys-actions/BlockChanged.py' description='Occurs when any attribute of a Block changes'/>
				<action name='BoardSize'    script='../game/sys-actions/BoardSize.py'    description='Contains information on the size and shape of the game board'/>
				<action name='GameStatus'   script='../game/sys-actions/GameStatus.py'   description="Occurs whenever the game's status changes: won, lost, start, pause, etc..."/>
				<action name='PlayerStatus' script='../game/sys-actions/PlayerStatus.py' description='Represents changes in players: new player, lost player, etc...'/>
				<action name='Score'        script='../game/sys-actions/Scores.py'       description="Occurs when a player's score changes"/>
				<action name='GroupFound'   script='../game/sys-actions/GroupFound.py'   description='Occurs when a block grouping is found'/>
				<action name='PlayerGroupStopped' script='../game/sys-actions/PGS.py'    description='Occurs when the blocks the player controls have fallen onto other blocks'/>
				<!--
				<action name='' script='' description=''/>
				<action name='' script='' description=''/>
				-->
			</system>

			<!--
				There are certain actions the system looks for.  It uses the names to id the actions it needs to use.  If a required system action is missing, then that action cannot happen.  A factory class is used to generate the actions from their names.
			-->
		</actions>

		<!-- 
			* The action attribute must map to an xpath: actions/action/@name
			* TODO The key value needs to be the character's number so can use arrows keys and such
		-->
		<key-bindings>
			<bind key='w' action='rotate-right' default='w'/>
			<bind key='s' action='rotate-left'  default='s'/>
			<bind key='a' action='move-left'    default='a'/>
			<bind key='d' action='move-right'   default='d'/>
			<bind key=' ' action='drop'         default=' '/>
		</key-bindings>

		<!--  -->
		<settings script='dl1/settings.py'/>

		<!--  -->
		<rules>
			<rule script='dl1/rules.py'/>
		</rules>

		<!-- -->
		<blocks>
			<block script='dl1/NumberBlock.py'/>
			<block script='dl1/MathBlock.py'/>
			<block script='dl1/PrimeBlock.py'/>
		</blocks>

	</level>
</muthris>