Browse code

Revert "Revert "Be_canny_or_be_a_Donkey added""

This reverts commit 45a1849f7c38c5900c8bc8d27227277da1cde172.

Lorenz Glaser authored onWed/Sep/2020 18:0:nd
Showing177 changed files
1 1
new file mode 100755
2 2
Binary files /dev/null and b/Be_canny_or_be_a_Donkey/Be_Canny_or_be_a_Donkey differ
3 3
new file mode 100644
... ...
@@ -0,0 +1,1879 @@
1
+#!/boot/home/config/bin/yab
2
+#!yab
3
+doc Thanks to Jan__64
4
+doc Diese Programm hat als Basis Sokoban. Sokoban wurde von Lorglas mit der Erlaubnis von Jan__64 umgeschrieben und erweitert
5
+doc Danke auch an Lelldorin bei der BUG-Behebung  
6
+	
7
+	screenWidth = peek("desktopwidth")
8
+	screenHeight = peek("desktopheight")
9
+halfscreen_width=screenWidth/2
10
+halfscreen_height=screenHeight/2
11
+
12
+// Initialize the window, load the sprites and put up the canvas
13
+// Startvariablen
14
+
15
+//if(peek("isbound")) then
16
+//	prg_dir$=peek$("directory")	
17
+//else	
18
+	prg_dir$=system$("pwd")	
19
+	prg_dir$=left$(prg_dir$, len(prg_dir$)-1)		
20
+//endif
21
+
22
+prgstart(stopp)
23
+
24
+sub prgstart(stopp)	
25
+
26
+//game_dir$="/boot/home/.besly/be_canny_or_be_donkey"
27
+game_dir$="/Share/Projekte/yab_hpkg/Be_canny_or_be_a_Donkey"
28
+spielstand_dir$=game_dir$+"/stand"	
29
+programmstart=1
30
+if(IfExists(spielstand_dir$)) then
31
+	if(IfExists(spielstand_dir$+"/Easy_highscore.csv")) then
32
+	else
33
+		highscore_reset("Easy",programmstart)
34
+	endif
35
+	if(IfExists(spielstand_dir$+"/Heavy_highscore.csv")) then
36
+	else
37
+		highscore_reset("Heavy",programmstart)
38
+	endif
39
+	if(IfExists(spielstand_dir$+"/Middle_highscore.csv")) then
40
+	else
41
+		highscore_reset("Middle",programmstart)
42
+	endif
43
+	if(IfExists(spielstand_dir$+"/gesamt_highscore.csv")) then
44
+	else
45
+		highscore_reset("gesamt",programmstart)
46
+	endif
47
+else
48
+	output$=system$("mkdir -p "+spielstand_dir$)	
49
+	highscore_reset("Easy",programmstart)
50
+	highscore_reset("Heavy",programmstart)
51
+	highscore_reset("Middle",programmstart)
52
+	highscore_reset("gesamt")
53
+endif
54
+
55
+
56
+Grafikverzeichnis$=prg_dir$+"/img/"
57
+Bildschirm$="Win"
58
+Breite_Views=640
59
+Hoehe_Views=600
60
+stopp=1
61
+
62
+window open (halfscreen_width-320),(halfscreen_height-250) to  (halfscreen_width+320),(halfscreen_height+250), Bildschirm$, "Canny or Donkey"
63
+window set Bildschirm$, "flags", "not-zoomable, not-h-resizable, not-v-resizable"
64
+
65
+//unpack_level$=system$("unzip -n /boot/system/apps/Be_Canny_or_be_Donkey/levels.zip -d "+game_dir$+" 2>&1")
66
+//error_message=instr(unpack_level$,"cannot")
67
+
68
+if (error_message) then
69
+	alert "Please reinstall the program","OK", "none"	
70
+	window close Bildschirm$
71
+endif
72
+
73
+
74
+programmview$="programmview"
75
+STACKVIEW 0,0 TO Breite_Views,Hoehe_Views, programmview$, 2, Bildschirm$
76
+
77
+
78
+zweiter_view()
79
+
80
+abfragen()
81
+
82
+end sub
83
+sub zweiter_view()
84
+view 0,0 to Breite_Views,500, "Startbild", "programmview1"
85
+draw set "BGcolor", 0,0,0, "Startbild"
86
+
87
+err = draw image 35,30, Grafikverzeichnis$+"Startbild.png", "Startbild"
88
+CHECKBOX IMAGE 50,250 , "Spielfigur1", Grafikverzeichnis$+"baer_pressed.png" , Grafikverzeichnis$+"baer.png",Grafikverzeichnis$+" baer.png",Grafikverzeichnis$+" baer.png", true, "Startbild"
89
+CHECKBOX IMAGE 200,250 , "Spielfigur2", Grafikverzeichnis$+"hund_pressed.png", Grafikverzeichnis$+"hund.png" ,"","", false, "Startbild"
90
+CHECKBOX IMAGE 350,250 , "Spielfigur3", Grafikverzeichnis$+"player_pressed.png", Grafikverzeichnis$+"player.png" ,"","", false, "Startbild"
91
+CHECKBOX IMAGE 500,250 , "Spielfigur4", Grafikverzeichnis$+"hase_pressed.png", Grafikverzeichnis$+"hase.png" ,"","", false, "Startbild"
92
+
93
+BUTTON 20,420 TO 120,440, "Easy", "Easy", "Startbild"	
94
+BUTTON 140,420 TO 240,440, "Middle", "Middle", "Startbild"	
95
+BUTTON 260,420 TO 360,440, "Heavy", "Heavy", "Startbild"
96
+BUTTON 380,420 TO 480,440, "Highscore", "Highscore", "Startbild"	
97
+BUTTON 500,420 TO 600,440, "Hilfe", "Help", "Startbild"	
98
+BUTTON 500,460 TO 600,480, "About", "About", "Startbild"	
99
+OPTION SET "Easy", "Visible", false
100
+OPTION SET "Middle", "Visible", false
101
+OPTION SET "Heavy", "Visible", false
102
+
103
+	view 0,0 to Breite_Views,Hoehe_Views, "hgscore", "programmview2"
104
+		draw set "Bgcolor", 0,0,0, "hgscore"		
105
+		x1=100		
106
+		x2=x1+460		
107
+		y1=50		
108
+		y2=y1+310		
109
+		COLUMNBOX x1,y1 TO x2,y2, "Highscore", 0, "no-border", "hgscore"	
110
+end sub
111
+
112
+sub abfragen()
113
+dim msg$(1)
114
+dim part$(1)
115
+dim mouse$(1)
116
+dim ViewMouse$(1)
117
+inloop=1
118
+schritte=0				
119
+		
120
+while(inloop)
121
+	//print "stopp"+str$(stopp)
122
+	if (stopp=1) then		
123
+		keymsg$="enter"			
124
+	else
125
+		
126
+		if (endgame=1) then	
127
+			stopp=1
128
+			exit		
129
+		else
130
+			keymsg$ = keyboard message$(Bildschirm$)
131
+		endif
132
+	endif
133
+	if(keymsg$<>"" and keymsg$<>old_keymsg$) then 
134
+		old_keymsg$ = keymsg$			
135
+	endif	
136
+	
137
+	if (keymsg$<>"")	then	
138
+		If (stopp=1) then		
139
+		else
140
+			Punkte=Punkte-schritte			
141
+			player_moves=player_moves+schritte
142
+			if (Punkte<0) then			
143
+				Punkte=0				
144
+			endif			
145
+			punkte(Punkte)		
146
+		endif	
147
+	endif	
148
+	
149
+	switch(keymsg$)
150
+		case "esc"
151
+			inloop=0
152
+		break			
153
+		case "n"
154
+			if (maxi_leben>0) then
155
+				maxi_leben=maxi_leben-1
156
+				Leben(maxi_leben)
157
+				gleicheslevel=aktlevel	
158
+				gleicheslevel(gleicheslevel)					
159
+				stopp=0				
160
+			elseif (maxi_leben=0) then			
161
+				stopp=1		
162
+					
163
+			endif						
164
+		break
165
+		case "q"
166
+				aktlevel=aktlevel+1
167
+				punkte(levelgewonnen)
168
+				neueslevel(aktlevel)										
169
+		break
170
+			
171
+		//case "e"	
172
+			//endgame()									
173
+		//break	
174
+		case "7"
175
+		case "home"
176
+			if(instr(" t", mid$(levelline$(mapy-1), mapx-1, 1))) then
177
+				// soundplay "base.wav", false
178
+				Walkleftandup()				
179
+				schritte=1			
180
+			elseif(instr("bf", mid$(levelline$(mapy-1), mapx-1, 1)) and instr(" t", mid$(levelline$(mapy+2), mapx,1))) then
181
+				//PushDown()
182
+			endif
183
+			sleep 0.05			
184
+		break		
185
+		case "1"
186
+		case "end"
187
+			if(instr(" t", mid$(levelline$(mapy+1), mapx-1, 1))) then
188
+				// soundplay "base.wav", false
189
+				Walkleftanddown()				
190
+				schritte=1
191
+			elseif(instr("bf", mid$(levelline$(mapy-1), mapx-1, 1)) and instr(" t", mid$(levelline$(mapy+2), mapx,1))) then
192
+				//PushDown()
193
+			endif
194
+			sleep 0.05			
195
+		break		
196
+		case "3"
197
+		case "pagedown"
198
+			if(instr(" t", mid$(levelline$(mapy+1), mapx+1, 1))) then
199
+				// soundplay "base.wav", false
200
+				Walkrightanddown()				
201
+				schritte=1
202
+			elseif(instr("bf", mid$(levelline$(mapy-1), mapx+1, 1)) and instr(" t", mid$(levelline$(mapy+2), mapx,1))) then
203
+				//PushDown()
204
+			endif
205
+			sleep 0.05			
206
+		break		
207
+		case "9"
208
+		case "pageup"
209
+			if(instr(" t", mid$(levelline$(mapy-1), mapx+1, 1))) then
210
+				// soundplay "base.wav", false
211
+				Walkrightandup()				
212
+				schritte=1
213
+			elseif(instr("bf", mid$(levelline$(mapy-1), mapx+1, 1)) and instr(" t", mid$(levelline$(mapy+2), mapx,1))) then
214
+				//PushDown()
215
+			endif
216
+			sleep 0.05			
217
+		break		
218
+		case "2"			
219
+		case "down"
220
+			if(instr(" t", mid$(levelline$(mapy+1), mapx, 1))) then
221
+				// soundplay "base.wav", false
222
+				WalkDown()				
223
+				schritte=1
224
+			elseif(instr("bf", mid$(levelline$(mapy+1), mapx, 1)) and instr(" t", mid$(levelline$(mapy+2), mapx,1))) then
225
+				PushDown()
226
+			endif
227
+			sleep 0.05
228
+			
229
+		break		
230
+		case "8"	
231
+		case "up"
232
+			if(instr(" t", mid$(levelline$(mapy-1), mapx, 1))) then
233
+				// soundplay "base.wav", false
234
+				WalkUp()				
235
+				schritte=1
236
+			elseif(instr("bf", mid$(levelline$(mapy-1), mapx, 1)) and instr(" t", mid$(levelline$(mapy-2), mapx,1))) then
237
+				PushUp()
238
+			endif
239
+			sleep 0.05
240
+		break		
241
+		case "6"	
242
+		case "left"
243
+			if(instr(" t", mid$(levelline$(mapy), mapx-1, 1))) then
244
+				// soundplay "base.wav", false
245
+				WalkLeft()				
246
+				schritte=1
247
+			elseif(instr("bf", mid$(levelline$(mapy), mapx-1, 1)) and instr(" t", mid$(levelline$(mapy), mapx-2,1))) then
248
+				PushLeft()
249
+			endif
250
+			sleep 0.05
251
+		break		
252
+		case "4"	
253
+		case "right"
254
+			if(instr(" t", mid$(levelline$(mapy), mapx+1, 1))) then
255
+				// soundplay "base.wav", false
256
+				WalkRight()				
257
+				schritte=1
258
+			elseif(instr("bf", mid$(levelline$(mapy), mapx+1, 1)) and instr(" t", mid$(levelline$(mapy), mapx+2,1))) then
259
+				PushRight()
260
+			endif
261
+			sleep 0.05
262
+		break		
263
+		case "shift-6"	
264
+		case "shift-right"
265
+			if(instr(" t", mid$(levelline$(mapy), mapx+1, 1))) then
266
+				// soundplay "base.wav", false
267
+				//WalkRight()
268
+			elseif(instr("bf", mid$(levelline$(mapy), mapx+1,1)) and instr(" t", mid$(levelline$(mapy), mapx+2,1))) then
269
+				//print mid$(levelline$(mapy), mapx+1,1)
270
+				//print mid$(levelline$(mapy), mapx+2,1) 
271
+				PushShiftRight()
272
+			endif
273
+			sleep 0.05
274
+		break		
275
+		case "shift-4"	
276
+		case "shift-left"
277
+			if(instr(" t", mid$(levelline$(mapy), mapx-1, 1))) then
278
+				// soundplay "base.wav", false
279
+				//WalkLeft()
280
+			elseif(instr("bf", mid$(levelline$(mapy), mapx-1, 1)) and instr(" t", mid$(levelline$(mapy), mapx-2,1))) then
281
+				PushShiftLeft()
282
+			endif
283
+			sleep 0.05
284
+		break		
285
+		case "shift-2"			
286
+		case "shift-down"
287
+			if(instr(" t", mid$(levelline$(mapy+1), mapx, 1))) then
288
+				// soundplay "base.wav", false
289
+				//WalkDown()
290
+			elseif(instr("bf", mid$(levelline$(mapy+1), mapx, 1)) and instr(" t", mid$(levelline$(mapy+2), mapx,1))) then
291
+				PushShiftDown()
292
+			endif
293
+			sleep 0.05
294
+		break		
295
+		case "shift-8"	
296
+		case "shift-up"
297
+			if(instr(" t", mid$(levelline$(mapy-1), mapx, 1))) then
298
+				// soundplay "base.wav", false
299
+				//WalkUp()
300
+			elseif(instr("bf", mid$(levelline$(mapy-1), mapx, 1)) and instr(" t", mid$(levelline$(mapy-2), mapx,1))) then
301
+				PushShiftUp()
302
+			endif
303
+			sleep 0.05
304
+		break		
305
+		case "ctrl-2"	
306
+		case "ctrl-down"
307
+			if(instr("bf", mid$(levelline$(mapy-1), mapx, 1)) and instr(" t",mid$(levelline$(mapy+1),mapx,1))) then
308
+				PullDown()
309
+			//elseif(instr("bf", mid$(levelline$(mapy-1), mapx, 1)) and instr(" t", mid$(levelline$(mapy-2), mapx,1))) then
310
+				//print "ok"
311
+				//PushShiftUp()
312
+			endif
313
+			sleep 0.05
314
+		break		
315
+		case "ctrl-8"	
316
+		case "ctrl-up"
317
+			if(instr("bf", mid$(levelline$(mapy+1), mapx, 1)) and instr(" t",mid$(levelline$(mapy-1),mapx,1))) then
318
+				PullUp()
319
+			//elseif(instr("bf", mid$(levelline$(mapy+1), mapx, 1)) and instr(" t", mid$(levelline$(mapy+2), mapx,1))) then
320
+				//print "ok"
321
+				//PushShiftUp()
322
+			endif
323
+			sleep 0.05
324
+		break		
325
+		case "ctrl-4"	
326
+		case "ctrl-left"
327
+			if(instr("bf", mid$(levelline$(mapy), mapx+1, 1)) and instr(" t",mid$(levelline$(mapy),mapx-1,1))) then
328
+				PullLeft()
329
+			//elseif(instr("bf", mid$(levelline$(mapy), mapx+1, 1)) and instr(" t", mid$(levelline$(mapy), mapx+2,1))) then
330
+				//print "ok"
331
+				//PushShiftUp()
332
+			endif
333
+			sleep 0.05
334
+		break		
335
+		case "ctrl-6"	
336
+		case "ctrl-right"
337
+			if(instr("bf", mid$(levelline$(mapy), mapx-1, 1)) and instr(" t",mid$(levelline$(mapy),mapx+1,1))) then
338
+				PullRight()
339
+			//elseif(instr("bf", mid$(levelline$(mapy+1), mapx, 1)) and instr(" t", mid$(levelline$(mapy+2), mapx,1))) then
340
+				//print "ok"
341
+				//PushShiftUp()
342
+			endif
343
+			sleep 0.05
344
+		break
345
+		case "Next_level:enter"
346
+			punkte(levelgewonnen)
347
+			neueslevel(aktlevel)													
348
+			window close "Next_level"
349
+			WINDOW SET Bildschirm$,"Activate"	
350
+		break
351
+		default:
352
+			if (moves=5) then
353
+				moves=0
354
+				if (stopp=1) then
355
+				else
356
+					if (aktlevel>0) then
357
+					print "icemapy2" +str$(icemapy2)
358
+					print "Bewegung2" +str$(Bewegung2)
359
+						if(icemapy>0 and icemapx>0) then
360
+							Bewegung=int(ran()*10)
361
+							if (Bewegung<1 or Bewegung>4) then
362
+								Bewegung=int(ran()*10)
363
+							endif	
364
+							//sleep 0.1	
365
+							monster_bewegen(Bewegung)
366
+												
367
+							if (mapx = icemapx and mapy=icemapy) then
368
+								stopp=1
369
+						//		Gotcha()
370
+							endif
371
+						endif 				
372
+					
373
+						if(icemapy2>0 and icemapx2>0) then
374
+							Bewegung2=int(ran()*10)
375
+							if (Bewegung2<1 or Bewegung2>4) then
376
+								Bewegung2=int(ran()*10)
377
+							endif	
378
+						
379
+							monster_bewegen2(Bewegung2)		
380
+							if (mapx = icemapx2 and mapy=icemapy2) then
381
+								stopp=1
382
+							//	Gotcha()
383
+							endif
384
+						endif 				
385
+					endif
386
+				endif
387
+			endif	
388
+			moves=moves+1
389
+					
390
+		break
391
+	end switch
392
+	nCommands = token(message$, msg$(), "|")		
393
+	for everyCommand = 1 to nCommands	
394
+		print msg$(everyCommand)
395
+		
396
+		switch(msg$(everyCommand))
397
+			case "_QuitRequested":
398
+			case "Win:_QuitRequested"
399
+				endgame=1
400
+				window close Bildschirm$
401
+				exit	
402
+			break
403
+			case "h"		
404
+			case "Highscore"
405
+				stackview set programmview$,2			
406
+				level$="gesamt"				
407
+				initial=1			
408
+				highscore(level$,initial)			
409
+			break			
410
+			case "HGEasy"		
411
+			
412
+					initial=0	
413
+					level$="Easy"	
414
+				highscore(level$,initial)			
415
+			break			
416
+			case "HGMiddle"	
417
+				
418
+					initial=0					
419
+					level$="Middle"	
420
+				highscore(level$,initial)			
421
+			break				
422
+			case "HGHeavy"		
423
+					
424
+					initial=0				
425
+					level$="Heavy"	
426
+				highscore(level$,initial)			
427
+			break
428
+			case "level"			
429
+				punkte(levelgewonnen)
430
+				neueslevel(aktlevel)											
431
+				window close "Next_level"				
432
+				WINDOW SET Bildschirm$,"Activate"				
433
+			break
434
+			case "Next_level:_QuitRequested"
435
+				window close "Next_level"
436
+			break
437
+			case "About"
438
+				AboutWindow()
439
+			break
440
+			case "AboutClose"
441
+				window close "View_About"
442
+			break
443
+		REM Endgame
444
+			case "NeuerVersuch"		
445
+				stopp=1
446
+				window close "Gotcha"
447
+				if (maxi_leben>0) then			
448
+					stopp=0	
449
+					maxi_leben=maxi_leben-1
450
+					Leben(maxi_leben)
451
+					gleicheslevel=aktlevel	
452
+					gleicheslevel(gleicheslevel)							
453
+				elseif (maxi_leben=0) then			
454
+					stopp=1				
455
+				endif			
456
+			break
457
+		
458
+			case "Speichern"
459
+				spielername$ = TEXTCONTROL GET$ "Spielername"
460
+				//print spielername$
461
+				Punkte$=str$(Punkte)					
462
+					initial=1			
463
+				level_nr$=str$(aktlevel)				
464
+				schritte$=str$(player_moves)				
465
+				lives$=str$(maxi_leben)					
466
+				highscore_speichern(Auswahl_Spielfigur$,spielername$,Punkte$,level$,level_nr$,schritte$,lives$)
467
+				wait 1.0				
468
+				//print level$
469
+				highscore(level$,initial)
470
+				//auswahl()	
471
+				BITMAP REMOVE "spieler"
472
+				BITMAP REMOVE "spieler_ri"
473
+				BITMAP REMOVE "spieler_up"
474
+				BITMAP REMOVE "spieler_down"
475
+				BITMAP REMOVE "spieler_le"
476
+				bitmap 32,32, "wall"
477
+				bitmap REMOVE  "blank"
478
+				bitmap REMOVE  "bulb"
479
+				bitmap REMOVE  "target"
480
+				bitmap REMOVE  "final"				
481
+				window close "Endgame"
482
+			break
483
+			case "Endgame:_QuitRequested"
484
+				window close "Endgame"
485
+			break
486
+			
487
+		Rem Menuabfragen
488
+			Rem Highscore
489
+			case "hgscore:_QuitRequested"
490
+				window close "hgscore"
491
+			break
492
+			case "ok"				
493
+				//stopp=1
494
+				//prgstart(stopp)
495
+				stackview set programmview$,1
496
+			break
497
+			case "HGReset"				
498
+				initial=0		
499
+				highscore_reset(level$)				
500
+				highscore(level$,initial)					
501
+			break		
502
+			case "Spielfigur1:ON"		
503
+							
504
+					CHECKBOX SET "Spielfigur2", false						
505
+					CHECKBOX SET "Spielfigur3", false					
506
+					CHECKBOX SET "Spielfigur4", false						
507
+					//OPTION SET "Spielfigur2", "Visible", false
508
+								
509
+					Auswahl_Spielfigur$="baer_down.png"					
510
+					Auswahl_Spielfigur_ri$="baer_right.png"				
511
+					Auswahl_Spielfigur_up$="baer_up.png"
512
+					Auswahl_Spielfigur_down$="baer_down.png"
513
+					Auswahl_Spielfigur_le$="baer_left.png"					
514
+					rand$="baum.png"						
515
+					final$="bienenstock_final.png"					
516
+					target$="bienenstock_target.png"					
517
+					item$="bienenstock.png"					
518
+					monster$="jaeger.png"						
519
+					monster_ri$="jaeger_re.png"				
520
+					monster_le$="jaeger_li.png"
521
+					monster_up$="jaeger_up.png"
522
+					monster_down$="jaeger_down.png"						
523
+					monster2$="monster.png"						
524
+					monster_ri2$="monster_ri.png"				
525
+					monster_le2$="monster_le.png"
526
+					monster_up2$="monster_up.png"
527
+					monster_down2$="monster_down.png"						
528
+					bustet2$="bustet_monster_hund.png"
529
+					bustet$="bustet_baer_jaeger.png"						
530
+					winner$="baer_winner.png"
531
+					OPTION SET "Easy", "Visible", true
532
+					OPTION SET "Middle", "Visible", true
533
+					OPTION SET "Heavy", "Visible", true				
534
+			break		
535
+			case "Spielfigur2:ON"
536
+		
537
+						
538
+					CHECKBOX SET "Spielfigur1", false						
539
+					CHECKBOX SET "Spielfigur3", false						
540
+					CHECKBOX SET "Spielfigur4", false					
541
+					//OPTION SET "Spielfigur1", "Visible", false					
542
+					Auswahl_Spielfigur$="hund.png"					
543
+					Auswahl_Spielfigur_ri$="hund_right.png"				
544
+					Auswahl_Spielfigur_up$="hund_up.png"
545
+					Auswahl_Spielfigur_down$="hund_down.png"
546
+					Auswahl_Spielfigur_le$="hund_left.png"							
547
+					rand$="hecke.png"					
548
+					final$="hundehuette_final.png"					
549
+					target$="hundehuette.png"						
550
+					item$="wurst.png"					
551
+					monster$="monster.png"						
552
+					monster_ri$="monster_ri.png"				
553
+					monster_le$="monster_le.png"
554
+					monster_up$="monster_up.png"
555
+					monster_down$="monster_down.png"						
556
+					bustet$="bustet_monster_hund.png"							
557
+					winner$="hund_winner.png"
558
+					OPTION SET "Easy", "Visible", true
559
+					OPTION SET "Middle", "Visible", true
560
+					OPTION SET "Heavy", "Visible", true
561
+					
562
+								
563
+			break			
564
+			case "Spielfigur3:ON"		
565
+							
566
+					CHECKBOX SET "Spielfigur1", false						
567
+					CHECKBOX SET "Spielfigur2", false						
568
+					CHECKBOX SET "Spielfigur4", false					
569
+					//OPTION SET "Spielfigur1", "Visible", false					
570
+					Auswahl_Spielfigur$="player.png"					
571
+					Auswahl_Spielfigur_ri$="player_right.png"				
572
+					Auswahl_Spielfigur_up$="player_up.png"
573
+					Auswahl_Spielfigur_down$="player_down.png"
574
+					Auswahl_Spielfigur_le$="player_left.png"							
575
+					rand$="mauerwerk.png"				
576
+					final$="diamant_final.png"					
577
+					target$="diamant_target.png"						
578
+					item$="diamant.png"							
579
+					monster$="monster.png"					
580
+					monster_ri$="monster_ri.png"				
581
+					monster_le$="monster_le.png"
582
+					monster_up$="monster_up.png"
583
+					monster_down$="monster_down.png"
584
+					bustet$="bustet_monster_player.png"							
585
+					winner$="player_winner.png"					
586
+					OPTION SET "Easy", "Visible", true
587
+					OPTION SET "Middle", "Visible", true
588
+					OPTION SET "Heavy", "Visible", true			
589
+			break			
590
+			case "Spielfigur4:ON"				
591
+					CHECKBOX SET "Spielfigur1", false			
592
+					CHECKBOX SET "Spielfigur2", false						
593
+					CHECKBOX SET "Spielfigur3", false					
594
+					//OPTION SET "Spielfigur2", "Visible", false				
595
+					Auswahl_Spielfigur$="hase.png"					
596
+					Auswahl_Spielfigur_ri$="hase_ri.png"				
597
+					Auswahl_Spielfigur_up$="hase_up.png"
598
+					Auswahl_Spielfigur_down$="hase_down.png"
599
+					Auswahl_Spielfigur_le$="hase_le.png"						
600
+					rand$="wall.png"						
601
+					final$="osterei_final.png"					
602
+					target$="nest.png"					
603
+					item$="osterei.png"					
604
+					monster$="jaeger_li.png"					
605
+					monster_ri$="jaeger_li.png"				
606
+					monster_le$="jaeger_re.png"
607
+					monster_up$="jaeger_up.png"
608
+					monster_down$="jaeger_down.png"		
609
+					bustet$="bustet_hase_jaeger.png"							
610
+					winner$="hase_winner.png"					
611
+					OPTION SET "Easy", "Visible", true
612
+					OPTION SET "Middle", "Visible", true
613
+					OPTION SET "Heavy", "Visible", true				
614
+			break
615
+			case "Easy"			
616
+				anzahl_fertig=4
617
+				maxi_leben=6
618
+				level$="Easy"
619
+				level_i=12
620
+				level_j=12				
621
+				stopp=0					
622
+				zeit=1000				
623
+				Punkte=1000			
624
+				Vorbereitung(Auswahl_Spielfigur$,Auswahl_Spielfigur_ri$,Auswahl_Spielfigur_up$,Auswahl_Spielfigur_down$,Auswahl_Spielfigur_le$,rand$,final$,target$,item$,monster_ri$,monster_le$,monster_up$,monster_down$,bustet$,winner$,monster_ri2$,monster_le2$,monster_up2$,monster_down2$,monster2$)
625
+				start()
626
+				if (View GET "Startbild", "Exists") then
627
+					view remove "Startbild"
628
+				endif
629
+			break
630
+			case "Win:Spiel:Schwierigkeit:middle"
631
+			case "Middle"
632
+				anzahl_fertig=4
633
+				maxi_leben=4
634
+				level$="Middle"
635
+				level_i=12
636
+				level_j=16				
637
+				stopp=0				
638
+				Punkte=800	
639
+				Vorbereitung(Auswahl_Spielfigur$,Auswahl_Spielfigur_ri$,Auswahl_Spielfigur_up$,Auswahl_Spielfigur_down$,Auswahl_Spielfigur_le$,rand$,final$,target$,item$,monster_ri$,monster_le$,monster_up$,monster_down$,bustet$,winner$)
640
+			
641
+				start()
642
+				if (View GET "Startbild", "Exists") then
643
+					view remove "Startbild"
644
+				endif
645
+			break
646
+			case "Win:Spiel:Schwierigkeit:Heavy"
647
+			case "Heavy"
648
+				anzahl_fertig=4
649
+				maxi_leben=2
650
+				level$="Heavy"
651
+				level_i=12
652
+				level_j=20				
653
+				stopp=0				
654
+				Punkte=600	
655
+				Vorbereitung(Auswahl_Spielfigur$,Auswahl_Spielfigur_ri$,Auswahl_Spielfigur_up$,Auswahl_Spielfigur_down$,Auswahl_Spielfigur_le$,rand$,final$,target$,item$,monster_ri$,monster_le$,monster_up$,monster_down$,bustet$,winner$)
656
+			
657
+				start()
658
+				if (View GET "Startbild", "Exists") then
659
+					view remove "Startbild"
660
+				endif
661
+			break			
662
+			case "Hilfe"
663
+				hilfe()
664
+			break			
665
+			case "Zurueck"
666
+				window close "Hilfe"
667
+			break
668
+			case "Hilfe:_QuitRequested"
669
+				window close "Hilfe"
670
+			break
671
+			default:			
672
+				
673
+			break
674
+	end switch
675
+	//sleep 0.01
676
+	
677
+	
678
+	next everyCommand	
679
+	
680
+	
681
+				
682
+				
683
+wend
684
+end sub
685
+sub monster_bewegen(Bewegung)
686
+		
687
+		if(Bewegung=1) then    		
688
+    		monster_runter()
689
+    	elseif(Bewegung=2) then    		
690
+    		monster_oben()
691
+    	elseif(Bewegung=3) then    		
692
+    		monster_rechts() 
693
+    	elseif(Bewegung=4) then    		
694
+    		monster_links() 
695
+    	endif
696
+end sub 
697
+sub monster_bewegen2(Bewegung2)
698
+		print Bewegung2
699
+		if(Bewegung2=1) then    		
700
+    		monster_runter2(Bewegung2)
701
+    	elseif(Bewegung2=2) then    		
702
+    		monster_oben2(Bewegung2)
703
+    	elseif(Bewegung2=3) then    		
704
+    		monster_rechts2(Bewegung2) 
705
+    	elseif(Bewegung2=4) then    		
706
+    		monster_links2(Bewegung2) 
707
+    	endif
708
+end sub 
709
+sub monster_runter(Bewegung) 	
710
+		//if (icemapy+1>level_i) then
711
+		//	else			 
712
+    	if(mid$(levelline$(icemapy+1), icemapx,1) = " ") then   
713
+    		monster_runter_zeichnen()   
714
+    	//elseif(mid$(levelline$(icemapy+2), icemapx,1) = "s") then  
715
+    		//end		
716
+		endif
717
+		//endif
718
+end sub
719
+sub monster_rechts(Bewegung)  
720
+		//if (icemapx+1>level_j) then			
721
+		// else
722
+    	if(mid$(levelline$(icemapy), (icemapx+1),1) = " ") then    		
723
+    		monster_rechts_zeichnen() 
724
+    	//elseif(mid$(levelline$(icemapy), icemapx+2,1) = "s") then  
725
+    		//end	
726
+       	endif
727
+       	//endif 	    	
728
+end sub
729
+sub monster_oben(Bewegung)    
730
+    	//if (icemapy+1>level_i) then
731
+		//else
732
+    	if(mid$(levelline$(icemapy-1), icemapx,1) = " ") then    		
733
+    		monster_oben_zeichnen() 
734
+    	//elseif(mid$(levelline$(icemapy-2), icemapx,1) = "s") then  
735
+    		//end	
736
+       	endif
737
+       	//endif	     	
738
+end sub
739
+sub monster_links(Bewegung)    
740
+    	//if (icemapx-1<2) then
741
+		//else	
742
+		
743
+    	if(mid$(levelline$(icemapy), (icemapx-1),1) = " ") then    		
744
+    		monster_links_zeichnen()
745
+    	//elseif(mid$(levelline$(icemapy), icemapx-2,1) = "s") then  
746
+    		//end	
747
+  	   	endif
748
+  	   	//endif	
749
+end sub
750
+sub monster_runter_zeichnen()
751
+	icemapy = icemapy+1
752
+	monstery = monstery+32
753
+	icemapx = icemapx
754
+	monsterx = monsterx		
755
+	
756
+	draw bitmap monsterx, monstery, "monster_down", "alpha", "Canvas"
757
+	
758
+	if(mid$(levelline$(icemapy-1), icemapx,1) = " ") then
759
+		draw bitmap monsterx, monstery-32, "background","copy", "Canvas"
760
+	endif
761
+	//wait 0.1
762
+	//monster_runter()
763
+	return
764
+end sub
765
+sub monster_rechts_zeichnen()
766
+	icemapx = icemapx+1
767
+	monsterx = monsterx+32	
768
+	icemapy = icemapy
769
+	monstery = monstery	
770
+	draw bitmap monsterx, monstery, "monster_ri", "alpha", "Canvas"
771
+	if(mid$(levelline$(icemapy), icemapx-1,1) = " ") then
772
+		draw bitmap monsterx-32, monstery, "background","copy", "Canvas"
773
+	endif
774
+	//wait 0.1
775
+	//monster_rechts()
776
+	return
777
+end sub
778
+sub monster_oben_zeichnen()
779
+	icemapy = icemapy-1
780
+	monstery = monstery-32
781
+	icemapx = icemapx
782
+	monsterx = monsterx		
783
+	draw bitmap monsterx, monstery, "monster_up", "alpha", "Canvas"
784
+	if(mid$(levelline$(icemapy+1), icemapx,1) = " ") then
785
+		draw bitmap monsterx, monstery+32, "background","copy", "Canvas"
786
+	endif
787
+	//wait 0.1
788
+	//monster_oben()
789
+	return
790
+end sub
791
+sub monster_links_zeichnen()
792
+	icemapx = icemapx-1
793
+	monsterx = monsterx-32	
794
+	icemapy = icemapy
795
+	monstery = monstery	
796
+	draw bitmap monsterx, monstery, "monster_le", "alpha", "Canvas"
797
+	if(mid$(levelline$(icemapy), icemapx+1,1) = " ") then
798
+		draw bitmap monsterx+32, monstery, "background","copy", "Canvas"
799
+	endif
800
+	//wait 0.1
801
+	//monster_links()
802
+	return
803
+end sub
804
+sub monster_runter2(Bewegung2) 	
805
+		print mid$(levelline$(icemapy2+1), icemapx2,1) 
806
+		print "runter2"+mid$(levelline$(icemapy2+1), icemapx2,1)+":icemapy2:"+str$(icemapy2)+":icemapx2:"+str$(icemapx2)
807
+		if(mid$(levelline$(icemapy2+1), icemapx2,1) = " ") then
808
+		//print "true"   
809
+		wait 4
810
+    		monster_runter_zeichnen2()   	
811
+		endif
812
+end sub
813
+sub monster_rechts2(Bewegung2)  
814
+	print mid$(levelline$(icemapy2), (icemapx2-1),1)
815
+		print "rechts"+mid$(levelline$(icemapy2), (icemapx2-1),1)+":icemapy2:"+str$(icemapy2)+":icemapx2:"+str$(icemapx2)
816
+    	if(mid$(levelline$(icemapy2), (icemapx2-1),1) = " ") then    		
817
+    		monster_rechts_zeichnen2() 
818
+    	wait 4	
819
+    	//print "true" 
820
+    	endif	    	
821
+end sub
822
+sub monster_oben2(Bewegung2)    
823
+	print mid$(levelline$(icemapy2-1), (icemapx2),1)
824
+    print "oben"+mid$(levelline$(icemapy2-1), icemapx2,1)+":icemapy2:"+str$(icemapy2)+":icemapx2:"+str$(icemapx2)
825
+    	if(mid$(levelline$(icemapy2-1), icemapx2,1) = " ") then    		
826
+    		monster_oben_zeichnen2() 
827
+    		wait 4
828
+    	//	print "true" 
829
+       	endif
830
+end sub
831
+sub monster_links2(Bewegung2)    
832
+	print mid$(levelline$(icemapy2), (icemapx2+1),1)
833
+    print "links"+mid$(levelline$(icemapy2-1), icemapx2,1)+":icemapy2:"+str$(icemapy2)+":icemapx2:"+str$(icemapx2)
834
+		if(mid$(levelline$(icemapy2), (icemapx2+1),1) = " ") then    		
835
+    		monster_links_zeichnen2()
836
+    	wait 4
837
+    	//print "true" 
838
+    	endif
839
+end sub
840
+sub monster_runter_zeichnen2()
841
+	icemapy2 = icemapy2+1
842
+	monstery2 = monstery2+32
843
+	icemapx2 = icemapx2
844
+	monsterx2 = monsterx2		
845
+	
846
+	draw bitmap monsterx2, monstery2, "monster_down2", "alpha", "Canvas"
847
+	
848
+	if(mid$(levelline$(icemapy2-1), icemapx2,1) = " ") then
849
+		draw bitmap monsterx2, monstery2-32, "background","copy", "Canvas"
850
+	endif
851
+	
852
+	return
853
+end sub
854
+sub monster_rechts_zeichnen2()
855
+	icemapx2 = icemapx2+1
856
+	monsterx2 = monsterx2+32	
857
+	icemapy2 = icemapy2
858
+	monstery2 = monstery2	
859
+	draw bitmap monsterx2, monstery2, "monster_ri2", "alpha", "Canvas"
860
+	
861
+	if(mid$(levelline$(icemapy2), icemapx2-1,1) = " ") then
862
+		draw bitmap monsterx2-32, monstery2, "background","copy", "Canvas"
863
+	endif
864
+	
865
+	return
866
+end sub
867
+sub monster_oben_zeichnen2()
868
+	icemapy2 = icemapy2-1
869
+	monstery2 = monstery2-32
870
+	icemapx2 = icemapx2
871
+	monsterx2 = monsterx2		
872
+	draw bitmap monsterx2, monstery2, "monster_up2", "alpha", "Canvas"
873
+	if(mid$(levelline$(icemapy2+1), icemapx2,1) = " ") then
874
+		draw bitmap monsterx2, monstery2+32, "background","copy", "Canvas"
875
+	endif
876
+	
877
+	return
878
+end sub
879
+sub monster_links_zeichnen2()
880
+	icemapx2 = icemapx2-1
881
+	monsterx2 = monsterx2-32	
882
+	icemapy2 = icemapy2
883
+	monstery2 = monstery2	
884
+	draw bitmap monsterx2, monstery2, "monster_le2", "alpha", "Canvas"
885
+	if(mid$(levelline$(icemapy2), icemapx2+1,1) = " ") then
886
+		draw bitmap monsterx2+32, monstery2, "background","copy", "Canvas"
887
+	endif
888
+
889
+	return
890
+end sub
891
+sub Walkleftandup()
892
+	mapy = mapy - 1
893
+	mapx = mapx - 1
894
+	playery = playery - 32
895
+	playerx = playerx - 32
896
+	
897
+	draw bitmap playerx, playery, "spieler","alpha", "Canvas"
898
+	if(mid$(levelline$(mapy+1), mapx+1,1) = " ") then
899
+		draw bitmap playerx+32, playery+32, "background","copy", "Canvas"
900
+	elseif(mid$(levelline$(mapy+1), mapx+1,1) = "t") then
901
+		draw bitmap playerx+32, playery+32, "target","copy", "Canvas"
902
+	elseif(mid$(levelline$(mapy+1), mapx+1,1) = "f") then
903
+		draw bitmap playerx+32, playery+32, "final","copy", "Canvas"
904
+	endif
905
+	return	
906
+end sub
907
+sub Walkleftanddown()
908
+	mapy = mapy + 1
909
+	mapx = mapx - 1
910
+	playery = playery + 32
911
+	playerx = playerx - 32
912
+	
913
+	draw bitmap playerx, playery, "spieler","alpha", "Canvas"
914
+	if(mid$(levelline$(mapy-1), mapx+1,1) = " ") then
915
+		draw bitmap playerx+32, playery-32, "background","copy", "Canvas"
916
+	elseif(mid$(levelline$(mapy-1), mapx+1,1) = "t") then
917
+		draw bitmap playerx+32, playery-32, "target","copy", "Canvas"
918
+	elseif(mid$(levelline$(mapy-1), mapx+1,1) = "f") then
919
+		draw bitmap playerx+32, playery-32, "final","copy", "Canvas"
920
+	endif
921
+	return	
922
+end sub
923
+sub Walkrightandup()
924
+	mapy = mapy - 1
925
+	mapx = mapx + 1
926
+	playery = playery - 32
927
+	playerx = playerx + 32
928
+	
929
+	draw bitmap playerx, playery, "spieler","alpha", "Canvas"
930
+	if(mid$(levelline$(mapy+1), mapx-1,1) = " ") then
931
+		draw bitmap playerx-32, playery+32, "background","copy", "Canvas"
932
+	elseif(mid$(levelline$(mapy+1), mapx-1,1) = "t") then
933
+		draw bitmap playerx-32, playery+32, "target","copy", "Canvas"
934
+	elseif(mid$(levelline$(mapy+1), mapx-1,1) = "f") then
935
+		draw bitmap playerx-32, playery+32, "final","copy", "Canvas"
936
+	endif
937
+	return	
938
+end sub
939
+sub Walkrightanddown()
940
+	mapy = mapy + 1
941
+	mapx = mapx + 1
942
+	playery = playery + 32
943
+	playerx = playerx + 32
944
+	
945
+	draw bitmap playerx, playery, "spieler","alpha", "Canvas"
946
+	if(mid$(levelline$(mapy-1), mapx-1,1) = " ") then
947
+		draw bitmap playerx-32, playery-32, "background","copy", "Canvas"
948
+	elseif(mid$(levelline$(mapy-1), mapx-1,1) = "t") then
949
+		draw bitmap playerx-32, playery-32, "target","copy", "Canvas"
950
+	elseif(mid$(levelline$(mapy-1), mapx-1,1) = "f") then
951
+		draw bitmap playerx-32, playery-32, "final","copy", "Canvas"
952
+	endif
953
+	return	
954
+end sub
955
+sub WalkDown()
956
+	mapy = mapy + 1
957
+	playery = playery + 32
958
+	
959
+	draw bitmap playerx, playery, "spieler_down","alpha", "Canvas"
960
+	if(mid$(levelline$(mapy-1), mapx,1) = " ") then
961
+		draw bitmap playerx, playery-32, "background","copy", "Canvas"
962
+	elseif(mid$(levelline$(mapy-1), mapx,1) = "t") then
963
+		draw bitmap playerx, playery-32, "target","copy", "Canvas"
964
+	elseif(mid$(levelline$(mapy-1), mapx,1) = "f") then
965
+		draw bitmap playerx, playery-32, "final","copy", "Canvas"
966
+	endif
967
+	return
968
+end sub
969
+
970
+sub WalkUp()
971
+	mapy = mapy - 1
972
+	playery = playery - 32
973
+	
974
+	draw bitmap playerx, playery, "spieler_up","alpha", "Canvas"
975
+	if(mid$(levelline$(mapy+1), mapx,1) = " ") then
976
+		draw bitmap playerx, playery+32, "background","copy", "Canvas"
977
+	elseif(mid$(levelline$(mapy+1), mapx,1) = "t") then
978
+		draw bitmap playerx, playery+32, "target","copy", "Canvas"
979
+	elseif(mid$(levelline$(mapy+1), mapx,1) = "f") then
980
+		draw bitmap playerx, playery+32, "final","copy", "Canvas"
981
+	endif
982
+	return
983
+end sub
984
+
985
+sub WalkLeft()
986
+	mapx = mapx - 1
987
+	playerx = playerx - 32
988
+	
989
+	draw bitmap playerx, playery, "spieler_le","alpha", "Canvas"
990
+	if(mid$(levelline$(mapy), mapx+1,1) = " ") then
991
+		draw bitmap playerx+32, playery, "background","copy", "Canvas"
992
+	elseif(mid$(levelline$(mapy), mapx+1,1) = "t") then
993
+		draw bitmap playerx+32, playery, "target","copy", "Canvas"
994
+	elseif(mid$(levelline$(mapy), mapx+1,1) = "f") then
995
+		draw bitmap playerx+32, playery, "final","copy", "Canvas"
996
+	endif
997
+	return
998
+end sub
999
+
1000
+sub WalkRight()
1001
+	mapx = mapx + 1
1002
+	playerx = playerx + 32
1003
+	
1004
+	draw bitmap playerx, playery, "spieler_ri","alpha", "Canvas"
1005
+	
1006
+	if(mid$(levelline$(mapy), mapx-1,1) = " ") then
1007
+		draw bitmap playerx-32, playery, "background","copy", "Canvas"
1008
+	elseif(mid$(levelline$(mapy), mapx-1,1) = "t") then
1009
+		draw bitmap playerx-32, playery, "target","copy", "Canvas"
1010
+	elseif(mid$(levelline$(mapy), mapx-1,1) = "f") then
1011
+		draw bitmap playerx-32, playery, "final","copy", "Canvas"
1012
+	endif
1013
+	return
1014
+end sub
1015
+
1016
+sub PushDown()
1017
+	local t$
1018
+
1019
+	t$ = mid$(levelline$(mapy+1), mapx, 1)
1020
+	if(t$ = "b") then
1021
+		mid$(levelline$(mapy+1), mapx, 1) = " "
1022
+		draw bitmap playerx,playery+32, "background", "copy", "Canvas"
1023
+	else
1024
+		mid$(levelline$(mapy+1), mapx, 1) = "t"
1025
+		draw bitmap playerx,playery+32, "target", "copy", "Canvas"
1026
+	endif
1027
+	t$ = mid$(levelline$(mapy+2), mapx, 1)
1028
+	if(t$ = " ") then
1029
+		mid$(levelline$(mapy+2), mapx, 1) = "b"
1030
+		draw bitmap playerx,playery+64, "bulb", "copy", "Canvas"
1031
+		// soundplay "roehr.wav", false 
1032
+	else
1033
+		mid$(levelline$(mapy+2), mapx, 1) = "f"
1034
+		draw bitmap playerx,playery+64, "final", "copy", "Canvas"
1035
+		// soundplay "pong.wav", false
1036
+	endif
1037
+	WalkDown()
1038
+	CheckFinished()
1039
+	return
1040
+end sub
1041
+
1042
+sub PushUp()
1043
+	local t$
1044
+
1045
+	t$ = mid$(levelline$(mapy-1), mapx, 1)
1046
+	if(t$ = "b") then
1047
+		mid$(levelline$(mapy-1), mapx, 1) = " "
1048
+		draw bitmap playerx,playery-32, "background", "copy", "Canvas"
1049
+	else
1050
+		mid$(levelline$(mapy-1), mapx, 1) = "t"
1051
+		draw bitmap playerx,playery-32, "target", "copy", "Canvas"
1052
+	endif
1053
+	t$ = mid$(levelline$(mapy-2), mapx, 1)
1054
+	if(t$ = " ") then
1055
+		mid$(levelline$(mapy-2), mapx, 1) = "b"
1056
+		draw bitmap playerx,playery-64, "bulb", "copy", "Canvas"
1057
+		// soundplay "roehr.wav", false 
1058
+	else
1059
+		mid$(levelline$(mapy-2), mapx, 1) = "f"
1060
+		draw bitmap playerx,playery-64, "final", "copy", "Canvas"
1061
+		// soundplay "pong.wav", false
1062
+	endif
1063
+	WalkUp()
1064
+	CheckFinished()
1065
+	return
1066
+end sub
1067
+
1068
+sub PushLeft()
1069
+	local t$
1070
+
1071
+	t$ = mid$(levelline$(mapy), mapx-1, 1)
1072
+	if(t$ = "b") then
1073
+		mid$(levelline$(mapy), mapx-1, 1) = " "
1074
+		draw bitmap playerx-32,playery, "background", "copy", "Canvas"
1075
+	else
1076
+		mid$(levelline$(mapy), mapx-1, 1) = "t"
1077
+		draw bitmap playerx-32,playery, "target", "copy", "Canvas"
1078
+	endif
1079
+	t$ = mid$(levelline$(mapy), mapx-2, 1)
1080
+	if(t$ = " ") then
1081
+		mid$(levelline$(mapy), mapx-2, 1) = "b"
1082
+		draw bitmap playerx-64,playery, "bulb", "copy", "Canvas"
1083
+		// soundplay "roehr.wav", false
1084
+	else
1085
+		mid$(levelline$(mapy), mapx-2, 1) = "f"
1086
+		draw bitmap playerx-64,playery, "final", "copy", "Canvas"
1087
+		// soundplay "pong.wav", false
1088
+	endif
1089
+	WalkLeft()
1090
+	CheckFinished()
1091
+	return
1092
+end sub
1093
+
1094
+sub PushRight()
1095
+	local t$
1096
+
1097
+	t$ = mid$(levelline$(mapy), mapx+1, 1)
1098
+	if(t$ = "b") then
1099
+		mid$(levelline$(mapy), mapx+1, 1) = " "
1100
+		draw bitmap playerx+32,playery, "background", "copy", "Canvas"
1101
+	else
1102
+		mid$(levelline$(mapy), mapx+1, 1) = "t"
1103
+		draw bitmap playerx+32,playery, "target", "copy", "Canvas"
1104
+	endif
1105
+	t$ = mid$(levelline$(mapy), mapx+2, 1)
1106
+	if(t$ = " ") then
1107
+		mid$(levelline$(mapy), mapx+2, 1) = "b"
1108
+		draw bitmap playerx+64,playery, "bulb", "copy", "Canvas"
1109
+		// soundplay "roehr.wav", false 
1110
+	else
1111
+		mid$(levelline$(mapy), mapx+2, 1) = "f"
1112
+		draw bitmap playerx+64,playery, "final", "copy", "Canvas"
1113
+		// soundplay "pong.wav", false
1114
+		
1115
+	endif
1116
+	WalkRight()
1117
+	CheckFinished()
1118
+	return
1119
+end sub
1120
+sub PushShiftRight()
1121
+	local t$
1122
+
1123
+	t$ = mid$(levelline$(mapy), mapx+1, 1)
1124
+	if(t$ = "b") then
1125
+		mid$(levelline$(mapy), mapx+1, 1) = " "
1126
+		draw bitmap playerx+32,playery, "background", "copy", "Canvas"
1127
+	else
1128
+		mid$(levelline$(mapy), mapx+1, 1) = "t"
1129
+		draw bitmap playerx+32,playery, "target", "copy", "Canvas"
1130
+	endif
1131
+	t$ = mid$(levelline$(mapy), mapx+2, 1)
1132
+	if(t$ = " ") then
1133
+		mid$(levelline$(mapy), mapx+2, 1) = "b"
1134
+		draw bitmap playerx+64,playery, "bulb", "copy", "Canvas"
1135
+		// soundplay "roehr.wav", false 
1136
+	else
1137
+		mid$(levelline$(mapy), mapx+2, 1) = "f"
1138
+		draw bitmap playerx+64,playery, "final", "copy", "Canvas"
1139
+		// soundplay "pong.wav", false
1140
+		
1141
+	endif
1142
+	//WalkRight()
1143
+	CheckFinished()
1144
+	return
1145
+end sub
1146
+sub PushShiftLeft()
1147
+	local t$
1148
+
1149
+	t$ = mid$(levelline$(mapy), mapx-1, 1)
1150
+	if(t$ = "b") then
1151
+		mid$(levelline$(mapy), mapx-1, 1) = " "
1152
+		draw bitmap playerx-32,playery, "background", "copy", "Canvas"
1153
+	else
1154
+		mid$(levelline$(mapy), mapx-1, 1) = "t"
1155
+		draw bitmap playerx-32,playery, "target", "copy", "Canvas"
1156
+	endif
1157
+	t$ = mid$(levelline$(mapy), mapx-2, 1)
1158
+	if(t$ = " ") then
1159
+		mid$(levelline$(mapy), mapx-2, 1) = "b"
1160
+		draw bitmap playerx-64,playery, "bulb", "copy", "Canvas"
1161
+		// soundplay "roehr.wav", false
1162
+	else
1163
+		mid$(levelline$(mapy), mapx-2, 1) = "f"
1164
+		draw bitmap playerx-64,playery, "final", "copy", "Canvas"
1165
+		// soundplay "pong.wav", false
1166
+	endif
1167
+	//WalkLeft()
1168
+	CheckFinished()
1169
+	return
1170
+end sub
1171
+
1172
+sub PushShiftDown()
1173
+	local t$
1174
+
1175
+	t$ = mid$(levelline$(mapy+1), mapx, 1)
1176
+	if(t$ = "b") then
1177
+		mid$(levelline$(mapy+1), mapx, 1) = " "
1178
+		draw bitmap playerx,playery+32, "background", "copy", "Canvas"
1179
+	else
1180
+		mid$(levelline$(mapy+1), mapx, 1) = "t"
1181
+		draw bitmap playerx,playery+32, "target", "copy", "Canvas"
1182
+	endif
1183
+	t$ = mid$(levelline$(mapy+2), mapx, 1)
1184
+	if(t$ = " ") then
1185
+		mid$(levelline$(mapy+2), mapx, 1) = "b"
1186
+		draw bitmap playerx,playery+64, "bulb", "copy", "Canvas"
1187
+		// soundplay "roehr.wav", false 
1188
+	else
1189
+		mid$(levelline$(mapy+2), mapx, 1) = "f"
1190
+		draw bitmap playerx,playery+64, "final", "copy", "Canvas"
1191
+		// soundplay "pong.wav", false
1192
+	endif
1193
+	//WalkDown()
1194
+	CheckFinished()
1195
+	return
1196
+end sub
1197
+
1198
+sub PushShiftUp()
1199
+	local t$
1200
+
1201
+	t$ = mid$(levelline$(mapy-1), mapx, 1)
1202
+	if(t$ = "b") then
1203
+		mid$(levelline$(mapy-1), mapx, 1) = " "
1204
+		draw bitmap playerx,playery-32, "background", "copy", "Canvas"
1205
+	else
1206
+		mid$(levelline$(mapy-1), mapx, 1) = "t"
1207
+		draw bitmap playerx,playery-32, "target", "copy", "Canvas"
1208
+	endif
1209
+	t$ = mid$(levelline$(mapy-2), mapx, 1)
1210
+	if(t$ = " ") then
1211
+		mid$(levelline$(mapy-2), mapx, 1) = "b"
1212
+		draw bitmap playerx,playery-64, "bulb", "copy", "Canvas"
1213
+		// soundplay "roehr.wav", false 
1214
+	else
1215
+		mid$(levelline$(mapy-2), mapx, 1) = "f"
1216
+		draw bitmap playerx,playery-64, "final", "copy", "Canvas"
1217
+		// soundplay "pong.wav", false
1218
+	endif
1219
+	//WalkUp()
1220
+	CheckFinished()
1221
+	return
1222
+end sub
1223
+
1224
+sub PullDown()
1225
+	local t$
1226
+
1227
+	t$ = mid$(levelline$(mapy-1), mapx, 1)
1228
+	if(t$ = "b") then
1229
+		mid$(levelline$(mapy-1), mapx, 1) = " "
1230
+		draw bitmap playerx,playery-32, "background", "copy", "Canvas"
1231
+	else
1232
+		mid$(levelline$(mapy-1), mapx, 1) = "t"
1233
+		draw bitmap playerx,playery-32, "target", "copy", "Canvas"
1234
+	endif
1235
+	t$ = mid$(levelline$(mapy), mapx, 1)
1236
+	if(t$ = " ") then
1237
+		mid$(levelline$(mapy), mapx, 1) = "b"
1238
+		draw bitmap playerx,playery, "bulb", "copy", "Canvas"
1239
+		
1240
+	else
1241
+		mid$(levelline$(mapy), mapx, 1) = "f"
1242
+		draw bitmap playerx,playery, "final", "copy", "Canvas"
1243
+		
1244
+	endif
1245
+	WalkDown()
1246
+	CheckFinished()
1247
+	return
1248
+end sub
1249
+
1250
+sub PullUp()
1251
+	local t$
1252
+
1253
+	t$ = mid$(levelline$(mapy+1), mapx, 1)
1254
+	if(t$ = "b") then
1255
+		mid$(levelline$(mapy+1), mapx, 1) = " "
1256
+		draw bitmap playerx,playery+32, "background", "copy", "Canvas"
1257
+	else
1258
+		mid$(levelline$(mapy+1), mapx, 1) = "t"
1259
+		draw bitmap playerx,playery+32, "target", "copy", "Canvas"
1260
+	endif
1261
+	t$ = mid$(levelline$(mapy), mapx, 1)
1262
+	if(t$ = " ") then
1263
+		mid$(levelline$(mapy), mapx, 1) = "b"
1264
+		draw bitmap playerx,playery, "bulb", "copy", "Canvas"
1265
+		// soundplay "roehr.wav", false 
1266
+	else
1267
+		mid$(levelline$(mapy), mapx, 1) = "f"
1268
+		draw bitmap playerx,playery, "final", "copy", "Canvas"
1269
+		// soundplay "pong.wav", false
1270
+	endif
1271
+	WalkUp()
1272
+	CheckFinished()
1273
+	return
1274
+end sub
1275
+
1276
+sub PullLeft()
1277
+	local t$
1278
+
1279
+	t$ = mid$(levelline$(mapy), mapx+1, 1)
1280
+	if(t$ = "b") then
1281
+		mid$(levelline$(mapy), mapx+1, 1) = " "
1282
+		draw bitmap playerx+32,playery, "background", "copy", "Canvas"
1283
+	else
1284
+		mid$(levelline$(mapy), mapx+1, 1) = "t"
1285
+		draw bitmap playerx+32,playery, "target", "copy", "Canvas"
1286
+	endif
1287
+	t$ = mid$(levelline$(mapy), mapx, 1)
1288
+	if(t$ = " ") then
1289
+		mid$(levelline$(mapy), mapx, 1) = "b"
1290
+		draw bitmap playerx,playery, "bulb", "copy", "Canvas"
1291
+		// soundplay "roehr.wav", false
1292
+	else
1293
+		mid$(levelline$(mapy), mapx, 1) = "f"
1294
+		draw bitmap playerx,playery, "final", "copy", "Canvas"
1295
+		// soundplay "pong.wav", false
1296
+	endif
1297
+	WalkLeft()
1298
+	CheckFinished()
1299
+	return
1300
+end sub
1301
+
1302
+sub PullRight()
1303
+	local t$
1304
+
1305
+	t$ = mid$(levelline$(mapy), mapx-1, 1)
1306
+	if(t$ = "b") then
1307
+		mid$(levelline$(mapy), mapx-1, 1) = " "
1308
+		draw bitmap playerx-32,playery, "background", "copy", "Canvas"
1309
+	else
1310
+		mid$(levelline$(mapy), mapx-1, 1) = "t"
1311
+		draw bitmap playerx-32,playery, "target", "copy", "Canvas"
1312
+	endif
1313
+	t$ = mid$(levelline$(mapy), mapx, 1)
1314
+	if(t$ = " ") then
1315
+		mid$(levelline$(mapy), mapx, 1) = "b"
1316
+		draw bitmap playerx,playery, "bulb", "copy", "Canvas"
1317
+		// soundplay "roehr.wav", false 
1318
+	else
1319
+		mid$(levelline$(mapy), mapx, 1) = "f"
1320
+		draw bitmap playerx,playery, "final", "copy", "Canvas"
1321
+		// soundplay "pong.wav", false
1322
+		
1323
+	endif
1324
+	WalkRight()
1325
+	CheckFinished()
1326
+	return
1327
+end sub
1328
+
1329
+sub CheckFinished()
1330
+	local i	
1331
+	local w	
1332
+	//print Punkte
1333
+	for i = 1 to 12
1334
+		if(instr(levelline$(i), "b")) then		
1335
+			w=1			
1336
+			if (w=1) then	
1337
+		 		item_punkte=w*20		 		
1338
+			endif
1339
+		 return			 		
1340
+		endif				
1341
+	next i					
1342
+	Punkte=Punkte+item_punkte
1343
+	levelgewonnen=levelgewonnen+1
1344
+	wait 0.1	
1345
+	WINDOW SET Bildschirm$,"Minimize"
1346
+
1347
+	if (aktlevel=anzahl_level) then
1348
+		bonus=maxi_leben*10
1349
+			
1350
+		endgame()		
1351
+	else
1352
+		aktlevel=aktlevel+1
1353
+		keymsg$=" "
1354
+		wait 0.1
1355
+		keymsg$=" "
1356
+		wait 0.1
1357
+		next_Level(aktlevel)
1358
+	endif		
1359
+	Punkte=Punkte+item_punkte+levelgewonnen	
1360
+	return
1361
+end sub
1362
+
1363
+sub neueslevel(aktlevel)
1364
+	//find fileload$	
1365
+	//print aktlevel
1366
+	fileload$=dir$+"/level"+str$(aktlevel)+".dat"
1367
+	a=0
1368
+	b=0
1369
+	i=0
1370
+	j=0
1371
+	x=0
1372
+	y=0	
1373
+	punkte(Punkte)
1374
+	icemapy=0
1375
+	icemapx=0
1376
+	levelladen(a,b,fileload$)
1377
+	levelmalen(i,j,x,y)	
1378
+end sub
1379
+
1380
+sub gleicheslevel(gleicheslevel)
1381
+	//find fileload$	
1382
+	fileload$=dir$+"/level"+str$(gleicheslevel)+".dat"
1383
+	//print fileload$ 
1384
+	a=0:b=0:i=0:j=0:x=0:y=0
1385
+	levelladen(a,b,fileload$)
1386
+	levelmalen(i,j,x,y)
1387
+end sub
1388
+
1389
+sub levelladen(a,b,fileload$)
1390
+	
1391
+	auslesen=open(fileload$, "r")
1392
+	while (not EOF(auslesen))
1393
+	line input #auslesen b$
1394
+	dim elements$(1)
1395
+	numElements = split(b$, elements$(),";")
1396
+	for a = 1 to numElements
1397
+			b=b+1
1398
+			dim levelline$(b)
1399
+			levelline$(b) = elements$(a)
1400
+			//print b
1401
+	print levelline$(b)
1402
+	next a
1403
+	wend
1404
+	close(auslesen)
1405
+end sub
1406
+
1407
+sub levelmalen(i,j,x,y)
1408
+// Read in the demo level and show it
1409
+//dim levelline$(12)
1410
+
1411
+for i=1 to level_i 
1412
+	for j = 1 to level_j
1413
+		switch(mid$(levelline$(i), j, 1))
1414
+			case " "
1415
+				draw bitmap x,y, "background", "copy", "Canvas"
1416
+			break
1417
+			case "w"
1418
+				draw bitmap x,y, "wall", "copy", "Canvas"
1419
+			break
1420
+			case "b"
1421
+				draw bitmap x,y, "bulb", "alpha", "Canvas"
1422
+			break
1423
+			case "t"
1424
+				draw bitmap x,y, "target", "alpha", "Canvas"
1425
+			break			
1426
+			case "s"	
1427
+				//draw bitmap x,y, "spieler", "copy", "Canvas"		
1428
+				draw bitmap x,y, "background", "copy", "Canvas"
1429
+				draw bitmap x,y, "spieler", "alpha", "Canvas"
1430
+				mapx = j
1431
+				mapy = i				
1432
+				mid$(levelline$(i), j, 1) = " "
1433
+			break
1434
+			case "m"
1435
+				draw bitmap x,y, "monster", "copy", "Canvas"
1436
+				icemapx = j
1437
+				icemapy = i
1438
+				mid$(levelline$(i), j, 1) = " "
1439
+			break		
1440
+			case "v"
1441
+				draw bitmap x,y, "monster2", "copy", "Canvas"
1442
+				icemapx2 = j
1443
+				icemapy2 = i
1444
+				mid$(levelline$(i), j, 1) = " "
1445
+			break			
1446
+		end switch
1447
+		x = x + 32
1448
+	next j
1449
+	x = 0
1450
+	y = y + 32
1451
+next i
1452
+playerx = (mapx-1)*32
1453
+playery = (mapy-1)*32
1454
+monsterx = (icemapx-1)*32
1455
+monstery = (icemapy-1)*32
1456
+monsterx2 = (icemapx2-1)*32
1457
+monstery2 = (icemapy2-1)*32
1458
+end sub
1459
+
1460
+sub punkte(Punkte)	
1461
+	DRAW SET "BGColor",0,0,0, "Lebenanzeige"
1462
+	Draw flush "Statusanzeige"	
1463
+	DRAW SET "BGColor",0,0,0, "Statusanzeige"	
1464
+	DRAW SET "HighColor",200,200,200, "Statusanzeige"	
1465
+	DRAW RECT 0,0 TO 640,2, "Statusanzeige"	
1466
+	DRAW SET "HighColor",255,255,255, "Statusanzeige"	
1467
+	DRAW RECT 0,2 TO 640,3, "Statusanzeige"	
1468
+	DRAW SET "HighColor",200,200,200, "Statusanzeige"	
1469
+	DRAW RECT 0,3 TO 640,5, "Statusanzeige"		
1470
+	DRAW SET "HighColor",222,222,222, "Statusanzeige"	
1471
+	Draw Set "lowColor",0,0,0,"Statusanzeige"		
1472
+	//DRAW SET "system-plain"+","+""+"20"+","+"regular"+","+",", "Statusanzeige"
1473
+	DRAW TEXT 10,35, "Your Points: "+str$(Punkte), "Statusanzeige"	
1474
+end sub
1475
+
1476
+sub start()
1477
+	//anzahl_fertig=4
1478
+	//maxi_leben=5
1479
+	aktlevel=1
1480
+	levelgewonnen=0
1481
+	a=0:b=0
1482
+	level=1	
1483
+
1484
+	dir$=game_dir$+"/levels/"+level$		
1485
+	fileload$=dir$+"/level"+str$(level)+".dat"
1486
+	gleicheslevel=0
1487
+	levelladen(a,b,fileload$)
1488
+	i=1:j=1:x=0:y=0
1489
+	levelmalen(i,j,x,y)
1490
+	punkte(Punkte)
1491
+	Leben(maxi_leben)	
1492
+end sub
1493
+
1494
+sub Leben(maxi_leben)		
1495
+	abstand=0	
1496
+	DRAW SET "BGColor",0,0,0, "Lebenanzeige"
1497
+	Draw flush "Lebenanzeige"	
1498
+	DRAW SET "BGColor",0,0,0, "Lebenanzeige"	
1499
+		for f=1 to maxi_leben
1500
+			g=5:h=36
1501
+			abstand=abstand+41
1502
+			err=draw image g+abstand,20 to h+abstand,52, Grafikverzeichnis$+Auswahl_Spielfigur$, "Lebenanzeige"
1503
+		next f
1504
+		if (maxi_leben=0) then			
1505
+			stopp=1	
1506
+			endgame()			
1507
+		endif			
1508
+end sub
1509
+
1510
+sub next_Level(aktlevel)
1511
+	window open ((screenWidth/2)-150), ((screenHeight/2)-100) to ((screenWidth/2)+150), ((screenHeight/2)+100), "Next_level", "Next Level"
1512
+	window set  "Next_level", "MinimumTo", 300,200
1513
+	window set  "Next_level", "MaximumTo", 300,200			
1514
+	window set "Next_level", "look", "Bordered"	
1515
+	DRAW SET "BGColor",0,0,0, "Next_level"
1516
+	//err = draw image 20,20, Grafikverzeichnis$+"Well_done.png", "Next_level"	
1517
+	BUTTON IMAGE 30,35 , "level", Grafikverzeichnis$+"Well_done.png" , Grafikverzeichnis$+"Well_done.png", Grafikverzeichnis$+"Well_done.png","Next_level"
1518
+	//BUTTON 20,120 TO 120,130, "level", "Next Level", "Next_level"
1519
+end sub
1520
+
1521
+sub anzahl_level_abfragen()
1522
+	//print dir$=prg_dir$+"/levels/"+level$	
1523
+	
1524
+	levels_zaehlen$=system$("find "+game_dir$+"/levels/"+level$+"/level*.dat -maxdepth 1")
1525
+	dim zeilen$(1)
1526
+	//print levels_zaehlen$
1527
+	numElements = split(levels_zaehlen$, zeilen$(),"\n")
1528
+	//print numElements
1529
+	bc=0
1530
+	for abc = 1 to numElements 
1531
+			bc=bc+1
1532
+			dim levelnamen$(bc)
1533
+			levelnamen$(bc) = zeilen$(abc)
1534
+			//print "Bc"+str$(bc)
1535
+	//print levelnamen$(bc)
1536
+	next abc		
1537
+	if (level$="Easy") then		
1538
+		maxanzahl_level=10		
1539
+		if (bc>maxanzahl_level) then		
1540
+			anzahl_level=10			
1541
+		else		
1542
+				anzahl_level=bc-1
1543
+		endif					
1544
+	elseif (level$="Middle") then		
1545
+		maxanzahl_level=10		
1546
+		if (bc>maxanzahl_level) then		
1547
+			anzahl_level=10			
1548
+		else		
1549
+				anzahl_level=bc-1
1550
+		endif		
1551
+	elseif (level$="Heavy") then		
1552
+		maxanzahl_level=10		
1553
+		if (bc>maxanzahl_level) then		
1554
+			anzahl_level=10			
1555
+		else		
1556
+				anzahl_level=bc-1
1557
+		endif		
1558
+	endif	
1559
+		
1560
+ 	//print anzahl_level
1561
+end sub
1562
+
1563
+rem ENDGAME
1564
+sub endgame()	
1565
+	window open ((screenWidth/2)-170), ((screenHeight/2)-180) to ((screenWidth/2)+170), ((screenHeight/2)+180), "Endgame", "Highscore"
1566
+	window set  "Endgame", "MinimumTo", 360,320
1567
+	window set  "Endgame", "MaximumTo", 360,320		
1568
+	window set "Endgame", "look", "Bordered"	
1569
+	draw set "Bgcolor", 0,0,0, "Endgame"		
1570
+	stopp=1
1571
+	err = draw image 0,20, Grafikverzeichnis$+winner$, "Endgame"	
1572
+	TEXTCONTROL 25,240 TO 320,250, "Spielername", "", "Name", "Endgame" 
1573
+	BUTTON 30,270 TO 320,290, "Speichern", "Save", "Endgame"
1574
+	
1575
+end sub
1576
+
1577
+
1578
+REM HIGHSCORE
1579
+sub highscore_speichern(Auswahl_Spielfigur$,spielername$,Punkte$,level$,level_nr$,schritte$,lives$)
1580
+	
1581
+	Auswahl_Spielfigur1$=left$(Auswahl_Spielfigur$, len(Auswahl_Spielfigur$)-4)+"1.png"
1582
+	//print  "Auswahl_Spielfigur1$"+Auswahl_Spielfigur1$
1583
+	filewrite$=spielstand_dir$+"/"+level$+"_highscore.csv"
1584
+	handle=1
1585
+	handle = open(filewrite$, "a")		
1586
+		print #handle Auswahl_Spielfigur1$+";"+Punkte$+";"+spielername$+";"+level$+";"+level_nr$+";"+schritte$+";"+lives$		
1587
+
1588
+	close(handle)
1589
+	output$=system$("sort -nrk2.1 -o "+ spielstand_dir$+"/"+level$+"_highscore.csv"+" "+spielstand_dir$+"/"+level$+"_highscore.csv")	
1590
+	//Gesamt Spielstand 	
1591
+	filewrite$=spielstand_dir$+"/"+"gesamt_highscore.csv"
1592
+	handle=1
1593
+	handle = open(filewrite$, "a")		
1594
+		print #handle Auswahl_Spielfigur1$+";"+Punkte$+";"+spielername$+";"+level$+";"+level_nr$+";"+schritte$+";"+lives$		
1595
+
1596
+	close(handle)
1597
+	output$=system$("sort -nro"+ spielstand_dir$+"/"+"gesamt_highscore.csv"+" "+spielstand_dir$+"/"+"gesamt_highscore.csv")
1598
+end sub
1599
+
1600
+sub highscore(level$,initial)
1601
+	print level$
1602
+	print initial
1603
+	//if (initial=1) then			
1604
+
1605
+	
1606
+//	elseif (initial=0) then	
1607
+		COLUMNBOX CLEAR "Highscore"
1608
+//	endif
1609
+	COLUMNBOX COLUMN "Highscore","", 1, 33, 33, 33, "align-left"
1610
+	COLUMNBOX COLUMN "Highscore","Points", 2, 57, 57, 57, "align-left"	
1611
+	COLUMNBOX COLUMN "Highscore","Playername", 3, 125, 125, 125, "align-left"
1612
+	COLUMNBOX COLUMN "Highscore","Level", 4, 60,60,60, "align-left"
1613
+	COLUMNBOX COLUMN "Highscore","L-NR", 5, 50, 50, 50, "align-left"
1614
+	COLUMNBOX COLUMN "Highscore","Moves", 6, 60,60,60, "align-left"	
1615
+	COLUMNBOX COLUMN "Highscore","Lives", 7, 54, 54, 54, "align-left"	
1616
+	BUTTON x1,y1+360 TO x1+60,y1+380, "ok", "OK", "hgscore"	
1617
+	BUTTON x1+100,y1+360 TO x1+160,y1+380, "HGEasy", "Easy", "hgscore"
1618
+	BUTTON x1+200,y1+360 TO x1+260,y1+380, "HGMiddle", "Middle", "hgscore"
1619
+	BUTTON x1+300,y1+360 TO x1+360,y1+380, "HGHeavy", "Heavy", "hgscore"	
1620
+	BUTTON x1+400,y1+360 TO x1+460,y1+380, "HGReset", "Reset", "hgscore"
1621
+	highscore_laden(level$,initial)
1622
+end sub
1623
+
1624
+sub highscore_laden(level$,initial)
1625
+	
1626
+	local x
1627
+	local d
1628
+	local i
1629
+	numElements=0
1630
+	x=0:f=0:i=0
1631
+					
1632
+	spielstandload$=spielstand_dir$+"/"+level$+"_highscore.csv"	
1633
+	auslesen_spielstand=open(spielstandload$, "r")
1634
+	
1635
+	while (not EOF(auslesen_spielstand))
1636
+		line input #auslesen_spielstand spielst_b$
1637
+		dim elements$(1)
1638
+		numElements = split(spielst_b$, elements$(),";")
1639
+		
1640
+		for i = 1 to numElements
1641
+			x=x+1
1642
+			dim spielst_d$(x)
1643
+			spielst_d$(x) = elements$(i)
1644
+			
1645
+		next i
1646
+	wend
1647
+	close(auslesen_spielstand)
1648
+			
1649
+	anzahlspalten=numElements	
1650
+	anzahlzeilen=x/anzahlspalten
1651
+	
1652
+	//print anzahlspalten
1653
+	//print anzahlspalten
1654
+	if (anzahlspalten>1) then	
1655
+		gg=0	
1656
+		for sa = 1 to anzahlzeilen				
1657
+			for sb = 1 to anzahlspalten		
1658
+				gg=gg+1				
1659
+				if (instr(spielst_d$(gg),".png")) then
1660
+				//"__Icon__="+dir_li$+"/"+dateiname_ohne_li$
1661
+					
1662
+					COLUMNBOX ADD "Highscore", sb, sa, 32, "__Icon__="+Grafikverzeichnis$+spielst_d$(gg)
1663
+				else
1664
+					COLUMNBOX ADD "Highscore", sb, sa, 32, spielst_d$(gg)
1665
+				endif
1666
+				
1667
+			next sb					
1668
+		next sa		
1669
+	else
1670
+		//print "highscore"
1671
+		COLUMNBOX ADD "Highscore", 1, 2, 20, "Keine Eintr├Ąge"
1672
+	endif
1673
+end sub
1674
+
1675
+sub highscore_reset(level$,programmstart)	
1676
+//print programmstart
1677
+	
1678
+	
1679
+		filewrite$=spielstand_dir$+"/"+level$+"_highscore.csv"
1680
+		handle=1
1681
+		handle = open(filewrite$, "w")		
1682
+		//print #handle "test;test;test;test;test;test;test"
1683
+		close(handle)
1684
+	if (programmstart=1) then
1685
+	else
1686
+		initial=0	
1687
+	//	highscore_laden(level$,initial)	
1688
+	endif
1689
+end sub
1690
+
1691
+
1692
+sub Vorbereitung(Auswahl_Spielfigur$,Auswahl_Spielfigur_ri$,Auswahl_Spielfigur_up$,Auswahl_Spielfigur_down$,Auswahl_Spielfigur_le$,rand$,final$,target$,item$,monster_ri$,monster_le$,monster_up$,monster_down$,bustet$,winner$,monster_ri2$,monster_le2$,monster_up2$,monster_down2$,monster2$)
1693
+
1694
+view 0,384 to Breite_Views,430, "Statusanzeige", Bildschirm$
1695
+draw set "BGcolor", 0,0,0,"Statusanzeige"
1696
+view 0,430 to Breite_Views,600, "Lebenanzeige", Bildschirm$
1697
+draw set "BGcolor", 0,0,0,"Lebenanzeige"
1698
+	
1699
+bitmap 32,32, "wall"
1700
+err = draw image 0,0 to 31,31, Grafikverzeichnis$+rand$, "wall"
1701
+bitmap 32,32, "blank"
1702
+err = draw image 0,0 to 31,31, Grafikverzeichnis$+"blank1.png", "blank"
1703
+bitmap 32,32, "spieler"
1704
+err = err + draw image 0,0 to 31,31, Grafikverzeichnis$+Auswahl_Spielfigur$, "spieler"
1705
+bitmap 32,32, "spieler_ri"
1706
+err = err + draw image 0,0 to 31,31, Grafikverzeichnis$+Auswahl_Spielfigur_ri$, "spieler_ri"
1707
+bitmap 32,32, "spieler_up"
1708
+err = err + draw image 0,0 to 31,31, Grafikverzeichnis$+Auswahl_Spielfigur_up$, "spieler_up"
1709
+bitmap 32,32, "spieler_down"
1710
+err = err + draw image 0,0 to 31,31, Grafikverzeichnis$+Auswahl_Spielfigur_down$, "spieler_down"
1711
+bitmap 32,32, "spieler_le"
1712
+err = err + draw image 0,0 to 31,31, Grafikverzeichnis$+Auswahl_Spielfigur_le$, "spieler_le"
1713
+bitmap 32,32, "bulb"
1714
+err = err + draw image 0,0 to 31,31, Grafikverzeichnis$+item$, "bulb"
1715
+bitmap 32,32, "target"
1716
+err = err + draw image 0,0 to 31,31, Grafikverzeichnis$+target$, "target"
1717
+bitmap 32,32, "final"
1718
+err = err + draw image 0,0 to 31,31,Grafikverzeichnis$+ final$, "final"
1719
+bitmap 32,32, "monster"
1720
+err = err + draw image 0,0 to 31,31,Grafikverzeichnis$+ monster$, "monster"
1721
+bitmap 32,32, "monster_ri"
1722
+err = err + draw image 0,0 to 31,31, Grafikverzeichnis$+monster_ri$, "monster_ri"
1723
+bitmap 32,32, "monster_up"
1724
+err = err + draw image 0,0 to 31,31, Grafikverzeichnis$+monster_up$, "monster_up"
1725
+bitmap 32,32, "monster_down"
1726
+err = err + draw image 0,0 to 31,31, Grafikverzeichnis$+monster_down$, "monster_down"
1727
+bitmap 32,32, "monster_le"
1728
+err = err + draw image 0,0 to 31,31, Grafikverzeichnis$+monster_le$, "monster_le"
1729
+bitmap 32,32, "monster2"
1730
+err = err + draw image 0,0 to 31,31,Grafikverzeichnis$+ monster$, "monster2"
1731
+bitmap 32,32, "monster_ri2"
1732
+err = err + draw image 0,0 to 31,31, Grafikverzeichnis$+monster_ri$, "monster_ri2"
1733
+bitmap 32,32, "monster_up2"
1734
+err = err + draw image 0,0 to 31,31, Grafikverzeichnis$+monster_up$, "monster_up2"
1735
+bitmap 32,32, "monster_down2"
1736
+err = err + draw image 0,0 to 31,31, Grafikverzeichnis$+monster_down$, "monster_down2"
1737
+bitmap 32,32, "monster_le2"
1738
+err = err + draw image 0,0 to 31,31, Grafikverzeichnis$+monster_le$, "monster_le2"
1739
+
1740
+bitmap 32,32, "background"
1741
+draw set "highcolor", 0,0,0, "background"
1742
+draw rect 0,0 to 31,31, "background"
1743
+
1744
+//if(err>0) then
1745
+//	alert "Could not load images", "Ok", "stop"
1746
+//	window close Bildschirm$
1747
+//	exit(1)
1748
+//endif
1749
+
1750
+option set Bildschirm$, "focus", true
1751
+canvas 0,0 to Breite_Views,384, "Canvas", Bildschirm$
1752
+draw set "highcolor", 0,0,0, "Canvas"
1753
+draw rect 0,0 to Breite_Views,384, "Canvas"
1754
+
1755
+
1756
+anzahl_level_abfragen()
1757
+
1758
+start()	
1759
+
1760
+end sub
1761
+
1762
+sub level_stop()
1763
+	window open ((screenWidth/2)-170), ((screenHeight/2)-180) to ((screenWidth/2)+170), ((screenHeight/2)+180), "Weiter", "Highscore"
1764
+	window set  "Weiter", "MinimumTo", 360,320
1765
+	window set  "Weiter", "MaximumTo", 360,320	
1766
+	BUTTON 20,270 TO 120,290, "Weiter", "Weiter", "Weiter"
1767
+end sub
1768
+
1769
+sub Gotcha()
1770
+	window open ((screenWidth/2)-140), ((screenHeight/2)-120) to ((screenWidth/2)+140), ((screenHeight/2)+120), "Gotcha", "Gotcha"
1771
+	window set  "Gotcha", "MinimumTo",280,240
1772
+	window set  "Gotcha", "MaximumTo", 280,240	
1773
+	window set "Gotcha", "look", "Bordered"		
1774
+	draw set  "Bgcolor",0,0,0,"Gotcha"	
1775
+	err = draw image 20,20, Grafikverzeichnis$+bustet$, "Gotcha"	
1776
+	BUTTON 90,200 TO 190,220, "NeuerVersuch", "New Chance", "Gotcha"
1777
+end sub
1778
+
1779
+sub hilfe()
1780
+	window open ((screenWidth/2)-230), ((screenHeight/2)-235) to ((screenWidth/2)+230), ((screenHeight/2)+235), "Hilfe", "Help"
1781
+	window set  "Hilfe", "MinimumTo", 460,470
1782
+	window set  "Hilfe", "MaximumTo",  460,470	
1783
+	window set "Hilfe", "look", "Bordered"		
1784
+	draw set  "Bgcolor",0,0,0,"Hilfe"	
1785
+	DRAW SET "HighColor",222,222,222,  "Hilfe"	
1786
+	Draw Set "lowColor",0,0,0, "Hilfe"	
1787
+	draw text 20,20 ,"Introduction the Game", "Hilfe"
1788
+	draw text 20,40 ,"Goal of this game, was to place the items on the", "Hilfe"	
1789
+	draw text 20,55  ,"target, but be careful that you not catch by the NP figure. ", "Hilfe"
1790
+	draw text 20,70 ,"Here you can see for example the available moves in the game.", "Hilfe"
1791
+	//DRAW BITMAP 20, 85 TO 40,90, Grafikverzeichnis$+"left.png", "Alpha", "Hilfe"				
1792
+
1793
+	err = draw image 20,90, Grafikverzeichnis$+"left.png", "Hilfe"
1794
+	err = draw image 20,120, Grafikverzeichnis$+"right.png", "Hilfe"
1795
+	err = draw image 20,150, Grafikverzeichnis$+"up.png", "Hilfe"
1796
+	err = draw image 20,180, Grafikverzeichnis$+"down.png", "Hilfe"
1797
+	err = draw image 20,210, Grafikverzeichnis$+"strg.png", "Hilfe"
1798
+	err = draw image 20,240, Grafikverzeichnis$+"shift.png", "Hilfe"
1799
+	err = draw image 20,270, Grafikverzeichnis$+"esc.png", "Hilfe"
1800
+	err = draw image 20,300, Grafikverzeichnis$+"n.png", "Hilfe"
1801
+	
1802
+	draw text 80,110 ,"Left: means, that the player walk left", "Hilfe"
1803
+	draw text 80,140 ,"Right: means, that the player walk right", "Hilfe"
1804
+	draw text 80,170 ,"Up: means, that the player walk up", "Hilfe"
1805
+	draw text 80,200,"Down: means, that the player walk down", "Hilfe"
1806
+	draw text 80,225 ,"Ctrl (Strg) + left: Item and your figure moves one field", "Hilfe"	
1807
+	draw text 80,240 ,"when its free to the left.", "Hilfe"
1808
+	draw text 80,260 ,"Shift + left: Push the Item to the next field, when its free", "Hilfe"	
1809
+	draw text 80,290,"ESC: Terminates the Programm", "Hilfe"
1810
+	draw text 80,320 ,"n: new Chance, but only you have one live left", "Hilfe"	
1811
+
1812
+
1813
+	draw text 20,365 ,"Your Points will be generated by a fix value per level and", "Hilfe"
1814
+	draw text 20,380 ,"the fix value per live minus our moves.", "Hilfe"
1815
+	draw text 20,395 ,"So for a good Result in the highscore table, don't make", "Hilfe"	
1816
+	draw text 20,410 ,"many moves and don't let you catch.", "Hilfe"	
1817
+
1818
+	BUTTON 20, 430 TO 120,450, "Zurueck", "Back", "Hilfe"	
1819
+end sub
1820
+sub AboutWindow()
1821
+ 	window open ((screenWidth/2)-200), ((screenHeight/2)-150) to ((screenWidth/2)+200), ((screenHeight/2)+150), "View_About", "About"
1822
+  	window set  "View_About", "MinimumTo", 400,300
1823
+  	window set  "View_About", "MaximumTo", 400,300
1824
+  	window set "View_About", "flags", "not-resizable, Not-Zoomable"  	
1825
+	window set "View_About", "look", "Bordered"		
1826
+	draw set  "Bgcolor",0,0,0,"View_About"	
1827
+	DRAW SET "HighColor",222,222,222,  "View_About"
1828
+	Draw Set "lowColor",0,0,0, "View_About"	
1829
+  	
1830
+  	DRAW SET "system-bold", "View_About"
1831
+  	DRAW TEXT 10,30, "BeSly Software Solutions", "View_About"
1832
+  	VIEW 0,50 TO 400,300, "View_About_Info", "View_About"
1833
+  	DRAW LINE 0,1 TO 400,1, "View_About_Info" 
1834
+  	 
1835
+ 	VIEW 0,2 TO 150,165, "View_About_Title", "View_About_Info"
1836
+  	//DRAW SET "BGColor", 255,255,255, "View_About_Title"
1837
+  	
1838
+  	draw set  "Bgcolor",0,0,0,"View_About_Title"	
1839
+	DRAW SET "HighColor",222,222,222,  "View_About_Title"
1840
+	Draw Set "lowColor",0,0,0, "View_About_Title"	
1841
+  	DRAW TEXT 10,30, "Name:", "View_About_Title"
1842
+  	DRAW TEXT 10,50, "Version / Build:", "View_About_Title"
1843
+  	DRAW TEXT 10,70, "Developers:", "View_About_Title"
1844
+  	DRAW TEXT 10,90, "Graphics:", "View_About_Title"
1845
+  	DRAW TEXT 10,110, "Levels:", "View_About_Title"
1846
+  	DRAW TEXT 10,130, "Contact:", "View_About_Title"
1847
+  	DRAW TEXT 10,150, "Website:", "View_About_Title"
1848
+  	//DRAW Text 10,170, "Thanks", "View_About_Title"
1849
+  	
1850
+  	draw set  "Bgcolor",0,0,0,"View_About_Info"	
1851
+	DRAW SET "HighColor",222,222,222,  "View_About_Info"
1852
+	Draw Set "lowColor",0,0,0, "View_About_Info"	
1853
+	
1854
+  	VIEW 170,2 TO 400,165, "View_About_Entry", "View_About_Info"
1855
+  	//DRAW SET "BGColor", 255,255,255, "View_About_Entry"
1856
+  	draw set  "Bgcolor",0,0,0,"View_About_Entry"	
1857
+	DRAW SET "HighColor",222,222,222,  "View_About_Entry"
1858
+	Draw Set "lowColor",0,0,0, "View_About_Entry"	
1859
+  	DRAW TEXT 10,30, "Be Canny or be a Donkey", "View_About_Entry"
1860
+  	DRAW TEXT 10,50, "0.7.1 / 26.04.2017", "View_About_Entry"
1861
+  	DRAW TEXT 10,70, "Lorglas", "View_About_Entry"
1862
+  	DRAW TEXT 10,90, "Lorglas, Lelldorin",  "View_About_Entry"
1863
+  	DRAW TEXT 10,110, "Lorglas, Lelldorin",  "View_About_Entry"
1864
+  	TEXTURL 10,122, "email", "webmaster@besly.de", "webmaster@besly.de", "View_About_Entry"  	
1865
+  	TEXTURL 10,142, "website", "http://software.besly.de", "http://software.besly.de", "View_About_Entry"   	
1866
+  	DRAW TEXT 60,185, "Thanks for Lelldorin and Jan for the inspiration", "View_About_Info"
1867
+  	BUTTON 150,200 TO 250,220, "AboutClose", "OK", "View_About_Info"
1868
+end sub
1869
+sub IfExists(filename$)
1870
+	return not system("test -e "+filename$)
1871
+end sub
1872
+sub Bewegung2()
1873
+	if (Bewegung2<1 or Bewegung2>4) then
1874
+		Bewegung2=int(ran()*10)
1875
+	else
1876
+		//Bewegung2=int(ran()*10)
1877
+	endif
1878
+	return 	
1879
+end sub
0 1880
new file mode 100644
... ...
@@ -0,0 +1,281 @@
1
+DOC Installer Be_Canny_or_be_a_Donkey
2
+	
3
+screenWidth = peek("desktopwidth")
4
+screenHeight = peek("desktopheight")
5
+halfscreen_width=screenWidth/2
6
+halfscreen_height=screenHeight/2
7
+
8
+if(peek("isbound")) then
9
+	prg_dir$=peek$("directory")	
10
+else	
11
+	prg_dir$=system$("pwd")	
12
+	prg_dir$=left$(prg_dir$, len(prg_dir$)-1)		
13
+endif
14
+Grafikverzeichnis$=prg_dir$+"/Installer/"
15
+
16
+Bildschirm$="Win"
17
+x1=0: x2=x1+600: y1=0: y2=y1+300
18
+
19
+window open (halfscreen_width-300),(halfscreen_height-(y2/2)) to  (halfscreen_width+300),(halfscreen_height+(y2/2)), Bildschirm$, "Canny or Donkey Installer"
20