wormy 0.93.1331: overhaul levelset selection
[wormy.git] / example1.z80
1 ; *** WORM LEVELFILE ***
2 ;       example #1
3 ;        by SHIAR
4
5 ;Sample levelfile with everything commented.
6 ;Teaches you everything to build your own level.
7
8
9 ;-----------------------------------------------------------------------------
10
11 ;Standard 128x57 FIELD:
12 ;       +-----------------+
13 ;(0,0)> |####(BORDER)#####|
14 ;       |#*(2,2)         #|
15 ;       |#               #|
16 ;       |#(63,28)*(64,28)#|
17 ;       |#               #|
18 ;       |#      (125,54)*#|
19 ;       |#################| <(127,56)
20 ;       +-----------------+
21 ;Drawable screen is (2,2)-(125,54); center is (63.5,28)
22 ;
23 ;Screen will scroll with screensizes above 128x57 (max.256x256)
24 ;Example 256x80 FIELD (use 0,80):
25 ;       +-----------------------------------+
26 ;(0,0)> |#############(BORDER)##############|
27 ;       |#*(2,2)          :                #|
28 ;       |#                :                #|
29 ;       |#                :                #|
30 ;       |#                :                #|
31 ;       |#       (125,54)*:                #|
32 ;       |#"""""""""""""""":""""""""""""""""#|
33 ;       |#                :      (253,253)*#|
34 ;       |###################################| <(255,255)
35 ;       +-----------------------------------+
36
37
38 ;-----------------------------------------------------------------------------
39
40 ;DOUBLE CHECK THE FOLLOWING THINGS:
41 ; * correct name size at .org
42 ; * max. choosable level doesn't exeed actual levels present
43 ; * enough hiscore space (two bytes for each peaworm level!)
44
45
46 ;------------------------------- HEADER --------------------------------------
47
48 ;#include "asm86.h"            ;use include files to make your own
49 ;#include "ti86asm.inc"        ;singleplayer ending (just like normal asm)
50
51
52   .org $F3E3-10                ;$F3E3-[name size]
53             ;^^ <-MUST EQUAL NAME SIZE BELOW!!! If not, Worm will crash!
54
55   .db 'w',91                   ;wormLevel header (version .91)
56   .db 10,"Example #1"          ;name size (UPDATE .ORG!!!); level name
57   .dw hiscore-single           ;leveldata size
58
59
60 levelsdata:
61
62   .dw single          ;points to singleplayer levels below
63   .dw peaworm         ;...peaworm level
64   .dw deathmatch      ;...deathmatch
65   .dw foodmatch       ;...foodmatch
66   .dw linkmatch       ;...linkmatch
67   .dw race            ;...race
68   .dw ctf             ;...capture the flag
69   .dw domination      ;...domination
70
71 ;note: use <.dw 0> if no levels present (empty level will be used).
72
73   .db 1,2,3,1         ;max. choosable level for each gametype
74   .db 1,1,1,1         ;so: 1 = level 1 only; 3 = level 1 to 3 available
75
76 ;again .db 0 indicates no levels present.
77
78
79 ;------------------------------- LEVELS --------------------------------------
80
81 ;LEVEL-FORMAT:
82 ;------------
83 ; .db 5               ;nr. of peas in level
84 ; .db 4               ;delay (0=fastest, 4=normal)
85 ; .db 15              ;growth per pea
86 ; .db 15              ;begin size
87 ; .db 4               ;sprite size (1-8; 0=use default sprite)
88 ; .db %01100000       ;the sprite
89 ; .db %11110000
90 ; .db %11110000
91 ; .db %01100000
92 ; .db 2               ;bouncing balls (0-40)
93 ; .db 2               ;BALL #1: begin y-position
94 ; .db 4               ;         begin-x
95 ; .db %00             ;         direction (%00=right+down, %11=left+up)
96 ; .db 2,7,%00         ;BALL #2: y,x,direction
97 ; .db 0               ;your start direction (0=down,$40=right,$80=up,$C0=left)
98 ; .db 2               ;your y-position (2=at top)
99 ; .db 63              ;your x-position (63=center)
100 ;                     ;IN MULTIPLAYER LEVELS also set positions for worm 2-4:
101 ;(.db $C0,28,125 )    ;player 2 moves left
102 ;(.db $00, 2, 63 )    ;player 3 moves down
103 ;(.db $80,54, 63 )    ;player 4 moves up
104 ;
105 ; .db 128,57          ;field size: width (128-255), height (57-255)
106 ;                     ; screen will SCROLL if size is more than 128,57
107 ;                     ;IN CTF LEVELS also set flag-positions:
108 ;(.db 10,117 )        ;flag #1 y-position, x-position
109 ;(.db 46,10  )        ;flag #2 y-pos, x-pos.
110 ;
111 ; .db 2               ;number of lines:
112 ; .db 28,14,100,41    ;LINE #1 coordinates: (x1,y1)-(x2,y2)
113 ; .db 28,41,100,14    ;LINE #2: the same
114 ; .db 1               ;number of boxes:
115 ; .db 16,12,48,12     ;BOX #1: x1,y1,x2,ysize(y2-y1)
116 ;------------         ;THAT'S ALL; repeat for all levels
117
118
119 single:               ;singleplayer levels start here
120
121   .db 5,4,15
122   .db 15,5
123   .db %01110000
124   .db %10001000
125   .db %10001000
126   .db %10001000
127   .db %01110000
128   .db 0
129   .db 0,2,63
130   .db 128,57
131   .db 0,0             ;no lines/boxes
132
133   .db 8,4,15,15,0
134   .db 0
135   .db $40,14,2
136   .db 128,57
137   .db 1               ;one horizontal line
138   .db 28,28,100,28
139   .db 0
140
141   .db 255             ;end marker: no more levels
142
143 ;Code to run when all levels are done:
144 ;Worm waits a second, then screen is cleared and this code will be run.
145
146    ret                ;no end, quit and continue with stats-screen
147
148 ;This is a sample ending displaying "Congratulations!!" to use instead of RET:
149 ;  ld hl,endtext
150 ;  call _puts         ;display text
151 ;  jp _getkey         ;wait for a key and return (jp = call+ret)
152 ;endtext:
153 ; .db "  Congratulations!!",0
154
155
156 peaworm:              ;peaworm levels (2)
157   .db 5,4,15
158   .db 15,5
159   .db %01110000
160   .db %10001000
161   .db %10001000
162   .db %10001000
163   .db %01110000
164   .db 0
165   .db 0,2,63
166   .db 128,57
167   .db 0,0
168
169   .db 5,4,15,15,0,0
170   .db 0,2,63
171   .db 128,57
172   .db 0,0
173
174
175 deathmatch:           ;deathmatch levels
176   .db 8,5,15,31,0,0
177   .db $40,28,2        ;begin stats for each player
178   .db $C0,28,125
179   .db $00,2,63
180   .db $80,54,63
181   .db 128,57          ;field size
182   .db 0
183   .db 4               ;4 boxes
184   .db 16,12,48,12
185   .db 80,12,112,12
186   .db 16,34,48,12
187   .db 80,34,112,12
188
189
190 foodmatch:
191 domination:
192   .db 8,5,18,15,0,0
193   .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
194   .db 128,57
195   .db 0,0
196
197
198 linkmatch:
199   .db 8,0,15,15,0,0
200   .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
201   .db 228,157
202   .db 0,0
203
204
205 race:
206   .db 8,4,15,10,0,0
207   .db $40,3,2,$40,6,2, $40,9,2,$40,12,2
208   .db 128,57
209   .db 0
210   .db 2
211   .db 22,21,104,15
212   .db 52,10,74,37
213
214
215 ctf:
216   .db 8,5,18,15,0,0
217   .db $20,2,2,$A0,54,125, $20,2,7,$A0,54,120
218   .db 128,57
219   .db 10,117,46,10
220   .db 0,0
221
222
223
224 hiscore:              ;space reserved to store hi-scores
225   .dw 0               ;singleplayer hiscore will be saved here
226   .dw 0,0             ;peaworm hiscore for each peaworm-level
227
228
229   .end
230 .end