9a2a5565bf40d46b38982e867c0e9d0ffb71a7fb
[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',90                   ;wormLevel header (version .90)
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 2,3,4,2         ;max. choosable level+1 for each gametype
74   .db 2,2,2,2         ;so: 2 = level 1 only; 4 = 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=up,$40=right,$80=down,$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 ; .db 2               ;number of lines:
108 ; .db 28,14,100,41    ;LINE #1 coordinates: (x1,y1)-(x2,y2)
109 ; .db 28,41,100,14    ;LINE #2: the same
110 ; .db 1               ;number of boxes:
111 ; .db 16,12,48,12     ;BOX #1: x1,y1,x2,ysize(y2-y1)
112 ;------------         ;THAT'S ALL; repeat for all levels
113
114
115 single:               ;singleplayer levels start here
116
117   .db 5,4,15
118   .db 15,5
119   .db %01110000
120   .db %10001000
121   .db %10001000
122   .db %10001000
123   .db %01110000
124   .db 0
125   .db 0,2,63
126   .db 128,57
127   .db 0,0             ;no lines/boxes
128
129   .db 8,4,15,15,0
130   .db 0
131   .db $40,14,2
132   .db 128,57
133   .db 1               ;one horizontal line
134   .db 28,28,100,28
135   .db 0
136
137   .db 255             ;end marker: no more levels
138
139 ;Code to run when all levels are done:
140 ;Worm waits a second, then screen is cleared and this code will be run.
141
142    ret                ;no end, quit and continue with stats-screen
143
144 ;This is a sample ending displaying "Congratulations!!" to use instead of RET:
145 ;  ld hl,endtext
146 ;  call _puts         ;display text
147 ;  jp _getkey         ;wait for a key and return (jp = call+ret)
148 ;endtext:
149 ; .db "  Congratulations!!",0
150
151
152 peaworm:              ;peaworm levels (2)
153   .db 5,4,15
154   .db 15,5
155   .db %01110000
156   .db %10001000
157   .db %10001000
158   .db %10001000
159   .db %01110000
160   .db 0
161   .db 0,2,63
162   .db 128,57
163   .db 0,0
164
165   .db 5,4,15,15,0,0
166   .db 0,2,63
167   .db 128,57
168   .db 0,0
169
170
171 deathmatch:           ;deathmatch levels
172   .db 8,5,15,31,0,0
173   .db $40,28,2        ;begin stats for each player
174   .db $C0,28,125
175   .db $00,2,63
176   .db $80,54,63
177   .db 128,57          ;field size
178   .db 0
179   .db 4               ;4 boxes
180   .db 16,12,48,12
181   .db 80,12,112,12
182   .db 16,34,48,12
183   .db 80,34,112,12
184
185
186 foodmatch:
187 ctf:
188 domination:
189   .db 8,5,18,15,0,0
190   .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
191   .db 128,57
192   .db 0,0
193
194
195 linkmatch:
196   .db 8,0,15,15,0,0
197   .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
198   .db 228,157
199   .db 0,0
200
201
202 race:
203   .db 8,4,15,10,0,0
204   .db $40,3,2,$40,6,2, $40,9,2,$40,12,2
205   .db 128,57
206   .db 0
207   .db 2
208   .db 22,21,104,15
209   .db 52,10,74,37
210
211
212 hiscore:              ;space reserved to store hi-scores
213   .dw 0               ;singleplayer hiscore will be saved here
214   .dw 0,0             ;peaworm hiscore for each peaworm-level
215
216
217   .end
218 .end