Browse code

kiss_the_king added

Lorenz Glaser authored onWed/Sep/2020 18:0:nd
Showing26 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,8 @@
1
+swswswsw
2
+wswswsws
3
+swswswsw
4
+wswswsws
5
+swswswsw
6
+wswswsws
7
+swswswsw
8
+wswswsws
0 9
\ No newline at end of file
1 10
new file mode 100644
... ...
@@ -0,0 +1,8 @@
1
+abcdecba
2
+ffffffff
3
+hhhhhhhh
4
+hhhhhhhh
5
+hhhhhhhh
6
+hhhhhhhh
7
+uuuuuuuu
8
+zxytvyxz
0 9
\ No newline at end of file
1 10
new file mode 100644
2 11
Binary files /dev/null and b/kiss_the_king/img/32.png differ
3 12
new file mode 100644
4 13
Binary files /dev/null and b/kiss_the_king/img/32_pressed.png differ
5 14
new file mode 100644
6 15
Binary files /dev/null and b/kiss_the_king/img/40.png differ
7 16
new file mode 100644
8 17
Binary files /dev/null and b/kiss_the_king/img/40_pressed.png differ
9 18
new file mode 100644
10 19
Binary files /dev/null and b/kiss_the_king/img/48.png differ
11 20
new file mode 100644
12 21
Binary files /dev/null and b/kiss_the_king/img/48_pressed.png differ
13 22
new file mode 100644
14 23
Binary files /dev/null and b/kiss_the_king/img/Startbild.png differ
15 24
new file mode 100644
16 25
Binary files /dev/null and b/kiss_the_king/img/Well_done.png differ
17 26
new file mode 100644
18 27
Binary files /dev/null and b/kiss_the_king/img/schwarz/bauer.png differ
19 28
new file mode 100644
20 29
Binary files /dev/null and b/kiss_the_king/img/schwarz/dame.png differ
21 30
new file mode 100644
22 31
Binary files /dev/null and b/kiss_the_king/img/schwarz/koenig.png differ
23 32
new file mode 100644
24 33
Binary files /dev/null and b/kiss_the_king/img/schwarz/laeufer.png differ
25 34
new file mode 100644
26 35
Binary files /dev/null and b/kiss_the_king/img/schwarz/springer.png differ
27 36
new file mode 100644
28 37
Binary files /dev/null and b/kiss_the_king/img/schwarz/turm.png differ
29 38
new file mode 100644
30 39
Binary files /dev/null and b/kiss_the_king/img/spielfeld/schwarz.png differ
31 40
new file mode 100644
32 41
Binary files /dev/null and b/kiss_the_king/img/spielfeld/weiss.png differ
33 42
new file mode 100644
34 43
Binary files /dev/null and b/kiss_the_king/img/weiss/bauer.png differ
35 44
new file mode 100644
36 45
Binary files /dev/null and b/kiss_the_king/img/weiss/dame.png differ
37 46
new file mode 100644
38 47
Binary files /dev/null and b/kiss_the_king/img/weiss/koenig.png differ
39 48
new file mode 100644
40 49
Binary files /dev/null and b/kiss_the_king/img/weiss/laeufer.png differ
41 50
new file mode 100644
42 51
Binary files /dev/null and b/kiss_the_king/img/weiss/springer.png differ
43 52
new file mode 100644
44 53
Binary files /dev/null and b/kiss_the_king/img/weiss/turm.png differ
45 54
new file mode 100755
46 55
Binary files /dev/null and b/kiss_the_king/kiss_the_king differ
47 56
new file mode 100644
... ...
@@ -0,0 +1,1388 @@
1
+doc Mein erstes Schachspiel
2
+	
3
+screenWidth = peek("desktopwidth")
4
+screenHeight = peek("desktopheight")
5
+halfscreen_width=screenWidth/2
6
+halfscreen_height=screenHeight/2
7
+
8
+// Initialize the window, load the sprites and put up the canvas
9
+// Startvariablen
10
+
11
+if(peek("isbound")) then
12
+	prg_dir$=peek$("directory")	
13
+else	
14
+	prg_dir$=system$("pwd")	
15
+	prg_dir$=left$(prg_dir$, len(prg_dir$)-1)		
16
+endif
17
+prgstart(stopp)
18
+
19
+sub prgstart(stopp)	
20
+
21
+spielstand_dir$=prg_dir$+"/stand"	
22
+
23
+Grafikverzeichnis$=prg_dir$+"/img/"
24
+Bildschirm$="Win"
25
+Breite_Views=800
26
+Hoehe_Views=430
27
+stopp=1
28
+
29
+window open (halfscreen_width-320),(halfscreen_height-215) to  (halfscreen_width+320),(halfscreen_height+215), Bildschirm$, "Kiss_the_king"
30
+window set Bildschirm$, "flags", "not-zoomable, not-h-resizable, not-v-resizable"
31
+
32
+DRAW SET "BGColor",0,0,0, Bildschirm$
33
+view 0,0 to Breite_Views,500, "Startbild", Bildschirm$
34
+draw set "BGcolor", 0,0,0, "Startbild"
35
+
36
+err = draw image 35,30, Grafikverzeichnis$+"Startbild.png", "Startbild"
37
+CHECKBOX IMAGE 135,200 , "Spielfigur1", Grafikverzeichnis$+"32_pressed.png" , Grafikverzeichnis$+"32.png",Grafikverzeichnis$+"32.png",Grafikverzeichnis$+"32.png", false, "Startbild"
38
+CHECKBOX IMAGE 285,200 , "Spielfigur2", Grafikverzeichnis$+"40_pressed.png", Grafikverzeichnis$+"40.png",Grafikverzeichnis$+"64.png",Grafikverzeichnis$+"64.png", false, "Startbild"
39
+CHECKBOX IMAGE 435,200 , "Spielfigur3", Grafikverzeichnis$+"48_pressed.png", Grafikverzeichnis$+"48.png",Grafikverzeichnis$+"64.png",Grafikverzeichnis$+"64.png", false, "Startbild"
40
+
41
+
42
+//BUTTON 180,320 TO 280,340, "Highscore", "Highscore", "Startbild"	
43
+BUTTON 300,320 TO 400,340, "Hilfe", "Help", "Startbild"	
44
+BUTTON 420,320 TO 520,340, "About", "About", "Startbild"	
45
+
46
+
47
+abfragen()
48
+
49
+end sub
50
+
51
+sub abfragen()
52
+
53
+dim msg$(1)
54
+dim part$(1)
55
+dim mouse$(1)
56
+dim ViewMouse$(1)
57
+inloop=1
58
+schritte=0				
59
+		
60
+while(inloop)
61
+	//print "stopp"+str$(stopp)
62
+	if (stopp=1) then		
63
+		keymsg$="enter"			
64
+	else
65
+		
66
+		if (endgame=1) then	
67
+			stopp=1
68
+			exit		
69
+		else
70
+			keymsg$ = keyboard message$(Bildschirm$)
71
+		endif
72
+	endif
73
+	if(keymsg$<>"" and keymsg$<>old_keymsg$) then 
74
+		old_keymsg$ = keymsg$			
75
+	endif	
76
+	
77
+	if (keymsg$<>"")	then	
78
+		If (stopp=1) then		
79
+		else
80
+			Punkte=Punkte-schritte			
81
+			player_moves=player_moves+schritte
82
+			if (Punkte<0) then			
83
+				Punkte=0				
84
+			endif			
85
+			punkte(Punkte)		
86
+		endif	
87
+	endif	
88
+	
89
+	switch(keymsg$)
90
+		case "esc"
91
+			inloop=0
92
+		break			
93
+		case "n"
94
+			if (maxi_leben>0) then
95
+				maxi_leben=maxi_leben-1
96
+				Leben(maxi_leben)
97
+				gleicheslevel=aktlevel	
98
+				gleicheslevel(gleicheslevel)					
99
+				stopp=0				
100
+			elseif (maxi_leben=0) then			
101
+				stopp=1		
102
+					
103
+			endif						
104
+		break
105
+		case "q"
106
+				aktlevel=aktlevel+1
107
+				punkte(levelgewonnen)
108
+				neueslevel(aktlevel)										
109
+		break
110
+			
111
+		//case "e"	
112
+			//endgame()									
113
+		//break	
114
+		case "7"
115
+		case "home"
116
+			if(instr(" t", mid$(levelline$(mapy-1), mapx-1, 1))) then
117
+				// soundplay "base.wav", false
118
+				Walkleftandup()				
119
+				schritte=1			
120
+			elseif(instr("bf", mid$(levelline$(mapy-1), mapx-1, 1)) and instr(" t", mid$(levelline$(mapy+2), mapx,1))) then
121
+				//PushDown()
122
+			endif
123
+			sleep 0.05			
124
+		break		
125
+		case "1"
126
+		case "end"
127
+			if(instr(" t", mid$(levelline$(mapy+1), mapx-1, 1))) then
128
+				// soundplay "base.wav", false
129
+				Walkleftanddown()				
130
+				schritte=1
131
+			elseif(instr("bf", mid$(levelline$(mapy-1), mapx-1, 1)) and instr(" t", mid$(levelline$(mapy+2), mapx,1))) then
132
+				//PushDown()
133
+			endif
134
+			sleep 0.05			
135
+		break		
136
+		case "3"
137
+		case "pagedown"
138
+			if(instr(" t", mid$(levelline$(mapy+1), mapx+1, 1))) then
139
+				// soundplay "base.wav", false
140
+				Walkrightanddown()				
141
+				schritte=1
142
+			elseif(instr("bf", mid$(levelline$(mapy-1), mapx+1, 1)) and instr(" t", mid$(levelline$(mapy+2), mapx,1))) then
143
+				//PushDown()
144
+			endif
145
+			sleep 0.05			
146
+		break		
147
+		case "9"
148
+		case "pageup"
149
+			if(instr(" t", mid$(levelline$(mapy-1), mapx+1, 1))) then
150
+				// soundplay "base.wav", false
151
+				Walkrightandup()				
152
+				schritte=1
153
+			elseif(instr("bf", mid$(levelline$(mapy-1), mapx+1, 1)) and instr(" t", mid$(levelline$(mapy+2), mapx,1))) then
154
+				//PushDown()
155
+			endif
156
+			sleep 0.05			
157
+		break		
158
+		case "2"			
159
+		case "down"
160
+			if(instr(" t", mid$(levelline$(mapy+1), mapx, 1))) then
161
+				// soundplay "base.wav", false
162
+				WalkDown()				
163
+				schritte=1
164
+			elseif(instr("bf", mid$(levelline$(mapy+1), mapx, 1)) and instr(" t", mid$(levelline$(mapy+2), mapx,1))) then
165
+				PushDown()
166
+			endif
167
+			sleep 0.05
168
+			
169
+		break		
170
+		case "8"	
171
+		case "up"
172
+			if(instr(" t", mid$(levelline$(mapy-1), mapx, 1))) then
173
+				// soundplay "base.wav", false
174
+				WalkUp()				
175
+				schritte=1
176
+			elseif(instr("bf", mid$(levelline$(mapy-1), mapx, 1)) and instr(" t", mid$(levelline$(mapy-2), mapx,1))) then
177
+				PushUp()
178
+			endif
179
+			sleep 0.05
180
+		break		
181
+		case "6"	
182
+		case "left"
183
+			if(instr(" t", mid$(levelline$(mapy), mapx-1, 1))) then
184
+				// soundplay "base.wav", false
185
+				WalkLeft()				
186
+				schritte=1
187
+			elseif(instr("bf", mid$(levelline$(mapy), mapx-1, 1)) and instr(" t", mid$(levelline$(mapy), mapx-2,1))) then
188
+				PushLeft()
189
+			endif
190
+			sleep 0.05
191
+		break		
192
+		case "4"	
193
+		case "right"
194
+			if(instr(" t", mid$(levelline$(mapy), mapx+1, 1))) then
195
+				// soundplay "base.wav", false
196
+				WalkRight()				
197
+				schritte=1
198
+			elseif(instr("bf", mid$(levelline$(mapy), mapx+1, 1)) and instr(" t", mid$(levelline$(mapy), mapx+2,1))) then
199
+				PushRight()
200
+			endif
201
+			sleep 0.05
202
+		break		
203
+		case "shift-6"	
204
+		case "shift-right"
205
+			if(instr(" t", mid$(levelline$(mapy), mapx+1, 1))) then
206
+				// soundplay "base.wav", false
207
+				//WalkRight()
208
+			elseif(instr("bf", mid$(levelline$(mapy), mapx+1,1)) and instr(" t", mid$(levelline$(mapy), mapx+2,1))) then
209
+				//print mid$(levelline$(mapy), mapx+1,1)
210
+				//print mid$(levelline$(mapy), mapx+2,1) 
211
+				PushShiftRight()
212
+			endif
213
+			sleep 0.05
214
+		break		
215
+		case "shift-4"	
216
+		case "shift-left"
217
+			if(instr(" t", mid$(levelline$(mapy), mapx-1, 1))) then
218
+				// soundplay "base.wav", false
219
+				//WalkLeft()
220
+			elseif(instr("bf", mid$(levelline$(mapy), mapx-1, 1)) and instr(" t", mid$(levelline$(mapy), mapx-2,1))) then
221
+				PushShiftLeft()
222
+			endif
223
+			sleep 0.05
224
+		break		
225
+		case "shift-2"			
226
+		case "shift-down"
227
+			if(instr(" t", mid$(levelline$(mapy+1), mapx, 1))) then
228
+				// soundplay "base.wav", false
229
+				//WalkDown()
230
+			elseif(instr("bf", mid$(levelline$(mapy+1), mapx, 1)) and instr(" t", mid$(levelline$(mapy+2), mapx,1))) then
231
+				PushShiftDown()
232
+			endif
233
+			sleep 0.05
234
+		break		
235
+		case "shift-8"	
236
+		case "shift-up"
237
+			if(instr(" t", mid$(levelline$(mapy-1), mapx, 1))) then
238
+				// soundplay "base.wav", false
239
+				//WalkUp()
240
+			elseif(instr("bf", mid$(levelline$(mapy-1), mapx, 1)) and instr(" t", mid$(levelline$(mapy-2), mapx,1))) then
241
+				PushShiftUp()
242
+			endif
243
+			sleep 0.05
244
+		break		
245
+		case "ctrl-2"	
246
+		case "ctrl-down"
247
+			if(instr("bf", mid$(levelline$(mapy-1), mapx, 1)) and instr(" t",mid$(levelline$(mapy+1),mapx,1))) then
248
+				PullDown()
249
+			//elseif(instr("bf", mid$(levelline$(mapy-1), mapx, 1)) and instr(" t", mid$(levelline$(mapy-2), mapx,1))) then
250
+				//print "ok"
251
+				//PushShiftUp()
252
+			endif
253
+			sleep 0.05
254
+		break		
255
+		case "ctrl-8"	
256
+		case "ctrl-up"
257
+			if(instr("bf", mid$(levelline$(mapy+1), mapx, 1)) and instr(" t",mid$(levelline$(mapy-1),mapx,1))) then
258
+				PullUp()
259
+			//elseif(instr("bf", mid$(levelline$(mapy+1), mapx, 1)) and instr(" t", mid$(levelline$(mapy+2), mapx,1))) then
260
+				//print "ok"
261
+				//PushShiftUp()
262
+			endif
263
+			sleep 0.05
264
+		break		
265
+		case "ctrl-4"	
266
+		case "ctrl-left"
267
+			if(instr("bf", mid$(levelline$(mapy), mapx+1, 1)) and instr(" t",mid$(levelline$(mapy),mapx-1,1))) then
268
+				PullLeft()
269
+			//elseif(instr("bf", mid$(levelline$(mapy), mapx+1, 1)) and instr(" t", mid$(levelline$(mapy), mapx+2,1))) then
270
+				//print "ok"
271
+				//PushShiftUp()
272
+			endif
273
+			sleep 0.05
274
+		break		
275
+		case "ctrl-6"	
276
+		case "ctrl-right"
277
+			if(instr("bf", mid$(levelline$(mapy), mapx-1, 1)) and instr(" t",mid$(levelline$(mapy),mapx+1,1))) then
278
+				PullRight()
279
+			//elseif(instr("bf", mid$(levelline$(mapy+1), mapx, 1)) and instr(" t", mid$(levelline$(mapy+2), mapx,1))) then
280
+				//print "ok"
281
+				//PushShiftUp()
282
+			endif
283
+			sleep 0.05
284
+		break
285
+		case "Next_level:enter"
286
+			punkte(levelgewonnen)
287
+			neueslevel(aktlevel)													
288
+			window close "Next_level"
289
+			WINDOW SET Bildschirm$,"Activate"	
290
+		break
291
+		default:
292
+					
293
+		break
294
+	end switch
295
+	nCommands = token(message$, msg$(), "|")		
296
+	for everyCommand = 1 to nCommands	
297
+		//print msg$(everyCommand)
298
+		
299
+		switch(msg$(everyCommand))
300
+			case "_QuitRequested":
301
+			case "Win:_QuitRequested"
302
+				endgame=1
303
+				window close Bildschirm$
304
+				exit	
305
+			break
306
+			case "h"		
307
+			case "Highscore"				
308
+				level$="gesamt"				
309
+				initial=1			
310
+				highscore(level$,initial)			
311
+			break			
312
+			case "HGEasy"			
313
+					initial=0	
314
+					level$="Easy"	
315
+				highscore(level$,initial)			
316
+			break			
317
+			
318
+			case "level"			
319
+				punkte(levelgewonnen)
320
+				neueslevel(aktlevel)											
321
+				window close "Next_level"				
322
+				WINDOW SET Bildschirm$,"Activate"				
323
+			break
324
+			case "Next_level:_QuitRequested"
325
+				window close "Next_level"
326
+			break
327
+			case "About"
328
+				AboutWindow()
329
+			break
330
+			case "AboutClose"
331
+				window close "View_About"
332
+			break
333
+		REM Endgame
334
+		
335
+		
336
+			case "Speichern"
337
+				spielername$ = TEXTCONTROL GET$ "Spielername"
338
+				//print spielername$
339
+				Punkte$=str$(Punkte)					
340
+					initial=1			
341
+				level_nr$=str$(aktlevel)				
342
+				schritte$=str$(player_moves)				
343
+				lives$=str$(maxi_leben)					
344
+				highscore_speichern(Auswahl_Spielfigur$,spielername$,Punkte$,level$,level_nr$,schritte$,lives$)
345
+				wait 1.0				
346
+				//print level$
347
+				highscore(level$,initial)
348
+				//auswahl()	
349
+				BITMAP REMOVE "spieler"
350
+				BITMAP REMOVE "spieler_ri"
351
+				BITMAP REMOVE "spieler_up"
352
+				BITMAP REMOVE "spieler_down"
353
+				BITMAP REMOVE "spieler_le"
354
+				bitmap 32,32, "wall"
355
+				bitmap REMOVE  "blank"
356
+				bitmap REMOVE  "bulb"
357
+				bitmap REMOVE  "target"
358
+				bitmap REMOVE  "final"				
359
+				window close "Endgame"
360
+			break
361
+			case "Endgame:_QuitRequested"
362
+				window close "Endgame"
363
+			break
364
+			
365
+		Rem Menuabfragen
366
+			Rem Highscore
367
+			case "hgscore:_QuitRequested"
368
+				window close "hgscore"
369
+			break
370
+			case "ok"
371
+				window close "hgscore"
372
+				window close "Win"
373
+				stopp=1
374
+				prgstart(stopp)
375
+			break
376
+			case "HGReset"				
377
+				initial=0		
378
+				highscore_reset(level$)				
379
+				highscore(level$,initial)					
380
+			break		
381
+			case "Spielfigur1:ON"		
382
+				CHECKBOX SET "Spielfigur2", false						
383
+				//OPTION SET "Spielfigur2", "Visible", false
384
+				Sfg=32
385
+				level_i=8
386
+				level_j=8				
387
+				stopp=0					
388
+				Vorbereitung()
389
+				start()
390
+				if (View GET "Startbild", "Exists") then
391
+					view remove "Startbild"
392
+				endif
393
+			break		
394
+			case "Spielfigur2:ON"		
395
+				CHECKBOX SET "Spielfigur1", false						
396
+				
397
+				Sfg=40
398
+				level_i=8
399
+				level_j=8				
400
+				stopp=0					
401
+				Vorbereitung()
402
+				start()
403
+				if (View GET "Startbild", "Exists") then
404
+					view remove "Startbild"
405
+				endif
406
+			break
407
+			case "Spielfigur3:ON"		
408
+				CHECKBOX SET "Spielfigur1", false						
409
+				
410
+				Sfg=48
411
+				level_i=8
412
+				level_j=8				
413
+				stopp=0					
414
+				Vorbereitung()
415
+				start()
416
+				if (View GET "Startbild", "Exists") then
417
+					view remove "Startbild"
418
+				endif
419
+			break
420
+			case "Easy"			
421
+				
422
+			break
423
+			case "Hilfe"
424
+				hilfe()
425
+			break			
426
+			case "Zurueck"
427
+				window close "Hilfe"
428
+			break
429
+			case "Hilfe:_QuitRequested"
430
+				window close "Hilfe"
431
+			break
432
+			default:			
433
+				
434
+			break
435
+	end switch
436
+	sleep 0.5
437
+	
438
+	
439
+	next everyCommand	
440
+	
441
+	//Mausabfragen
442
+			mmsg$ = MOUSE MESSAGE$
443
+			if (mmsg$<>"" and mmsg$<>old_mmsg$) then
444
+				//print mmsg$
445
+				old_mmsg$= mmsg$ 
446
+				nx = split(mmsg$, mouse$(), ":")
447
+				Viewname$=mouse$(1)
448
+				//if (Viewname$="scroll") then
449
+				//	Viewname$="CanVas_1"
450
+				//endif
451
+				
452
+				Xmouse = val(mouse$(2))
453
+				Ymouse = val(mouse$(3))
454
+				BLmouse= val(mouse$(4))
455
+				BCmouse= val(mouse$(5))
456
+				BRmouse= val(mouse$(6))
457
+				//casestring$=Viewname$+":"+mouse$(4)+":"+mouse$(2)+":"+mouse$(3)
458
+				
459
+				if (Xmouse>=0 and Xmouse<=Sfg and Ymouse>=0 and Ymouse<=Sfg) then
460
+					feld$="00"
461
+				elseif (Xmouse>=Sfg and Xmouse<=(Sfg*2) and Ymouse>=0 and Ymouse<=Sfg) then
462
+					feld$="01"
463
+				elseif (Xmouse>=(Sfg*2) and Xmouse<=(Sfg*3)and Ymouse>=0 and Ymouse<=Sfg) then
464
+					feld$="02"
465
+				elseif (Xmouse>=(Sfg*3) and Xmouse<=(Sfg*4) and Ymouse>=0 and Ymouse<=Sfg) then
466
+					feld$="03"
467
+				elseif (Xmouse>=(Sfg*4) and Xmouse<=(Sfg*5) and Ymouse>=0 and Ymouse<=Sfg) then
468
+					feld$="04"
469
+				elseif (Xmouse>=(Sfg*5) and Xmouse<=(Sfg*6) and Ymouse>=0 and Ymouse<=Sfg) then
470
+					feld$="05"
471
+				elseif (Xmouse>=(Sfg*6) and Xmouse<=(Sfg*7) and Ymouse>=0 and Ymouse<=Sfg) then
472
+					feld$="06"
473
+				elseif (Xmouse>=(Sfg*7) and Xmouse<=(Sfg*8) and Ymouse>=0 and Ymouse<=Sfg) then
474
+					feld$="07"
475
+				elseif (Xmouse>=0 and Xmouse<=Sfg and Ymouse>=Sfg and Ymouse<=Sfg) then
476
+					feld$="10"
477
+				elseif (Xmouse>=(Sfg) and Xmouse<=(Sfg*2) and Ymouse>=Sfg and Ymouse<=(Sfg*2)) then
478
+					feld$="11"
479
+				elseif (Xmouse>=(Sfg*2) and Xmouse<=(Sfg*3) and Ymouse>=Sfg and Ymouse<=(Sfg*2)) then
480
+					feld$="12"
481
+				elseif (Xmouse>=(Sfg*3) and Xmouse<=(Sfg*4) and Ymouse>=Sfg and Ymouse<=(Sfg*2)) then
482
+					feld$="13"
483
+				elseif (Xmouse>=(Sfg*4) and Xmouse<=(Sfg*5) and Ymouse>=Sfg and Ymouse<=(Sfg*2)) then
484
+					feld$="14"
485
+				elseif (Xmouse>=(Sfg*5) and Xmouse<=(Sfg*6) and Ymouse>=Sfg and Ymouse<=(Sfg*2)) then
486
+					feld$="15"
487
+				elseif (Xmouse>=(Sfg*6) and Xmouse<=(Sfg*7) and Ymouse>=Sfg and Ymouse<=(Sfg*2)) then
488
+					feld$="16"
489
+				elseif (Xmouse>=(Sfg*7) and Xmouse<=(Sfg*8) and Ymouse>=Sfg and Ymouse<=(Sfg*2)) then
490
+					feld$="17"
491
+				elseif (Xmouse>=0 and Xmouse<=(Sfg*1) and Ymouse>=(Sfg*2) and Ymouse<=(Sfg*3)) then
492
+					feld$="20"
493
+				elseif (Xmouse>=(Sfg*1) and Xmouse<=(Sfg*2) and Ymouse>=(Sfg*2) and Ymouse<=(Sfg*3)) then
494
+					feld$="21"
495
+				elseif (Xmouse>=(Sfg*2) and Xmouse<=(Sfg*3) and Ymouse>=(Sfg*2) and Ymouse<=(Sfg*3)) then
496
+					feld$="22"
497
+				elseif (Xmouse>=(Sfg*3) and Xmouse<=(Sfg*4) and Ymouse>=(Sfg*2) and Ymouse<=(Sfg*3)) then
498
+					feld$="23"
499
+				elseif (Xmouse>=(Sfg*4) and Xmouse<=(Sfg*5) and Ymouse>=(Sfg*2) and Ymouse<=(Sfg*3)) then
500
+					feld$="24"
501
+				elseif (Xmouse>=(Sfg*5) and Xmouse<=(Sfg*6) and Ymouse>=(Sfg*2) and Ymouse<=(Sfg*3)) then
502
+					feld$="25"
503
+				elseif (Xmouse>=(Sfg*6) and Xmouse<=(Sfg*7) and Ymouse>=(Sfg*2) and Ymouse<=(Sfg*3)) then
504
+					feld$="26"
505
+				elseif (Xmouse>=(Sfg*7) and Xmouse<=(Sfg*8) and Ymouse>=(Sfg*2) and Ymouse<=(Sfg*3)) then
506
+					feld$="27"
507
+				elseif (Xmouse>=0 and Xmouse<=(Sfg*1) and Ymouse>=(Sfg*3) and Ymouse<=(Sfg*4)) then
508
+					feld$="30"
509
+				elseif (Xmouse>=(Sfg*1) and Xmouse<=(Sfg*2) and Ymouse>=(Sfg*3) and Ymouse<=(Sfg*4)) then
510
+					feld$="31"
511
+				elseif (Xmouse>=(Sfg*2) and Xmouse<=(Sfg*3) and Ymouse>=(Sfg*3) and Ymouse<=(Sfg*4)) then
512
+					feld$="32"
513
+				elseif (Xmouse>=(Sfg*3) and Xmouse<=(Sfg*4) and Ymouse>=(Sfg*3) and Ymouse<=(Sfg*4)) then
514
+					feld$="33"
515
+				elseif (Xmouse>=(Sfg*4) and Xmouse<=(Sfg*5) and Ymouse>=(Sfg*3) and Ymouse<=(Sfg*4)) then
516
+					feld$="34"
517
+				elseif (Xmouse>=(Sfg*5) and Xmouse<=(Sfg*6) and Ymouse>=(Sfg*3) and Ymouse<=(Sfg*4)) then
518
+					feld$="35"
519
+				elseif (Xmouse>=(Sfg*6) and Xmouse<=(Sfg*7) and Ymouse>=(Sfg*3) and Ymouse<=(Sfg*4)) then
520
+					feld$="36"
521
+				elseif (Xmouse>=(Sfg*7) and Xmouse<=(Sfg*8) and Ymouse>=(Sfg*3) and Ymouse<=(Sfg*4)) then
522
+					feld$="37"
523
+				elseif (Xmouse>=0 and Xmouse<=(Sfg*1) and Ymouse>=(Sfg*4) and Ymouse<=(Sfg*5)) then
524
+					feld$="40"
525
+				elseif (Xmouse>=(Sfg*1) and Xmouse<=(Sfg*2) and Ymouse>=(Sfg*4) and Ymouse<=(Sfg*5)) then
526
+					feld$="41"
527
+				elseif (Xmouse>=(Sfg*2) and Xmouse<=(Sfg*3) and Ymouse>=(Sfg*4) and Ymouse<=(Sfg*5)) then
528
+					feld$="42"
529
+				elseif (Xmouse>=(Sfg*3) and Xmouse<=(Sfg*4) and Ymouse>=(Sfg*4) and Ymouse<=(Sfg*5)) then
530
+					feld$="43"
531
+				elseif (Xmouse>=(Sfg*4) and Xmouse<=(Sfg*5) and Ymouse>=(Sfg*4) and Ymouse<=(Sfg*5)) then
532
+					feld$="44"
533
+				elseif (Xmouse>=(Sfg*5) and Xmouse<=(Sfg*6) and Ymouse>=(Sfg*4) and Ymouse<=(Sfg*5)) then
534
+					feld$="45"
535
+				elseif (Xmouse>=(Sfg*6) and Xmouse<=(Sfg*7) and Ymouse>=(Sfg*4) and Ymouse<=(Sfg*5)) then
536
+					feld$="46"
537
+				elseif (Xmouse>=(Sfg*7) and Xmouse<=(Sfg*8) and Ymouse>=(Sfg*4) and Ymouse<=(Sfg*5)) then
538
+					feld$="47"
539
+				elseif (Xmouse>=0 and Xmouse<=(Sfg*1) and Ymouse>=(Sfg*5) and Ymouse<=(Sfg*6)) then
540
+					feld$="50"
541
+				elseif (Xmouse>=(Sfg*1) and Xmouse<=(Sfg*2) and Ymouse>=(Sfg*5) and Ymouse<=(Sfg*6)) then
542
+					feld$="51"
543
+				elseif (Xmouse>=(Sfg*2) and Xmouse<=(Sfg*3) and Ymouse>=(Sfg*5) and Ymouse<=(Sfg*6)) then
544
+					feld$="52"
545
+				elseif (Xmouse>=(Sfg*3) and Xmouse<=(Sfg*4) and Ymouse>=(Sfg*5) and Ymouse<=(Sfg*6)) then
546
+					feld$="53"
547
+				elseif (Xmouse>=(Sfg*4) and Xmouse<=(Sfg*5) and Ymouse>=(Sfg*5) and Ymouse<=(Sfg*6)) then
548
+					feld$="54"
549
+				elseif (Xmouse>=(Sfg*5) and Xmouse<=(Sfg*6) and Ymouse>=(Sfg*5) and Ymouse<=(Sfg*6)) then
550
+					feld$="55"
551
+				elseif (Xmouse>=(Sfg*6) and Xmouse<=(Sfg*7) and Ymouse>=(Sfg*5) and Ymouse<=(Sfg*6)) then
552
+					feld$="56"
553
+				elseif (Xmouse>=(Sfg*7) and Xmouse<=(Sfg*8) and Ymouse>=(Sfg*5) and Ymouse<=(Sfg*6)) then
554
+					feld$="57"
555
+				elseif (Xmouse>=0 and Xmouse<=(Sfg*1) and Ymouse>=(Sfg*6) and Ymouse<=(Sfg*7)) then
556
+					feld$="60"
557
+				elseif (Xmouse>=(Sfg*1) and Xmouse<=(Sfg*2) and Ymouse>=(Sfg*6)and Ymouse<=(Sfg*7)) then
558
+					feld$="61"
559
+				elseif (Xmouse>=(Sfg*2) and Xmouse<=(Sfg*3) and Ymouse>=(Sfg*6) and Ymouse<=(Sfg*7)) then
560
+					feld$="62"
561
+				elseif (Xmouse>=(Sfg*3) and Xmouse<=(Sfg*4) and Ymouse>=(Sfg*6) and Ymouse<=(Sfg*7)) then
562
+					feld$="63"
563
+				elseif (Xmouse>=(Sfg*4) and Xmouse<=(Sfg*5) and Ymouse>=(Sfg*6) and Ymouse<=(Sfg*7)) then
564
+					feld$="64"
565
+				elseif (Xmouse>=(Sfg*5) and Xmouse<=(Sfg*6) and Ymouse>=(Sfg*6) and Ymouse<=(Sfg*7)) then
566
+					feld$="65"
567
+				elseif (Xmouse>=(Sfg*6) and Xmouse<=(Sfg*7) and Ymouse>=(Sfg*6) and Ymouse<=(Sfg*7)) then
568
+					feld$="66"
569
+				elseif (Xmouse>=(Sfg*7) and Xmouse<=(Sfg*8) and Ymouse>=(Sfg*6) and Ymouse<=(Sfg*7)) then
570
+					feld$="67"
571
+				elseif (Xmouse>=0 and Xmouse<=(Sfg*1) and Ymouse>=(Sfg*7) and Ymouse<=(Sfg*8)) then
572
+					feld$="70"
573
+				elseif (Xmouse>=(Sfg*1) and Xmouse<=(Sfg*2) and Ymouse>=(Sfg*7) and Ymouse<=(Sfg*8)) then
574
+					feld$="71"
575
+				elseif (Xmouse>=(Sfg*2) and Xmouse<=(Sfg*3) and Ymouse>=(Sfg*7) and Ymouse<=(Sfg*8)) then
576
+					feld$="72"
577
+				elseif (Xmouse>=(Sfg*3) and Xmouse<=(Sfg*4) and Ymouse>=(Sfg*7) and Ymouse<=(Sfg*8)) then
578
+					feld$="73"
579
+				elseif (Xmouse>=(Sfg*4) and Xmouse<=(Sfg*5) and Ymouse>=(Sfg*7) and Ymouse<=(Sfg*8)) then
580
+					feld$="74"
581
+				elseif (Xmouse>=(Sfg*5) and Xmouse<=(Sfg*6) and Ymouse>=(Sfg*7) and Ymouse<=(Sfg*8)) then
582
+					feld$="75"
583
+				elseif (Xmouse>=(Sfg*6) and Xmouse<=(Sfg*7) and Ymouse>=(Sfg*7) and Ymouse<=(Sfg*8)) then
584
+					feld$="76"
585
+				elseif (Xmouse>=(Sfg*7) and Xmouse<=(Sfg*8) and Ymouse>=(Sfg*7) and Ymouse<=(Sfg*8)) then
586
+					feld$="77"
587
+				endif
588
+				casestring$=Viewname$+":"+mouse$(4)+":"+mouse$(5)+":"+mouse$(6) //
589
+				print casestring$+":"+feld$
590
+				mmsg$=""
591
+			endif
592
+		
593
+		switch (casestring$)
594
+			case "Canvas:1:0:0"
595
+				
596
+				if (spieler=1) then
597
+					if (teilzug=0) then
598
+						copyBitmap()
599
+						teilzug=1
600
+						spieler=1
601
+					endif
602
+				endif
603
+			
604
+				if(spieler=2) then
605
+					if (teilzug=0) then
606
+						copyBitmap()
607
+						teilzug=1
608
+						spieler=2
609
+					endif
610
+				endif
611
+			
612
+			break
613
+			case "Canvas:0:0:1"
614
+			print spieler
615
+			if (spieler=1) then
616
+				//paste Bitmap
617
+				if (teilzug=1) then
618
+					pasteBitmap()
619
+					teilzug=0
620
+					spieler=1
621
+				endif
622
+				spieler=2
623
+			elseif (spieler=2) then
624
+				if (teilzug=1) then
625
+					pasteBitmap()
626
+					teilzug=0
627
+					spieler=2
628
+				endif
629
+				spieler=1
630
+			endif
631
+			break
632
+			
633
+		end switch
634
+		sleep 0.5	
635
+				
636
+wend
637
+end sub
638
+
639
+sub Walkleftandup()
640
+	mapy = mapy - 1
641
+	mapx = mapx - 1
642
+	playery = playery - 32
643
+	playerx = playerx - 32
644
+	
645
+	draw bitmap playerx, playery, "spieler","alpha", "Canvas"
646
+	if(mid$(levelline$(mapy+1), mapx+1,1) = " ") then
647
+		draw bitmap playerx+32, playery+32, "background","copy", "Canvas"
648
+	elseif(mid$(levelline$(mapy+1), mapx+1,1) = "t") then
649
+		draw bitmap playerx+32, playery+32, "target","copy", "Canvas"
650
+	elseif(mid$(levelline$(mapy+1), mapx+1,1) = "f") then
651
+		draw bitmap playerx+32, playery+32, "final","copy", "Canvas"
652
+	endif
653
+	return	
654
+end sub
655
+sub Walkleftanddown()
656
+	mapy = mapy + 1
657
+	mapx = mapx - 1
658
+	playery = playery + 32
659
+	playerx = playerx - 32
660
+	
661
+	draw bitmap playerx, playery, "spieler","alpha", "Canvas"
662
+	if(mid$(levelline$(mapy-1), mapx+1,1) = " ") then
663
+		draw bitmap playerx+32, playery-32, "background","copy", "Canvas"
664
+	elseif(mid$(levelline$(mapy-1), mapx+1,1) = "t") then
665
+		draw bitmap playerx+32, playery-32, "target","copy", "Canvas"
666
+	elseif(mid$(levelline$(mapy-1), mapx+1,1) = "f") then
667
+		draw bitmap playerx+32, playery-32, "final","copy", "Canvas"
668
+	endif
669
+	return	
670
+end sub
671
+sub Walkrightandup()
672
+	mapy = mapy - 1
673
+	mapx = mapx + 1
674
+	playery = playery - 32
675
+	playerx = playerx + 32
676
+	
677
+	draw bitmap playerx, playery, "spieler","alpha", "Canvas"
678
+	if(mid$(levelline$(mapy+1), mapx-1,1) = " ") then
679
+		draw bitmap playerx-32, playery+32, "background","copy", "Canvas"
680
+	elseif(mid$(levelline$(mapy+1), mapx-1,1) = "t") then
681
+		draw bitmap playerx-32, playery+32, "target","copy", "Canvas"
682
+	elseif(mid$(levelline$(mapy+1), mapx-1,1) = "f") then
683
+		draw bitmap playerx-32, playery+32, "final","copy", "Canvas"
684
+	endif
685
+	return	
686
+end sub
687
+sub Walkrightanddown()
688
+	mapy = mapy + 1
689
+	mapx = mapx + 1
690
+	playery = playery + 32
691
+	playerx = playerx + 32
692
+	
693
+	draw bitmap playerx, playery, "spieler","alpha", "Canvas"
694
+	if(mid$(levelline$(mapy-1), mapx-1,1) = " ") then
695
+		draw bitmap playerx-32, playery-32, "background","copy", "Canvas"
696
+	elseif(mid$(levelline$(mapy-1), mapx-1,1) = "t") then
697
+		draw bitmap playerx-32, playery-32, "target","copy", "Canvas"
698
+	elseif(mid$(levelline$(mapy-1), mapx-1,1) = "f") then
699
+		draw bitmap playerx-32, playery-32, "final","copy", "Canvas"
700
+	endif
701
+	return	
702
+end sub
703
+sub WalkDown()
704
+	mapy = mapy + 1
705
+	playery = playery + 32
706
+	
707
+	draw bitmap playerx, playery, "spieler_down","alpha", "Canvas"
708
+	if(mid$(levelline$(mapy-1), mapx,1) = " ") then
709
+		draw bitmap playerx, playery-32, "background","copy", "Canvas"
710
+	elseif(mid$(levelline$(mapy-1), mapx,1) = "t") then
711
+		draw bitmap playerx, playery-32, "target","copy", "Canvas"
712
+	elseif(mid$(levelline$(mapy-1), mapx,1) = "f") then
713
+		draw bitmap playerx, playery-32, "final","copy", "Canvas"
714
+	endif
715
+	return
716
+end sub
717
+
718
+sub WalkUp()
719
+	mapy = mapy - 1
720
+	playery = playery - 32
721
+	
722
+	draw bitmap playerx, playery, "spieler_up","alpha", "Canvas"
723
+	if(mid$(levelline$(mapy+1), mapx,1) = " ") then
724
+		draw bitmap playerx, playery+32, "background","copy", "Canvas"
725
+	elseif(mid$(levelline$(mapy+1), mapx,1) = "t") then
726
+		draw bitmap playerx, playery+32, "target","copy", "Canvas"
727
+	elseif(mid$(levelline$(mapy+1), mapx,1) = "f") then
728
+		draw bitmap playerx, playery+32, "final","copy", "Canvas"
729
+	endif
730
+	return
731
+end sub
732
+
733
+sub WalkLeft()
734
+	mapx = mapx - 1
735
+	playerx = playerx - 32
736
+	
737
+	draw bitmap playerx, playery, "spieler_le","alpha", "Canvas"
738
+	if(mid$(levelline$(mapy), mapx+1,1) = " ") then
739
+		draw bitmap playerx+32, playery, "background","copy", "Canvas"
740
+	elseif(mid$(levelline$(mapy), mapx+1,1) = "t") then
741
+		draw bitmap playerx+32, playery, "target","copy", "Canvas"
742
+	elseif(mid$(levelline$(mapy), mapx+1,1) = "f") then
743
+		draw bitmap playerx+32, playery, "final","copy", "Canvas"
744
+	endif
745
+	return
746
+end sub
747
+
748
+sub WalkRight()
749
+	mapx = mapx + 1
750
+	playerx = playerx + 32
751
+	
752
+	draw bitmap playerx, playery, "spieler_ri","alpha", "Canvas"
753
+	
754
+	if(mid$(levelline$(mapy), mapx-1,1) = " ") then
755
+		draw bitmap playerx-32, playery, "background","copy", "Canvas"
756
+	elseif(mid$(levelline$(mapy), mapx-1,1) = "t") then
757
+		draw bitmap playerx-32, playery, "target","copy", "Canvas"
758
+	elseif(mid$(levelline$(mapy), mapx-1,1) = "f") then
759
+		draw bitmap playerx-32, playery, "final","copy", "Canvas"
760
+	endif
761
+	return
762
+end sub
763
+
764
+sub CheckFinished()
765
+	local i	
766
+	local w	
767
+	//print Punkte
768
+	for i = 1 to 12
769
+		if(instr(levelline$(i), "b")) then		
770
+			w=1			
771
+			if (w=1) then	
772
+		 		item_punkte=w*20		 		
773
+			endif
774
+		 return			 		
775
+		endif				
776
+	next i					
777
+	Punkte=Punkte+item_punkte
778
+	levelgewonnen=levelgewonnen+1
779
+	wait 0.1	
780
+	WINDOW SET Bildschirm$,"Minimize"
781
+
782
+	if (aktlevel=anzahl_level) then
783
+		bonus=maxi_leben*10
784
+			
785
+		endgame()		
786
+	else
787
+		aktlevel=aktlevel+1
788
+		keymsg$=" "
789
+		wait 0.1
790
+		keymsg$=" "
791
+		wait 0.1
792
+		next_Level(aktlevel)
793
+	endif		
794
+	Punkte=Punkte+item_punkte+levelgewonnen	
795
+	return
796
+end sub
797
+
798
+sub neueslevel(aktlevel)
799
+	//find fileload$	
800
+	//print aktlevel
801
+	fileload$=dir$+"/ground/brett.dat"
802
+	a=0
803
+	b=0
804
+	i=0
805
+	j=0
806
+	x=0
807
+	y=0	
808
+	punkte(Punkte)
809
+	icemapy=0
810
+	icemapx=0
811
+	levelladen(a,b,fileload$)
812
+	levelmalen(i,j,x,y)	
813
+end sub
814
+
815
+sub gleicheslevel(gleicheslevel)
816
+	//find fileload$	
817
+	fileload$=dir$+"/level"+str$(gleicheslevel)+".dat"
818
+	//print fileload$ 
819
+	a=0:b=0:i=0:j=0:x=0:y=0
820
+	levelladen(a,b,fileload$)
821
+	levelmalen(i,j,x,y)
822
+end sub
823
+
824
+sub levelladen(a,b,fileload$)
825
+	
826
+	auslesen=open(fileload$, "r")
827
+	while (not EOF(auslesen))
828
+	line input #auslesen b$
829
+	dim elements$(1)
830
+	numElements = split(b$, elements$(),";")
831
+	for a = 1 to numElements
832
+			b=b+1
833
+			dim levelline$(b)
834
+			levelline$(b) = elements$(a)
835
+			//print b
836
+	//print levelline$(b)
837
+	next a
838
+	wend
839
+	close(auslesen)
840
+end sub
841
+
842
+sub levelmalen(i,j,x,y)
843
+// Read in the demo level and show it
844
+//dim levelline$(12)
845
+
846
+for i=1 to level_i 
847
+	for j = 1 to level_j
848
+		switch(mid$(levelline$(i), j, 1))
849
+			//a weiss turm
850
+			//b weiss springer
851
+			//c weiss laeufer
852
+			//d weiss dame
853
+			//e weiss koenig
854
+			//f weiss bauer
855
+			//z schwarz Turm
856
+			//y schwarz springer
857
+			//x schwarz lauefer
858
+			//v schwarz dame
859
+			//w schwarz koenig
860
+			//u schwarz bauer
861
+			//Spielfeld
862
+			case "s"
863
+				draw bitmap x,y, "grau", "copy", "Canvas"
864
+				spielfeld$(j-1,i-1)="grau"
865
+			break
866
+			case "w"
867
+				draw bitmap x,y, "hellgelb", "copy", "Canvas"
868
+				spielfeld$(j-1,i-1)="hellgelb"
869
+			break
870
+			// Weisse Spielsteine
871
+			case "a"
872
+				draw bitmap x,y, "weiss_turm", "alpha", "Canvas"
873
+				spielsteine$(i-1,j-1)="wt"
874
+			break
875
+			case "b"
876
+				draw bitmap x,y, "weiss_springer", "alpha", "Canvas"
877
+				spielsteine$(i-1,j-1)="ws"
878
+			break		
879
+			case "c"	
880
+				spielsteine$(i-1,j-1)="wl"
881
+				draw bitmap x,y, "weiss_laeufer", "alpha", "Canvas"
882
+			break
883
+			case "d"
884
+				draw bitmap x,y, "weiss_dame", "alpha", "Canvas"
885
+				spielsteine$(i-1,j-1)="wd"
886
+			break
887
+			case "e"
888
+				draw bitmap x,y, "weiss_koenig", "alpha", "Canvas"
889
+				spielsteine$(i-1,j-1)="wk"
890
+			break
891
+			case "f"
892
+				draw bitmap x,y, "weiss_bauer", "alpha", "Canvas"
893
+				spielsteine$(i-1,j-1)="wb"
894
+			break
895
+			//Schwarze Spielsteine
896
+			case "z"
897
+				draw bitmap x,y, "schwarz_turm", "alpha", "Canvas"
898
+				spielsteine$(i-1,j-1)="st"
899
+			break
900
+			case "x"
901
+				draw bitmap x,y, "schwarz_springer", "alpha", "Canvas"
902
+				spielsteine$(i-1,j-1)="ss"
903
+			break		
904
+			case "y"	
905
+				spielsteine$(i-1,j-1)="sl"
906
+				draw bitmap x,y, "schwarz_laeufer", "alpha", "Canvas"
907
+			break
908
+			case "t"
909
+				draw bitmap x,y, "schwarz_dame", "alpha", "Canvas"
910
+				spielsteine$(i-1,j-1)="sd"
911
+			break
912
+			case "v"
913
+				draw bitmap x,y, "schwarz_koenig", "alpha", "Canvas"
914
+				spielsteine$(i-1,j-1)="sk"
915
+			break
916
+			case "u"
917
+				draw bitmap x,y, "schwarz_bauer", "alpha", "Canvas"
918
+				spielsteine$(i-1,j-1)="sb"
919
+			break				
920
+		end switch
921
+		x = x + Sfg
922
+	next j
923
+	x = 0
924
+	y = y + Sfg
925
+	print i
926
+			print j
927
+next i
928
+playerx = (mapx-1)*Sfg
929
+playery = (mapy-1)*Sfg
930
+monsterx = (icemapx-1)*Sfg
931
+monstery = (icemapy-1)*Sfg
932
+end sub
933
+
934
+
935
+
936
+sub start()
937
+	dim spielfeld$(7,7)
938
+	dim spielsteine$(7,7)
939
+	spieler=1
940
+	aktlevel=1
941
+	levelgewonnen=0
942
+	a=0:b=0
943
+	level=1	
944
+	dir$=prg_dir$+"/ground"	
945
+	fileload$=dir$+"/brett.dat"
946
+	gleicheslevel=0
947
+	levelladen(a,b,fileload$)
948
+	i=1:j=1:x=0:y=0
949
+	levelmalen(i,j,x,y)
950
+	fileload$=dir$+"/figuren.dat"
951
+	gleicheslevel=0
952
+	levelladen(a,b,fileload$)
953
+	i=1:j=1:x=0:y=0
954
+	levelmalen(i,j,x,y)
955
+end sub
956
+
957
+sub anzahl_level_abfragen()
958
+	//print dir$=prg_dir$+"/levels/"+level$	
959
+	
960
+	levels_zaehlen$=system$("find "+prg_dir$+"/levels/"+level$+"/level*.dat -maxdepth 1")
961
+	dim zeilen$(1)
962
+	//print levels_zaehlen$
963
+	numElements = split(levels_zaehlen$, zeilen$(),"\n")
964
+	//print numElements
965
+	bc=0
966
+	for abc = 1 to numElements 
967
+			bc=bc+1
968
+			dim levelnamen$(bc)
969
+			levelnamen$(bc) = zeilen$(abc)
970
+			//print "Bc"+str$(bc)
971
+	//print levelnamen$(bc)
972
+	next abc		
973
+	if (level$="Easy") then		
974
+		maxanzahl_level=10		
975
+		if (bc>maxanzahl_level) then		
976
+			anzahl_level=10			
977
+		else		
978
+				anzahl_level=bc-1
979
+		endif					
980
+	endif
981
+end sub
982
+
983
+rem ENDGAME
984
+sub endgame()	
985
+	window open ((screenWidth/2)-170), ((screenHeight/2)-180) to ((screenWidth/2)+170), ((screenHeight/2)+180), "Endgame", "Highscore"
986
+	window set  "Endgame", "MinimumTo", 360,320
987
+	window set  "Endgame", "MaximumTo", 360,320		
988
+	window set "Endgame", "look", "Bordered"	
989
+	draw set "Bgcolor", 0,0,0, "Endgame"		
990
+	stopp=1
991
+	err = draw image 0,20, Grafikverzeichnis$+winner$, "Endgame"	
992
+	TEXTCONTROL 25,240 TO 320,250, "Spielername", "", "Name", "Endgame" 
993
+	BUTTON 30,270 TO 320,290, "Speichern", "Save", "Endgame"
994
+	
995
+end sub
996
+
997
+
998
+sub Vorbereitung()
999
+
1000
+//Spielfeld	
1001
+	bitmap Sfg,Sfg, "hellgelb"
1002
+	err = draw image 0,0 to Sfg-1,Sfg-1, Grafikverzeichnis$+"spielfeld/weiss.png", "hellgelb"
1003
+	bitmap Sfg,Sfg, "grau"
1004
+	err = draw image 0,0 to Sfg-1,Sfg-1, Grafikverzeichnis$+"spielfeld/schwarz.png", "grau"
1005
+	bitmap Sfg,Sfg, "marker"
1006
+	err = draw image 0,0 to Sfg-1,Sfg-1, Grafikverzeichnis$+"spielfeld/marker.png", "marker"
1007
+//Spielfiguren
1008
+	bitmap Sfg,Sfg, "weiss_bauer"
1009
+	err = draw image 0,0 to Sfg-1,Sfg-1, Grafikverzeichnis$+"weiss/bauer.png", "weiss_bauer"
1010
+	bitmap Sfg,Sfg, "weiss_turm"
1011
+	err = draw image 0,0 to Sfg-1,Sfg-1, Grafikverzeichnis$+"weiss/turm.png", "weiss_turm"
1012
+	bitmap Sfg,Sfg, "weiss_springer"
1013
+	err = draw image 0,0 to Sfg-1,Sfg-1, Grafikverzeichnis$+"weiss/springer.png", "weiss_springer"
1014
+	bitmap Sfg,Sfg, "weiss_laeufer"
1015
+	err = draw image 0,0 to Sfg-1,Sfg-1, Grafikverzeichnis$+"weiss/laeufer.png", "weiss_laeufer"
1016
+	bitmap Sfg,Sfg, "weiss_dame"
1017
+	err = draw image 0,0 to Sfg-1,Sfg-1, Grafikverzeichnis$+"weiss/dame.png", "weiss_dame"
1018
+	bitmap Sfg,Sfg, "weiss_koenig"
1019
+	err = draw image 0,0 to Sfg-1,Sfg-1, Grafikverzeichnis$+"weiss/koenig.png", "weiss_koenig"
1020
+	bitmap Sfg,Sfg, "schwarz_bauer"
1021
+	err = draw image 0,0 to Sfg-1,Sfg-1, Grafikverzeichnis$+"schwarz/bauer.png", "schwarz_bauer"
1022
+	bitmap Sfg,Sfg, "schwarz_turm"
1023
+	err = draw image 0,0 to Sfg-1,Sfg-1, Grafikverzeichnis$+"schwarz/turm.png", "schwarz_turm"
1024
+	bitmap Sfg,Sfg, "schwarz_springer"
1025
+	err = draw image 0,0 to Sfg-1,Sfg-1, Grafikverzeichnis$+"schwarz/springer.png", "schwarz_springer"
1026
+	bitmap Sfg,Sfg, "schwarz_laeufer"
1027
+	err = draw image 0,0 to Sfg-1,Sfg-1, Grafikverzeichnis$+"schwarz/laeufer.png", "schwarz_laeufer"
1028
+	bitmap Sfg,Sfg, "schwarz_dame"
1029
+	err = draw image 0,0 to Sfg-1,Sfg-1, Grafikverzeichnis$+"schwarz/dame.png", "schwarz_dame"
1030
+	bitmap Sfg,Sfg, "schwarz_koenig"
1031
+	err = draw image 0,0 to Sfg-1,Sfg-1, Grafikverzeichnis$+"schwarz/koenig.png", "schwarz_koenig"
1032
+	
1033
+	
1034
+	bitmap Sfg,Sfg, "background"
1035
+	draw set "highcolor", 0,0,0, "background"
1036
+	draw rect 0,0 to Sfg-1,Sfg-1, "background"
1037
+	option set Bildschirm$, "focus", true
1038
+	canvas 0,0 to Sfg*10,Sfg*10, "Canvas", Bildschirm$
1039
+	//draw set "highcolor", 125,125,125, "Canvas"
1040
+	draw rect 0,0 to Breite_Views,384+Sfg, "Canvas"
1041
+	DRAW SET "HighColor",255,255,255,  "Canvas"	
1042
+	draw text (Sfg*1)-(Sfg/2)-4,Sfg*8+28, "A", "Canvas"
1043
+	draw text (Sfg*2)-(Sfg/2)-4,Sfg*8+28, "B", "Canvas"	
1044
+	draw text (Sfg*3)-(Sfg/2)-4,Sfg*8+28, "C", "Canvas"
1045
+	draw text (Sfg*4)-(Sfg/2)-4,Sfg*8+28, "D", "Canvas"
1046
+	draw text (Sfg*5)-(Sfg/2)-4,Sfg*8+28, "E", "Canvas"
1047
+	draw text (Sfg*6)-(Sfg/2)-4,Sfg*8+28, "F", "Canvas"
1048
+	draw text (Sfg*7)-(Sfg/2)-4,Sfg*8+28, "G", "Canvas"
1049
+	draw text (Sfg*8)-(Sfg/2)-4,Sfg*8+28, "H", "Canvas"
1050
+	c=(Sfg/2)+4
1051
+	for u=1 to 8
1052
+		draw text (Sfg*9)-(Sfg/2),c, str$(u), "Canvas"
1053
+		c=c+Sfg
1054
+	next u
1055
+	columnbox 450,0 to Breite_Views-30, Hoehe_Views, "zug", 2, "no-border", Bildschirm$ 
1056
+	COLUMNBOX COLUMN "zug", "Zug", 1, 40, 40, 40, "align-center"
1057
+	COLUMNBOX COLUMN "zug", "Spieler1", 2, 75, 75, 75, "align-center"
1058
+	COLUMNBOX COLUMN "zug", "Spieler2", 3, 75, 75, 75, "align-center"
1059
+	anzahl_level_abfragen()
1060
+	start()	
1061
+end sub
1062
+
1063
+//REM Feld fuer schachfeld definieren
1064
+sub copyBitmap()
1065
+		
1066
+	dim waagerecht$(8)
1067
+	waagerecht$(0)="a"
1068
+	waagerecht$(1)="b"
1069
+	waagerecht$(2)="c"
1070
+	waagerecht$(3)="d"
1071
+	waagerecht$(4)="e"
1072
+	waagerecht$(5)="f"
1073
+	waagerecht$(6)="g"
1074
+	waagerecht$(7)="h"
1075
+	yw=val(mid$(feld$,2,1))
1076
+	for i=0 to yw
1077
+		ausgabe$=waagerecht$(i)		
1078
+	next i	
1079
+		spielstein$=spielsteine$(val(mid$(feld$,1,1)),val(mid$(feld$,2,1)))
1080
+		ausgabe1$=spielstein$+":"+ausgabe$+str$(val(mid$(feld$,1,1))+1)
1081
+		ausgabe2$=""
1082
+	ya=val(mid$(feld$,1,1))
1083
+	xa=val(mid$(feld$,2,1))
1084
+	
1085
+	y=val(mid$(feld$,1,1))*Sfg
1086
+	x=val(mid$(feld$,2,1))*Sfg	
1087
+	draw bitmap x,y, "marker", "alpha", "Canvas"
1088
+	wait 2
1089
+	BITMAP GET x+6,y+6 to x+Sfg-6, y+Sfg-6,"spielfigur", "Canvas"
1090
+	//print "spielfeld"
1091
+	//print spielfeld$(xa,ya)
1092
+	if (spielfeld$(xa,ya)="grau") then	
1093
+		draw bitmap x,y, "grau", "copy", "Canvas"
1094
+	elseif ( spielfeld$(xa,ya)="hellgelb")
1095
+		draw bitmap x,y, "hellgelb", "copy", "Canvas"
1096
+	endif
1097
+	quelle=val(mid$(feld$,1,1))
1098
+	if (spielstein$="wb" and quelle=1) then
1099
+		bitmap get x,y+Sfg to x+Sfg, y+(Sfg*2), "m1", "Canvas"
1100
+		bitmap get x,y+(Sfg*2) to x+Sfg, y+(Sfg*3), "m2", "Canvas"
1101
+		can_be_m1y=y+Sfg
1102
+		can_be_m2y=(y+Sfg*2)
1103
+		draw bitmap x,y+Sfg, "marker", "alpha", "Canvas"
1104
+		draw bitmap x,y+(Sfg*2), "marker", "alpha", "Canvas"
1105
+	elseif (spielstein$="wb" and quelle>1 and quelle<7) then
1106
+		bitmap get x,y+Sfg to x+Sfg, y+(Sfg*2), "m4", "Canvas"
1107
+		can_be_m3y=y+Sfg
1108
+		draw bitmap x,y+Sfg, "marker", "alpha", "Canvas"
1109
+	endif
1110
+	if (spielstein$="wl") then
1111
+		bitmap get x,y+Sfg to x+Sfg, y+(Sfg*2), "m1", "Canvas"
1112
+		print quelle
1113
+		for u=1 to 7-quelle
1114
+			//can_be_m1y=y+Sfg
1115
+			can_be_m2y=(y+Sfg*u)
1116
+			can_be_m3y=(y-Sfg*u)
1117
+			//can_be_m1x=x+Sfg
1118
+			can_be_m2x=(x+Sfg*u)
1119
+			can_be_m3x=(x-Sfg*u)
1120
+		draw bitmap can_be_m2x,can_be_m2y, "marker", "alpha", "Canvas"
1121
+		draw bitmap can_be_m3x,can_be_m2y, "marker", "alpha", "Canvas"
1122
+		draw bitmap can_be_m2x,can_be_m3y, "marker", "alpha", "Canvas"
1123
+		draw bitmap can_be_m3x,can_be_m3y, "marker", "alpha", "Canvas"
1124
+		print u
1125
+		next u
1126
+	endif
1127
+	
1128
+	zuege(ausgabe1$,ausgabe2$,spieler)
1129
+return
1130
+end sub
1131
+sub pasteBitmap()
1132
+	
1133
+	dim waagerecht$(8)
1134
+	waagerecht$(0)="a"
1135
+	waagerecht$(1)="b"
1136
+	waagerecht$(2)="c"
1137
+	waagerecht$(3)="d"
1138
+	waagerecht$(4)="e"
1139
+	waagerecht$(5)="f"
1140
+	waagerecht$(6)="g"
1141
+	waagerecht$(7)="h"
1142
+	yw=val(mid$(feld$,2,1))
1143
+	for i=0 to yw
1144
+		print "Buchstaben"
1145
+		ausgabe$=waagerecht$(i)
1146
+	next i	
1147
+	ausgabe2$=ausgabe$+str$(val(mid$(feld$,1,1))+1)
1148
+	spielsteine$(val(mid$(feld$,1,1)),val(mid$(feld$,2,1)))=spielstein$
1149
+	ausgabe1$=ausgabe1$
1150
+	
1151
+	
1152
+	y=val(mid$(feld$,1,1))*Sfg
1153
+	print "y"+str$(y)
1154
+	
1155
+	x=val(mid$(feld$,2,1))*Sfg
1156
+	print "x"+str$(x)
1157
+	print quelle
1158
+	if (spielstein$="wb" and quelle=1) then
1159
+		draw bitmap x,can_be_m1y, "m1", "copy", "Canvas"
1160
+		draw bitmap x,can_be_m2y, "m2", "copy", "Canvas"
1161
+	elseif (spielstein$="wb" and quelle>1 and quelle<7) then
1162
+		draw bitmap x,can_be_m3y, "m4", "copy", "Canvas"
1163
+	endif
1164
+	draw bitmap x+6,y+6, "spielfigur", "alpha", "Canvas"
1165
+	BITMAP REMOVE "spielfigur"
1166
+	zuege(ausgabe1$,ausgabe2$,spieler)
1167
+	return
1168
+end sub
1169
+
1170
+sub zuege(ausgabe1$,ausgabe2$,spieler)
1171
+	print "spieler"+str$(spieler)
1172
+	n=COLUMNBOX COUNT "zug"	
1173
+	if (spieler=1 and teilzug=1) then		
1174
+		COLUMNBOX ADD "zug", 1, n+1, 15, str$(n+1)
1175
+		COLUMNBOX ADD "zug", 2, n+1, 15, ausgabe1$+"-"+ausgabe2$
1176
+		spieler=2
1177
+	elseif (spieler=2 and teilzug=1) then
1178
+		COLUMNBOX ADD "zug", 3, n, 15, ausgabe1$+"-"+ausgabe2$
1179
+		spieler=1
1180
+	endif
1181
+	ausgabe1$=""
1182
+		ausgabe2$=""
1183
+	return  
1184
+end sub
1185
+
1186
+
1187
+sub hilfe()
1188
+	window open ((screenWidth/2)-230), ((screenHeight/2)-235) to ((screenWidth/2)+230), ((screenHeight/2)+235), "Hilfe", "Help"
1189
+	window set  "Hilfe", "MinimumTo", 460,470
1190
+	window set  "Hilfe", "MaximumTo",  460,470	
1191
+	window set "Hilfe", "look", "Bordered"		
1192
+	draw set  "Bgcolor",0,0,0,"Hilfe"	
1193
+	DRAW SET "HighColor",222,222,222,  "Hilfe"	
1194
+	Draw Set "lowColor",0,0,0, "Hilfe"	
1195
+	draw text 20,20 ,"Introduction the Game", "Hilfe"
1196
+	draw text 20,40 ,"Goal of this game, was to place the items on the", "Hilfe"	
1197
+	draw text 20,55  ,"target, but be careful that you not catch by the NP figure. ", "Hilfe"
1198
+	draw text 20,70 ,"Here you can see for example the available moves in the game.", "Hilfe"
1199
+	//DRAW BITMAP 20, 85 TO 40,90, Grafikverzeichnis$+"left.png", "Alpha", "Hilfe"				
1200
+
1201
+	err = draw image 20,90, Grafikverzeichnis$+"left.png", "Hilfe"
1202
+	err = draw image 20,120, Grafikverzeichnis$+"right.png", "Hilfe"
1203
+	err = draw image 20,150, Grafikverzeichnis$+"up.png", "Hilfe"
1204
+	err = draw image 20,180, Grafikverzeichnis$+"down.png", "Hilfe"
1205
+	err = draw image 20,210, Grafikverzeichnis$+"strg.png", "Hilfe"
1206
+	err = draw image 20,240, Grafikverzeichnis$+"shift.png", "Hilfe"
1207
+	err = draw image 20,270, Grafikverzeichnis$+"esc.png", "Hilfe"
1208
+	err = draw image 20,300, Grafikverzeichnis$+"n.png", "Hilfe"
1209
+	
1210
+	draw text 80,110 ,"Left: means, that the player walk left", "Hilfe"
1211
+	draw text 80,140 ,"Right: means, that the player walk right", "Hilfe"
1212
+	draw text 80,170 ,"Up: means, that the player walk up", "Hilfe"
1213
+	draw text 80,200,"Down: means, that the player walk down", "Hilfe"
1214
+	draw text 80,225 ,"Ctrl (Strg) + left: Item and your figure moves one field", "Hilfe"	
1215
+	draw text 80,240 ,"when its free to the left.", "Hilfe"
1216
+	draw text 80,260 ,"Shift + left: Push the Item to the next field, when its free", "Hilfe"	
1217
+	draw text 80,290,"ESC: Terminates the Programm", "Hilfe"
1218
+	draw text 80,320 ,"n: new Chance, but only you have one live left", "Hilfe"	
1219
+
1220
+
1221
+	draw text 20,365 ,"Your Points will be generated by a fix value per level and", "Hilfe"
1222
+	draw text 20,380 ,"the fix value per live minus our moves.", "Hilfe"
1223
+	draw text 20,395 ,"So for a good Result in the highscore table, don't make", "Hilfe"	
1224
+	draw text 20,410 ,"many moves and don't let you catch.", "Hilfe"	
1225
+
1226
+	BUTTON 20, 430 TO 120,450, "Zurueck", "Back", "Hilfe"	
1227
+end sub
1228
+sub AboutWindow()
1229
+ 	window open ((screenWidth/2)-200), ((screenHeight/2)-150) to ((screenWidth/2)+200), ((screenHeight/2)+150), "View_About", "About"
1230
+  	window set  "View_About", "MinimumTo", 400,300
1231
+  	window set  "View_About", "MaximumTo", 400,300
1232
+  	window set "View_About", "flags", "not-resizable, Not-Zoomable"  	
1233
+	window set "View_About", "look", "Bordered"		
1234
+	draw set  "Bgcolor",0,0,0,"View_About"	
1235
+	DRAW SET "HighColor",222,222,222,  "View_About"
1236
+	Draw Set "lowColor",0,0,0, "View_About"	
1237
+  	
1238
+  	DRAW SET "system-bold", "View_About"
1239
+  	DRAW TEXT 10,30, "BeSly Software Solutions", "View_About"
1240
+  	VIEW 0,50 TO 400,300, "View_About_Info", "View_About"
1241
+  	DRAW LINE 0,1 TO 400,1, "View_About_Info" 
1242
+  	 
1243
+ 	VIEW 0,2 TO 150,165, "View_About_Title", "View_About_Info"
1244
+  	//DRAW SET "BGColor", 255,255,255, "View_About_Title"
1245
+  	
1246
+  	draw set  "Bgcolor",0,0,0,"View_About_Title"	
1247
+	DRAW SET "HighColor",222,222,222,  "View_About_Title"
1248
+	Draw Set "lowColor",0,0,0, "View_About_Title"	
1249
+  	DRAW TEXT 10,30, "Name:", "View_About_Title"
1250
+  	DRAW TEXT 10,50, "Version / Build:", "View_About_Title"
1251
+  	DRAW TEXT 10,70, "Developers:", "View_About_Title"
1252
+  	DRAW TEXT 10,90, "Graphics:", "View_About_Title"
1253
+  	DRAW TEXT 10,110, "Levels:", "View_About_Title"
1254
+  	DRAW TEXT 10,130, "Contact:", "View_About_Title"
1255
+  	DRAW TEXT 10,150, "Website:", "View_About_Title"
1256
+  	//DRAW Text 10,170, "Thanks", "View_About_Title"
1257
+  	
1258
+  	draw set  "Bgcolor",0,0,0,"View_About_Info"	
1259
+	DRAW SET "HighColor",222,222,222,  "View_About_Info"
1260
+	Draw Set "lowColor",0,0,0, "View_About_Info"	
1261
+	
1262
+  	VIEW 170,2 TO 400,165, "View_About_Entry", "View_About_Info"
1263
+  	//DRAW SET "BGColor", 255,255,255, "View_About_Entry"
1264
+  	draw set  "Bgcolor",0,0,0,"View_About_Entry"	
1265
+	DRAW SET "HighColor",222,222,222,  "View_About_Entry"
1266
+	Draw Set "lowColor",0,0,0, "View_About_Entry"	
1267
+  	DRAW TEXT 10,30, "Kiss the King", "View_About_Entry"
1268
+  	DRAW TEXT 10,50, "0.1 / 22.04.2014", "View_About_Entry"
1269
+  	DRAW TEXT 10,70, "Lorglas", "View_About_Entry"
1270
+  	DRAW TEXT 10,90, "Lorglas",  "View_About_Entry"
1271
+  	DRAW TEXT 10,110, "Lorglas",  "View_About_Entry"
1272
+  	TEXTURL 10,122, "email", "webmaster@besly.de", "webmaster@besly.de", "View_About_Entry"  	
1273
+  	TEXTURL 10,142, "website", "http://www.mittilgart.de", "http://www.mittilgart.de", "View_About_Entry"   	
1274
+  	//DRAW TEXT 60,185, "Thanks for Lelldorin and Jan for the inspiration", "View_About_Info"
1275
+  	BUTTON 150,200 TO 250,220, "AboutClose", "OK", "View_About_Info"
1276
+end sub
1277
+
1278
+REM HIGHSCORE
1279
+sub highscore_speichern(Auswahl_Spielfigur$,spielername$,Punkte$,level$,level_nr$,schritte$,lives$)
1280
+	
1281
+	Auswahl_Spielfigur1$=left$(Auswahl_Spielfigur$, len(Auswahl_Spielfigur$)-4)+"1.png"
1282
+	//print  "Auswahl_Spielfigur1$"+Auswahl_Spielfigur1$
1283
+	filewrite$=spielstand_dir$+"/"+level$+"_highscore.csv"
1284
+	handle=1
1285
+	handle = open(filewrite$, "a")		
1286
+		print #handle Auswahl_Spielfigur1$+";"+Punkte$+";"+spielername$+";"+level$+";"+level_nr$+";"+schritte$+";"+lives$		
1287
+
1288
+	close(handle)
1289
+	output$=system$("sort -nrk2.1 -o "+ spielstand_dir$+"/"+level$+"_highscore.csv"+" "+spielstand_dir$+"/"+level$+"_highscore.csv")	
1290
+	//Gesamt Spielstand 	
1291
+	filewrite$=spielstand_dir$+"/"+"gesamt_highscore.csv"
1292
+	handle=1
1293
+	handle = open(filewrite$, "a")		
1294
+		print #handle Auswahl_Spielfigur1$+";"+Punkte$+";"+spielername$+";"+level$+";"+level_nr$+";"+schritte$+";"+lives$		
1295
+
1296
+	close(handle)
1297
+	output$=system$("sort -nro"+ spielstand_dir$+"/"+"gesamt_highscore.csv"+" "+spielstand_dir$+"/"+"gesamt_highscore.csv")
1298
+end sub
1299
+
1300
+sub highscore(level$,initial)
1301
+	if (initial=1) then			
1302
+		window open ((screenWidth/2)-320), ((screenHeight/2)-250) to ((screenWidth/2)+320), ((screenHeight/2)+250), "hgscore", "Highscore"
1303
+		window set "hgscore", "look", "No-Border"	
1304
+		window set  "hgscore", "MinimumTo", 640,500
1305
+		window set  "hgscore", "MaximumTo", 640,500	
1306
+		draw set "Bgcolor", 0,0,0, "hgscore"		
1307
+		x1=100		
1308
+		x2=x1+460		
1309
+		y1=50		
1310
+		y2=y1+310		
1311
+		COLUMNBOX x1,y1 TO x2,y2, "Highscore", 0, "no-border", "hgscore"	
1312
+	elseif (initial=0) then	
1313
+		COLUMNBOX CLEAR "Highscore"
1314
+	endif
1315
+	COLUMNBOX COLUMN "Highscore","", 1, 33, 33, 33, "align-left"
1316
+	COLUMNBOX COLUMN "Highscore","Points", 2, 57, 57, 57, "align-left"	
1317
+	COLUMNBOX COLUMN "Highscore","Playername", 3, 125, 125, 125, "align-left"
1318
+	COLUMNBOX COLUMN "Highscore","Level", 4, 60,60,60, "align-left"
1319
+	COLUMNBOX COLUMN "Highscore","L-NR", 5, 50, 50, 50, "align-left"
1320
+	COLUMNBOX COLUMN "Highscore","Moves", 6, 60,60,60, "align-left"	
1321
+	COLUMNBOX COLUMN "Highscore","Lives", 7, 54, 54, 54, "align-left"	
1322
+	BUTTON x1,y1+360 TO x1+60,y1+380, "ok", "OK", "hgscore"	
1323
+	BUTTON x1+100,y1+360 TO x1+160,y1+380, "HGEasy", "Easy", "hgscore"
1324
+	BUTTON x1+200,y1+360 TO x1+260,y1+380, "HGMiddle", "Middle", "hgscore"
1325
+	BUTTON x1+300,y1+360 TO x1+360,y1+380, "HGHeavy", "Heavy", "hgscore"	
1326
+	BUTTON x1+400,y1+360 TO x1+460,y1+380, "HGReset", "Reset", "hgscore"
1327
+	highscore_laden(level$,initial)
1328
+end sub
1329
+
1330
+sub highscore_laden(level$,initial)
1331
+	
1332
+	local x
1333
+	local d
1334
+	local i
1335
+	numElements=0
1336
+	x=0:f=0:i=0
1337
+					
1338
+	spielstandload$=spielstand_dir$+"/"+level$+"_highscore.csv"	
1339
+	auslesen_spielstand=open(spielstandload$, "r")
1340
+	
1341
+	while (not EOF(auslesen_spielstand))
1342
+		line input #auslesen_spielstand spielst_b$
1343
+		dim elements$(1)
1344
+		numElements = split(spielst_b$, elements$(),";")
1345
+		
1346
+		for i = 1 to numElements
1347
+			x=x+1
1348
+			dim spielst_d$(x)
1349
+			spielst_d$(x) = elements$(i)
1350
+			
1351
+		next i
1352
+	wend
1353
+	close(auslesen_spielstand)
1354
+			
1355
+	anzahlspalten=numElements	
1356
+	anzahlzeilen=x/anzahlspalten
1357
+	//print anzahlspalten
1358
+	if (anzahlspalten>1) then	
1359
+		gg=0	
1360
+		for sa = 1 to anzahlzeilen				
1361
+			for sb = 1 to anzahlspalten		
1362
+				gg=gg+1				
1363
+				if (instr(spielst_d$(gg),".png")) then
1364
+				//"__Icon__="+dir_li$+"/"+dateiname_ohne_li$
1365
+					
1366
+					COLUMNBOX ADD "Highscore", sb, sa, 32, "__Icon__="+Grafikverzeichnis$+spielst_d$(gg)
1367
+				else
1368
+					COLUMNBOX ADD "Highscore", sb, sa, 32, spielst_d$(gg)
1369
+				endif
1370
+				
1371
+			next sb					
1372
+		next sa		
1373
+	else
1374
+		//print "highscore"
1375
+		COLUMNBOX ADD "Highscore", 1, 1, 20, "Keine Eintr├Ąge"
1376
+	endif
1377
+end sub
1378
+
1379
+sub highscore_reset(level$)	
1380
+	filewrite$=spielstand_dir$+"/"+level$+"_highscore.csv"
1381
+	handle=1
1382
+	handle = open(filewrite$, "w")		
1383
+		//print #handle ""
1384
+	close(handle)	
1385
+	initial=0	
1386
+	highscore_laden(level$,initial)	
1387
+end sub
1388
+