Advertisement
FireDiver

PandaRunner Beta 1.3.1

Aug 9th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 40.06 KB | None | 0 0
  1. ;Made by yt/FireDiver
  2. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  3. #AutoIt3Wrapper_Icon=icon.ico
  4. #AutoIt3Wrapper_UseUpx=y
  5. #AutoIt3Wrapper_Res_Description=PandaRunner
  6. #AutoIt3Wrapper_Res_Fileversion=0.3.1.1
  7. #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
  8. #AutoIt3Wrapper_Res_LegalCopyright=Alle Rechte liegen bei FireDiver (yt/FireDiver)
  9. #AutoIt3Wrapper_Res_Language=1031
  10. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  11. #include "G:\A2D\A2D.au3"
  12. #include <Misc.au3>
  13. #include <Crypt.au3>
  14. #include <Array.au3>
  15. #include <Zip.au3>
  16. #include <INet.au3>
  17. #include <Math.au3>
  18. #include <GUIConstantsEx.au3>
  19. #include <StaticConstants.au3>
  20. #include <ButtonConstants.au3>
  21. #include <SliderConstants.au3>
  22. #include <WindowsConstants.au3>
  23. Opt("GUIOnEventMode", 1)
  24. $settingsform = GUICreate("Einstellungen", 314, 437, 192, 124, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_WINDOWEDGE))
  25. $Label1 = GUICtrlCreateLabel("Spielgeschwindigkeit", 8, 8, 131, 20)
  26. GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
  27. $Label2 = GUICtrlCreateLabel("Sollte nur umgestellt werden, wenn das Spiel zu langsam läuft", 8, 32, 293, 17)
  28. $Slider1 = GUICtrlCreateSlider(8, 64, 302, 29)
  29. GUICtrlSetLimit(-1, 17, 2)
  30. GUICtrlSetData(-1, 10)
  31. GUICtrlSetOnEvent(-1, "SliderMoved")
  32. $Label3 = GUICtrlCreateLabel("<-- Schneller", 16, 96, 63, 17)
  33. $Label4 = GUICtrlCreateLabel("100 FPS", 136, 96, 45, 17)
  34. $Label5 = GUICtrlCreateLabel("Langsamer -->", 232, 96, 71, 17)
  35. $Button1 = GUICtrlCreateButton("Übernehmen", 8, 400, 147, 25)
  36. GUICtrlSetOnEvent(-1, "ApplyPressed")
  37. $Button2 = GUICtrlCreateButton("Zurücksetzen", 160, 400, 147, 25)
  38. GUICtrlSetOnEvent(-1, "ResetPressed")
  39. $Label7 = GUICtrlCreateLabel("Cheats", 8, 200, 46, 20)
  40. GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
  41. $Label8 = GUICtrlCreateLabel("Bei allen Cheats ist das speichern der Highscore deaktiviert", 8, 224, 283, 17)
  42. $Checkbox1 = GUICtrlCreateCheckbox("Unbesiegbarkeit", 8, 240, 97, 17)
  43. GUICtrlSetOnEvent(-1, "InfLPressed")
  44. $Checkbox2 = GUICtrlCreateCheckbox("Unendlich Jumpboost", 8, 256, 121, 17)
  45. GUICtrlSetOnEvent(-1, "InfJPressed")
  46. $Checkbox3 = GUICtrlCreateCheckbox("Unendlich Speedboost", 8, 272, 129, 17)
  47. GUICtrlSetOnEvent(-1, "InfBPressed")
  48. $Checkbox4 = GUICtrlCreateCheckbox("Mond", 160, 240, 97, 17)
  49. GUICtrlSetOnEvent(-1, "MoonPressed")
  50. $Button3 = GUICtrlCreateButton("Auf Update prüfen", 8, 160, 99, 33)
  51. GUICtrlSetOnEvent(-1, "UpdatePressed")
  52. $Checkbox5 = GUICtrlCreateCheckbox("MLG-Mode", 160, 256, 97, 17)
  53. GUICtrlSetOnEvent(-1, "MLGPressed")
  54. $Label9 = GUICtrlCreateLabel("Update", 8, 136, 49, 20)
  55. GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
  56. #cs
  57.     $Label6 = GUICtrlCreateLabel("Feedback", 208, 136, 66, 20)
  58.     GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
  59.     $Button4 = GUICtrlCreateButton("Feedback senden", 207, 159, 99, 33)
  60.     GUICtrlSetOnEvent(-1, "FeedBack")
  61. #ce
  62. GUISetState(@SW_HIDE, $settingsform)
  63. If FileExists(@TempDir & "\pandar_upd.bat") Then FileDelete(@TempDir & "\pandar_upd.bat")
  64. If Not FileExists(@ScriptDir & "\Data") Then
  65.     SplashTextOn("Entpacke...", "Dateien werden Entpackt...", 200, 70)
  66.     FileInstall("G:\A2D\Panda\d.zip", @TempDir & "\panda_d.zip", 1)
  67.     _Zip_UnzipAll(@TempDir & "\panda_d.zip", @ScriptDir & "\", 1)
  68.     Sleep(7500) ;Nur zur Sicherheit
  69.     SplashOff()
  70. EndIf
  71. If Not FileExists(@ScriptDir & "\Data\Images\rain.png") Then FileInstall("G:\A2D\Panda\Data\Images\rain.png", @ScriptDir & "\Data\Images\rain.png")
  72. If Not FileExists(@ScriptDir & "\Data\Images\fisch.png") Then
  73.     If FileExists(@ScriptDir & "\Data\Images\tr1.jpg") Then FileDelete(@ScriptDir & "\Data\Images\tr1.jpg")
  74.     FileInstall("G:\A2D\Panda\Data\Images\tr1.png", @ScriptDir & "\Data\Images\tr1.png")
  75.     FileInstall("G:\A2D\Panda\Data\Images\fisch.png", @ScriptDir & "\Data\Images\fisch.png")
  76.     FileInstall("G:\A2D\Panda\Data\Images\mfisch.png", @ScriptDir & "\Data\Images\mfisch.png")
  77.     FileInstall("G:\A2D\Panda\Data\Images\mbfisch.png", @ScriptDir & "\Data\Images\mbfisch.png")
  78.     FileInstall("G:\A2D\Panda\Data\Images\vfische.png", @ScriptDir & "\Data\Images\vfische.png")
  79.     FileInstall("G:\A2D\Panda\Data\Images\vfische2.png", @ScriptDir & "\Data\Images\vfische2.png")
  80. EndIf
  81. If FileExists(@ScriptDir & "\Data\settings.ini") Then FileDelete(@ScriptDir & "\Data\settings.ini")
  82. Dim $gsp = 10, $anti_t, $lasttree = 1, $MaxTerrObj = 30, $TerrObj[1000][10], $hscore = 0, $injump = 0, $jumpvel = 0, $Step = 0, $t, $Gravity = 0.3, $MaxJumpVel, $bla, $score = 0, $standardJumpValue = 8, $OldJumpValue = 8, $pause = 0, $scorecount = 0, $StageSpeed = 5, $ExtraTerrActive = 0, $ExtraTerr
  83. Dim $Invincible = 0, $falling = 0, $Timer = 0, $OldStageSpeed, $SpawnSpeed = 1650, $panda_an = 0, $panda1, $LastGenerated = 0, $SPPOS[10], $Zahl, $lZahl = 0, $HighScore = 0, $HighScoreName = "", $line[10], $tree[10][10], $size[5], $SSpeed, $BossFight = 0
  84. Dim $down = 0, $pause = 0, $RemJump, $RemBoost, $panda_m = 3, $inm = 0, $p_enter = 0, $GameVersion = "Beta v1.3.1", $Active = 1, $baggerAn[6], $Bagger[6], $bosscount = 0, $ban = 1, $throw = 0, $tt, $bla2, $SGravity = 0.3, $Sjumpvel, $StoneX, $StoneY, $rev = 0, $laying = 0, $ll = 0
  85. Dim $RainY = -1300, $RainY2 = -1000, $RainH = 1300, $raining = 0, $rpf[100][100], $MaxRpf = 0, $rfall = 0, $infiniteBoost = 0, $infiniteJump = 0, $moon = 0, $throwAN = 0, $lcount = 0, $running = 0,$WaterY = 721,$rcount = 0,$spoint = 1000,$WaterDone = 0,$WaterCount = 0
  86. Dim $WaterCountdown = 0,$ResetWaterObjects = 0,$MLG = 0,$degr = 0
  87. $anti_t = Random(30, 90, 1)
  88. $HighScore = _A2D_Decrypt(@ScriptDir & "\Data\score.a2d")
  89. AdlibRegister("_Resize", 500)
  90. _A2D_Startup("PandaRunner", 900, 720, 900, 720, 2, 1, 5)
  91. $clear = _A2D_LoadImage(@ScriptDir & "\Data\Images\clear.jpg")
  92. $Logo = _A2D_LoadImage(@ScriptDir & "\Data\Images\BG.jpeg")
  93. _A2D_MapDraw($clear, 900, 720, 1)
  94. _A2D_DrawBitMap($Logo, 0, 0, 900, 720)
  95. _A2D_Buffer()
  96. For $count = 1 To 3 Step +1
  97.     Assign("panda" & $count, _A2D_LoadImage(@ScriptDir & "\Data\Images\panda\panda" & $count & ".jpg"))
  98. Next
  99. $hHsc = $HighScore * $anti_t
  100. $lfisch = _A2D_LoadImage(@ScriptDir & "\Data\Images\fisch.png")
  101. $vfische1 = _A2D_LoadImage(@ScriptDir & "\Data\Images\vfische.png")
  102. $vfische2 = _A2D_LoadImage(@ScriptDir & "\Data\Images\vfische2.png")
  103. $mfisch = _A2D_LoadImage(@ScriptDir & "\Data\Images\mfisch.png")
  104. $mbfisch = _A2D_LoadImage(@ScriptDir & "\Data\Images\mbfisch.png")
  105. $stone = _A2D_LoadImage(@ScriptDir & "\Data\Images\stone.png")
  106. $rain = _A2D_LoadImage(@ScriptDir & "\Data\Images\rain.png")
  107. $matsch = _A2D_LoadImage(@ScriptDir & "\Data\Images\matsch.jpg")
  108. $grass = _A2D_LoadImage(@ScriptDir & "\Data\Images\grass.jpg")
  109. $pandaj = _A2D_LoadImage(@ScriptDir & "\Data\Images\panda\pandaj.jpg")
  110. $pandab = _A2D_LoadImage(@ScriptDir & "\Data\Images\pandab.jpg")
  111. $boden = _A2D_LoadImage(@ScriptDir & "\Data\Images\boden.jpg")
  112. $jumpb = _A2D_LoadImage(@ScriptDir & "\Data\Images\jumpb.jpg")
  113. $schlucht = _A2D_LoadImage(@ScriptDir & "\Data\Images\schlucht.jpg")
  114. $tr_ex = _A2D_LoadImage(@ScriptDir & "\Data\Images\tr_ex.jpg")
  115. $tr1 = _A2D_LoadImage(@ScriptDir & "\Data\Images\tr1.png")
  116. $tr2 = _A2D_LoadImage(@ScriptDir & "\Data\Images\tr2.jpg")
  117. $size[1] = 550 * 0.5
  118. $size[2] = 550 * 0.5
  119. $size[3] = 550 * 0.5
  120. $size[4] = 250 * 0.5
  121. For $count = 1 To 5 Step +1
  122.     $baggerAn[$count] = _A2D_LoadImage(@ScriptDir & "\Data\Images\bagger\bagger" & $count & ".png")
  123. Next
  124. For $count = 1 To 4 Step +1
  125.     $tree[$count][0] = _A2D_LoadImage(@ScriptDir & "\Data\Images\tree" & $count & ".png")
  126.     $tree[$count][4] = $size[$count]
  127. Next
  128. _A2D_ObjCreate($panda1, 100, 380, 25, 50, "Panda")
  129. _A2D_ObjStatus("Panda", 1)
  130. $Bagger[1] = 540 ;X
  131. $Bagger[2] = 157 ;Y
  132. $Bagger[3] = 350 ;Width
  133. $Bagger[4] = 300 ;Height
  134. _A2D_ObjCreate($baggerAn[1], $Bagger[1], $Bagger[2], $Bagger[3], $Bagger[4], "Bagger")
  135. _A2D_ObjStatus("Bagger", 1)
  136. $PandaW = 25
  137. $PandaH = 50
  138. $PandaX = 100
  139. $PandaY = 380
  140. For $count = 1 To 4 Step +1
  141.     $tree[$count][2] = $count * 1000
  142. Next
  143. ;Sleep(5000)
  144. _GenTerrain()
  145. $hDLL = DllOpen("user32.dll")
  146. AdlibRegister("_GenTerrain", $SpawnSpeed)
  147. ;AdlibRegister("_Animate", 100)
  148. $running = 0
  149. $ch = 1
  150. HotKeySet("{ESC}", "_go")
  151. ;_Boss()
  152. AdlibRegister("_Draw", 10)
  153. Func _pause()
  154.     If $running = 0 Or $falling = 1 Then Return -1
  155.     Switch $pause
  156.         Case 0
  157.             AdlibUnRegister("_GenTerrain")
  158.             $OldStageSpeed = $StageSpeed
  159.             $StageSpeed = 0
  160.             $pause = 1
  161.         Case 1
  162.             $StageSpeed = $OldStageSpeed
  163.             $pause = 0
  164.             AdlibRegister("_GenTerrain", $SpawnSpeed)
  165.     EndSwitch
  166. EndFunc   ;==>_pause
  167. Func _stopboost()
  168.     If $infiniteBoost = 0 Then $RemBoost -= 10
  169.     If $RemBoost = 0 Then
  170.         $StageSpeed = $OldStageSpeed
  171.         $Invincible = 0
  172.         AdlibRegister("_GenTerrain", $SpawnSpeed)
  173.         AdlibUnRegister("_stopgen")
  174.         AdlibUnRegister("_stopboost")
  175.     EndIf
  176. EndFunc   ;==>_stopboost
  177. Func _stopgen()
  178.     AdlibUnRegister("_GenTerrain")
  179. EndFunc   ;==>_stopgen
  180. Func _jump()
  181.     If $injump = 1 Then Return -1
  182.     $t = 0
  183.     $bla = 0
  184.     $injump = 1
  185.     $spoint = $PandaY + 3
  186.     $jumpvel = $standardJumpValue
  187.     ;$Gravity = 0.3
  188. EndFunc   ;==>_jump
  189. Func _Difference($1, $2)
  190.     If $1 > $2 Then
  191.         Return $1 - $2
  192.     ElseIf $2 > $1 Then
  193.         Return $2 - $1
  194.     ElseIf $2 = $1 Then
  195.         Return 0
  196.     EndIf
  197. EndFunc   ;==>_Difference
  198. Func _ReCalcDistance($rcd = 1)
  199.     Switch $rcd
  200.         Case 1
  201.             $oX = Random(901, 2901, 1)
  202.             $exit = 0
  203.             While $exit = 0
  204.                 $n = 0
  205.                 For $tcount = 1 To $MaxTerrObj Step +1
  206.                     Switch $TerrObj[$tcount][0]
  207.                         Case 1 To 5
  208.                             If _Difference($oX, $TerrObj[$tcount][1]) < 60 And _Difference($oX, $TerrObj[$tcount][1] + $TerrObj[$tcount][2]) < 60 Then
  209.                                 $oX = Random(901, 2901, 1)
  210.                                 $n = 1
  211.                             EndIf
  212.                         Case 7 to 10
  213.                             If _Difference($oX, $TerrObj[$tcount][1]) < 60 And _Difference($oX, $TerrObj[$tcount][1] + $TerrObj[$tcount][2]) < 60 Then
  214.                                 $oX = Random(901, 2901, 1)
  215.                                 $n = 1
  216.                             EndIf
  217.                     EndSwitch
  218.                 Next
  219.                 If $n = 0 Then
  220.                     Return $oX
  221.                 EndIf
  222.             WEnd
  223.         Case 2
  224.             $oX = Random(1, 2901, 1)
  225.             $exit = 0
  226.             While $exit = 0
  227.                 $n = 0
  228.                 For $tcount = 1 To $MaxTerrObj Step +1
  229.                     Switch $TerrObj[$tcount][0]
  230.                         Case 1 To 5
  231.                             If _Difference($oX, $TerrObj[$tcount][1]) < 60 And _Difference($oX, $TerrObj[$tcount][1] + $TerrObj[$tcount][2]) < 60 Then
  232.                                 $oX = Random(1, 2901, 1)
  233.                                 $n = 1
  234.                             EndIf
  235.                         Case 7 to 10
  236.                             If _Difference($oX, $TerrObj[$tcount][1]) < 60 And _Difference($oX, $TerrObj[$tcount][1] + $TerrObj[$tcount][2]) < 60 Then
  237.                                 $oX = Random(1, 2901, 1)
  238.                                 $n = 1
  239.                             EndIf
  240.                     EndSwitch
  241.                 Next
  242.                 If $n = 0 Then
  243.                     Return $oX
  244.                 EndIf
  245.             WEnd
  246.     EndSwitch
  247. EndFunc   ;==>_ReCalcDistance
  248. Func _CheckType($tp)
  249.     Switch $tp
  250.         Case 1 To 10
  251.             Return 2
  252.         Case Else
  253.             Return 1
  254.     EndSwitch
  255. EndFunc   ;==>_CheckType
  256. Func _TerrCreate($bm, $y, $w, $h, $it, $t, $e1,$abc = 1)
  257.     If $abc = 1 Then
  258.         $oX = _ReCalcDistance()
  259.     Else
  260.         $oX = _ReCalcDistance(2)
  261.     EndIf
  262.     For $tcount = 1 To $MaxTerrObj Step +1
  263.         If _CheckType($TerrObj[$tcount][0]) = 1 Then
  264.             If $TerrObj[$tcount][0] = -1 Then
  265.                 _A2D_ObjUpdate("tr" & $tcount, $bm, $oX, $y, $w, $h, $t, $e1, $tcount)
  266.                 _A2D_ObjStatus("tr" & $tcount, 1)
  267.             Else
  268.                 _A2D_ObjCreate($bm, $oX, $y, $w, $h, "tr" & $tcount, $t, $e1, $tcount)
  269.                 _A2D_ObjStatus("tr" & $tcount, 1)
  270.             EndIf
  271.             $TerrObj[$tcount][0] = $it
  272.             $TerrObj[$tcount][1] = $oX
  273.             $TerrObj[$tcount][2] = $w ;width
  274.             $TerrObj[$tcount][3] = $h ;height
  275.             $TerrObj[$tcount][4] = $y ;y
  276.             $TerrObj[$tcount][6] = False
  277.             ExitLoop
  278.         EndIf
  279.     Next
  280. EndFunc   ;==>_TerrCreate
  281. Func _idle()
  282.     AdlibUnRegister("_Draw")
  283.     $Active = 0
  284.     Do
  285.         If WinGetState("PandaRunner") = 5 Then
  286.             _A2D_Shutdown()
  287.             Exit
  288.         EndIf
  289.         Sleep(100)
  290.     Until WinActive("PandaRunner")
  291.     $Active = 1
  292.     GUISetState(@SW_HIDE, $settingsform)
  293.     AdlibRegister("_Draw", $gsp)
  294. EndFunc   ;==>_idle
  295. Func _Resize()
  296.     If Not WinActive("PandaRunner") Then _idle()
  297.     $size2 = WinGetClientSize("PandaRunner")
  298.     If $size2[0] <> 900 Or $size2[1] <> 720 Then
  299.         $pos = WinGetPos("PandaRunner")
  300.         WinMove("PandaRunner", "", $pos[0], $pos[1], 900, 720)
  301.     EndIf
  302. EndFunc   ;==>_Resize
  303. Func _GenTerrain()
  304.     If Not WinActive("PandaRunner") Then _idle()
  305.     If $WaterY <= 129 Then
  306.         If Random(1,3,1) = 1 Then _TerrCreate($lfisch, Random(140,600,1), 50, 30, 7, 2, 2)
  307.         _TerrCreate($mfisch, Random(140,600,1), 150, 75, 8, 2, 1)
  308.         For $gencount = 1 to 2 Step +1
  309.             Switch Random(1,2,1)
  310.                 Case 1
  311.                     _TerrCreate($vfische1, Random(140,600,1), 150, 75, 10, 2, 2)
  312.                 Case 2
  313.                     _TerrCreate($vfische2, Random(140,600,1), 150, 75, 10, 2, 2)
  314.             EndSwitch
  315.         Next
  316.         If Random(1,4,1) = 1 Then _TerrCreate($mbfisch, Random(140,600,1), 200, 100, 9, 2, 2)
  317.         Return
  318.     EndIf
  319.     If Random(1, 3, 1) = 1 Then ;Bäume
  320.         $oX = Random(901, 2901, 1)
  321.         $exit = 0
  322.         While $exit = 0
  323.             $n = 0
  324.             For $count = 1 To 4 Step +1
  325.                 If $tree[$count][1] = 1 And _Difference($oX, $tree[$count][2]) < 250 Then
  326.                     $oX = Random(901, 2901, 1)
  327.                     $n = 1
  328.                 ElseIf $count = 4 And $n = 0 Then
  329.                     $exit = 1
  330.                 EndIf
  331.             Next
  332.         WEnd
  333.         $lasttree = $oX
  334.         For $count = 1 To 4 Step +1
  335.             If $tree[$count][1] <> 1 Then
  336.                 $tree[$count][1] = 1
  337.                 $tree[$count][2] = $oX
  338.                 ExitLoop
  339.             EndIf
  340.         Next
  341.     EndIf
  342.     If Random(1, 30, 1) = 1 Then ;Speedboost
  343.         _TerrCreate($tr_ex, 400, 23, 30, 2, 2, 2)
  344.     EndIf
  345.     If Random(1, 20, 1) = 1 Then ;JumpBoost
  346.         _TerrCreate($jumpb, 400, 23, 30, 5, 2, 2)
  347.     EndIf
  348.     If Random(1, 3, 1) = 1 Then ;Babypandas
  349.         _TerrCreate($pandab, 400, 23, 30, 3, 2, 3)
  350.     EndIf
  351.     If Random(1, 17, 1) = 1 And $raining = 0 And $rfall = 0 And $WaterY > 429 Then ;Regen
  352.         $rcount = 0
  353.         $rfall = 1
  354.         $raining = 1
  355.         $RainY = -1600
  356.         $RainY2 = -1600
  357.         AdlibRegister("_disRain", Random(8000, 20000, 1))
  358.     EndIf
  359.     If Random(1, 5, 1) = 1 Then ;Schlucht
  360.         $oX = _ReCalcDistance()
  361.         For $tcount = 1 To $MaxTerrObj Step +1
  362.             If _CheckType($TerrObj[$tcount][0]) = 1 Then
  363.                 If $TerrObj[$tcount][0] = -1 Then
  364.                     _A2D_ObjUpdate("tr" & $tcount, $schlucht, $oX, 430, 75, 290, 2, 1, $tcount)
  365.                     _A2D_ObjStatus("tr" & $tcount, 1)
  366.                 Else
  367.                     _A2D_ObjCreate($schlucht, $oX, 430, 75, 290, "tr" & $tcount, 2, 1, $tcount)
  368.                     _A2D_ObjStatus("tr" & $tcount, 1)
  369.                 EndIf
  370.                 $TerrObj[$tcount][0] = 4
  371.                 $TerrObj[$tcount][1] = $oX + ($PandaW - 1) ;x + pandawidth
  372.                 $TerrObj[$tcount][2] = 75 - ($PandaW - 1);width - pandawidth
  373.                 $TerrObj[$tcount][3] = 290 ;height
  374.                 $TerrObj[$tcount][4] = 429 ;y
  375.                 $TerrObj[$tcount][7] = 0 ;y
  376.                 ExitLoop
  377.             EndIf
  378.         Next
  379.     EndIf
  380.     If $raining = 1 Then ;Matsch
  381.         _TerrCreate($matsch, 429, 75, 10, 6, 2, 3,2)
  382.     EndIf
  383.     $NorTerr = Random(1, 2, 1) ;Hindernis
  384.     _TerrCreate(Eval("tr" & $NorTerr), 400, 50, 30, 1, 2, 1)
  385. EndFunc   ;==>_GenTerrain
  386. Func _MoveTerrain()
  387.     ;ConsoleWrite(@CRLF & $WaterCount)
  388.     For $count = 1 To 4 Step +1
  389.         If $tree[$count][1] = 1 Then
  390.             If $tree[$count][2] >= ($tree[$count][4] * -1) Then
  391.                 $tree[$count][2] -= $StageSpeed
  392.                 ;ConsoleWrite(@CRLF & $count)
  393.                 If $MLG = 1 Then _QuickDraw_RotateNext( $tree[$count][2]+($tree[$count][4]/2), 120+(330/2), $degr )
  394.                 _A2D_DrawBitMap($tree[$count][0], $tree[$count][2], 120, $tree[$count][4], 330);$tree[$count][3],$tree[$count][4])
  395.             Else
  396.                 $tree[$count][1] = -1
  397.             EndIf
  398.         EndIf
  399.     Next
  400.     $gx = 0
  401.     ;For $count = 1 to 18 Step +1
  402.     If $WaterY > 420 Then
  403.         If $MLG = 1 Then _QuickDraw_RotateNext( 450, 420, $degr )
  404.         _A2D_DrawBitMap($grass, 0, 410, 900, 20)
  405.         ;$gx += 50
  406.         ;Next
  407.         For $count = 1 To $MaxTerrObj Step +1
  408.             If $TerrObj[$count][0] >= 1 And $TerrObj[$count][0] <> 4 And $TerrObj[$count][0] <> 6 Then
  409.                 If $TerrObj[$count][1] > -150 Then
  410.                     $TerrObj[$count][1] -= $StageSpeed
  411.                     If $MLG = 1 Then _QuickDraw_RotateNext( $TerrObj[$count][1]+($TerrObj[$count][2]/2), $TerrObj[$count][4]+($TerrObj[$count][3]/2), $degr )
  412.                     _A2D_ObjDraw("tr" & $count, 1, $TerrObj[$count][1], $TerrObj[$count][4], $TerrObj[$count][2], $TerrObj[$count][3], 2, $TerrObj[$count][0], $count)
  413.                 Else
  414.                     _A2D_ObjStatus("tr" & $count, -1)
  415.                     $TerrObj[$count][0] = -1
  416.                 EndIf
  417.             EndIf
  418.         Next
  419.         If $raining = 1 Then
  420.             $rcount += 1
  421.             _Rain()
  422.         ElseIf $raining = 0 And $RainY >= -1200 And $RainY <= 430 Then
  423.             $RainY += 5
  424.             $RainY2 += 5
  425.             _Rain()
  426.         Else
  427.             $rfall = 0
  428.         EndIf
  429.         _A2D_DrawBitMap($boden, 0, 430, 900, 290)
  430.         For $count = 1 To $MaxTerrObj Step +1
  431.             If $TerrObj[$count][0] = 4 Then
  432.                 If $TerrObj[$count][1] > -150 Then
  433.                     $TerrObj[$count][1] -= $StageSpeed
  434.                     _A2D_ObjUpdate("tr" & $count, $schlucht, $TerrObj[$count][1], $TerrObj[$count][4], $TerrObj[$count][2] - ($PandaW + 1), $TerrObj[$count][3], 2, $TerrObj[$count][0], $count)
  435.                     _A2D_DrawBitMap($schlucht, $TerrObj[$count][1] - ($PandaW - 1), $TerrObj[$count][4] + 1, $TerrObj[$count][2] + ($PandaW + 1), $TerrObj[$count][3])
  436.                     #cs
  437.                     If $raining = 1 Or $TerrObj[$count][6] = True Then
  438.                         If $TerrObj[$count][1] < 901 Then $TerrObj[$count][6] = True
  439.                         If $TerrObj[$count][7] < 21 And $TerrObj[$count][1] < 901 Then $TerrObj[$count][7] += 0.05
  440.                         _A2D_DrawBitMap(-1, $TerrObj[$count][1] - ($PandaW - 1), $TerrObj[$count][4] + 292 - $TerrObj[$count][7], $TerrObj[$count][2] + ($PandaW + 1), 20, 0xFF4B68B3)
  441.                     EndIf
  442.                     #ce
  443.                 Else
  444.                     _A2D_ObjStatus("tr" & $count, -1)
  445.                     $TerrObj[$count][0] = -1
  446.                 EndIf
  447.             EndIf
  448.         Next
  449.         For $count = 1 To $MaxTerrObj Step +1
  450.             If $TerrObj[$count][0] = 6 Then
  451.                 If $TerrObj[$count][1] > -150 Then
  452.                     If $MLG = 1 Then _QuickDraw_RotateNext( $TerrObj[$count][1]+($TerrObj[$count][2]/2), $TerrObj[$count][4]+($TerrObj[$count][3]/2), $degr )
  453.                     $TerrObj[$count][1] -= $StageSpeed
  454.                     _A2D_ObjDraw("tr" & $count, 1, $TerrObj[$count][1], $TerrObj[$count][4], $TerrObj[$count][2], $TerrObj[$count][3], 2, $TerrObj[$count][0], $count)
  455.                 Else
  456.                     _A2D_ObjStatus("tr" & $count, -1)
  457.                     $TerrObj[$count][0] = -1
  458.                 EndIf
  459.             EndIf
  460.         Next
  461.     EndIf
  462.     If ($raining = 1 and $running = 1 and $rfall = 1 and $rcount >= 200) or ($WaterY < 720 and $running = 1) Then
  463.         If $WaterY > 129 and $raining = 1 and $WaterDone = 0 or _Check22() Then
  464.             If $rcount >= 200 and $WaterDone = 0 and $WaterCountdown = 0 Then $WaterY -= 0.2
  465.         EndIf
  466.         If $WaterY <= 129 or $WaterDone = 1 Then
  467.             ;If $Invincible = 1 Then $Invincible = 0
  468.             $WaterDone = 1
  469.             If $WaterCount <= 9999 Then $WaterCount += 1
  470.             If $WaterCount >= 10000 Then
  471.                 If $WaterY < 720 Then
  472.                     If $PandaY < 380 Then $PandaY += 0.4
  473.                     $WaterY += 0.4
  474.                 Else
  475.                     If $PandaY > 381 Then
  476.                         _Die()
  477.                     Else
  478.                         For $tcount = 1 To $MaxTerrObj Step +1
  479.                             If $TerrObj[$tcount][0] >= 1 Then
  480.                                 $TerrObj[$tcount][0] = -1
  481.                             EndIf
  482.                         Next
  483.                         $WaterDone = 0
  484.                         $WaterCount = 0
  485.                         $ResetWaterObjects = 0
  486.                         $WaterCountdown = 10000
  487.                     EndIf
  488.                 EndIf
  489.             EndIf
  490.         EndIf
  491.         _A2D_DrawBitMap(-1,0, $WaterY, 900, 700, 0xFF4B68B3)
  492.         ;_A2D_DrawBitMap(-1,0,$WaterY+500,900,100,0xFFc2b280)
  493.         If $WaterY <= 129 Then
  494.             For $count = 1 To $MaxTerrObj Step +1
  495.                 Switch $TerrObj[$count][0]
  496.                     Case 7 to 8
  497.                         If $MLG = 1 Then _QuickDraw_RotateNext( $TerrObj[$count][1]+($TerrObj[$count][2]/2), $TerrObj[$count][4]+($TerrObj[$count][3]/2), $degr )
  498.                         If $TerrObj[$count][1] > -150 Then
  499.                             $TerrObj[$count][1] -= $StageSpeed
  500.                             _A2D_ObjDraw("tr" & $count, 1, $TerrObj[$count][1], $TerrObj[$count][4], $TerrObj[$count][2], $TerrObj[$count][3], 2, $TerrObj[$count][0], $count)
  501.                         Else
  502.                             _A2D_ObjStatus("tr" & $count, -1)
  503.                             $TerrObj[$count][0] = -1
  504.                         EndIf
  505.                     Case 9
  506.                         If $MLG = 1 Then _QuickDraw_RotateNext( $TerrObj[$count][1]+($TerrObj[$count][2]/2), $TerrObj[$count][4]+($TerrObj[$count][3]/2), $degr )
  507.                         If $TerrObj[$count][1] > -200 Then
  508.                             $TerrObj[$count][1] -= $StageSpeed*0.75
  509.                             _A2D_ObjDraw("tr" & $count, 1, $TerrObj[$count][1], $TerrObj[$count][4], $TerrObj[$count][2], $TerrObj[$count][3], 2, $TerrObj[$count][0], $count)
  510.                         Else
  511.                             _A2D_ObjStatus("tr" & $count, -1)
  512.                             $TerrObj[$count][0] = -1
  513.                         EndIf
  514.                     Case 10
  515.                         If $MLG = 1 Then _QuickDraw_RotateNext( $TerrObj[$count][1]+($TerrObj[$count][2]/2), $TerrObj[$count][4]+($TerrObj[$count][3]/2), $degr )
  516.                         If $TerrObj[$count][1] > -150 Then
  517.                             $TerrObj[$count][1] -= $StageSpeed*1.25
  518.                             _A2D_ObjDraw("tr" & $count, 1, $TerrObj[$count][1], $TerrObj[$count][4], $TerrObj[$count][2], $TerrObj[$count][3], 2, $TerrObj[$count][0], $count)
  519.                         Else
  520.                             _A2D_ObjStatus("tr" & $count, -1)
  521.                             $TerrObj[$count][0] = -1
  522.                         EndIf
  523.                 EndSwitch
  524.             Next
  525.         EndIf
  526.     EndIf
  527.     If $injump = 1 And $running = 1 Then
  528.         _A2D_ObjDraw("Panda", 1, $PandaX, $PandaY, $PandaW, $PandaH, 1, 0, 0, $pandaj)
  529.     ElseIf $running = 1 Then
  530.         _A2D_ObjDraw("Panda", 1, $PandaX, $PandaY, $PandaW, $PandaH, 1, 0, 0, Eval("panda" & $panda_an))
  531.         If $panda_an >= 3 Then $panda_an = 0
  532.     EndIf
  533. EndFunc   ;==>_MoveTerrain
  534. Func _Check22()
  535.     If $WaterDone = 1 Then Return -1
  536.     If $WaterY < 429 and $WaterY > 129 Then
  537.         If $ResetWaterObjects = 0 Then
  538.             $ResetWaterObjects = 1
  539.             $RemBoost = 0
  540.             $RemJump = 0
  541.             For $tcount = 1 To $MaxTerrObj Step +1
  542.                 If $TerrObj[$tcount][0] >= 1 Then
  543.                     $TerrObj[$tcount][0] = -1
  544.                 EndIf
  545.             Next
  546.         EndIf
  547.         Return 1
  548.     EndIf
  549.     If $WaterY < 720 and $raining = 0 And $RainY >= -1200 And $RainY <= 430 Then Return 1
  550. EndFunc
  551. Func _Die()
  552.     _CheckHS()
  553.     AdlibUnRegister("_Animate")
  554.     AdlibUnRegister("_stopgen")
  555.     AdlibUnRegister("_stopboost")
  556.     AdlibUnRegister("_DisJump")
  557.     If $moon = 0 Then $Gravity = 0.3
  558.     $RemJump = 0
  559.     $PandaH = 50
  560.     $PandaY = 380
  561.     $RemBoost = 0
  562.     $running = 0
  563.     $bosscount = 0
  564.     $scorecount = 0
  565.     $PandaX = 100
  566.     $falling = 0
  567.     $standardJumpValue = $OldJumpValue
  568.     AdlibUnRegister("_GenTerrain")
  569.     AdlibRegister("_GenTerrain", $SpawnSpeed)
  570. EndFunc   ;==>_Die
  571. Func _CheckHS()
  572.     If $Invincible = 1 Or $moon = 1 Or $infiniteBoost = 1 Or $infiniteJump = 1 Then Return -1
  573.     If $score > $HighScore Then
  574.         If $hscore / $anti_t <> $score Or $hHsc / $anti_t <> $HighScore Then
  575.             MsgBox(64, "Info", "Nice Hax but no", 5)
  576.             Exit
  577.         EndIf
  578.         _A2D_Encrypt($score, @ScriptDir & "\Data\score.a2d")
  579.         $HighScore = $score
  580.         $hHsc = $HighScore * $anti_t
  581.     EndIf
  582. EndFunc   ;==>_CheckHS
  583. Func _CollCheck()
  584.     $collnum = _A2D_CCollision("objM:single", 0, 2, $PandaX, $PandaY, $PandaW, $PandaH)
  585.     If $Invincible = 1 Then Return -1
  586.     If $StageSpeed <> 12 And $collnum <> 6 And $inm = 1 Then
  587.         $StageSpeed = 5
  588.         $panda_m = 3
  589.         $inm = 0
  590.     EndIf
  591.     ConsoleWrite(@CRLF & $TerrObj[$collnum][0])
  592.     Switch $TerrObj[$collnum][0]
  593.         Case 1
  594.             _Die()
  595.         Case 2
  596.             $OldStageSpeed = $StageSpeed
  597.             $StageSpeed = 12
  598.             $Invincible = 1;$BegInvincible
  599.             $ExtraTerrActive = 0
  600.             AdlibRegister("_stopgen", 2000)
  601.             $RemBoost = 4000
  602.             AdlibRegister("_stopboost", 10)
  603.             $collnum = 0
  604.             Return
  605.         Case 3
  606.             ConsoleWrite(@CRLF & "COLL WITH LFISH")
  607.             $TerrObj[$collnum][0] = -1
  608.             _A2D_ObjStatus("tr" & $collnum, -1)
  609.             $score += 100
  610.             $scorecount += 100
  611.             $hscore += $anti_t * 100
  612.             _A2D_ObjUpdate("tr" & $collnum, 0)
  613.             $collnum = 0
  614.             Return
  615.         Case 4
  616.             AdlibUnRegister("_Draw")
  617.             AdlibUnRegister("_GenTerrain")
  618.             AdlibUnRegister("_Animate")
  619.             $falling = 1
  620.             While 1
  621.                 $PandaY += 10
  622.                 If $PandaY > 720 Then
  623.                     _Die()
  624.                 EndIf
  625.                 If $running = 0 Then
  626.                     $PandaY = 380
  627.                     ExitLoop
  628.                 EndIf
  629.                 _A2D_MapDraw($clear, 900, 430, 1)
  630.                 For $count = 1 To 4 Step +1
  631.                     If $tree[$count][1] = 1 Then
  632.                         If $tree[$count][2] >= ($tree[$count][4] * -1) Then
  633.                             _A2D_DrawBitMap($tree[$count][0], $tree[$count][2], 120, $tree[$count][4], 330);$tree[$count][3],$tree[$count][4])
  634.                         EndIf
  635.                     EndIf
  636.                 Next
  637.                 $gx = 0
  638.                 ;For $count = 1 to 18 Step +1
  639.                 _A2D_DrawBitMap($grass, 0, 410, 900, 20)
  640.                 ;$gx += 50
  641.                 ;Next
  642.                 For $count = 1 To $MaxTerrObj Step +1
  643.                     If $TerrObj[$count][0] >= 1 And $TerrObj[$count][0] <> 4 And $TerrObj[$count][0] <> 6 Then
  644.                         If $TerrObj[$count][1] > -150 Then
  645.                             _A2D_ObjDraw("tr" & $count, 1, $TerrObj[$count][1], $TerrObj[$count][4], $TerrObj[$count][2], $TerrObj[$count][3], 2, $TerrObj[$count][0], $count)
  646.                         EndIf
  647.                     EndIf
  648.                 Next
  649.                 If $raining = 1 Then
  650.                     _Rain()
  651.                 ElseIf $raining = 0 And $RainY >= -1200 And $RainY <= 430 Then
  652.                     $RainY += 5
  653.                     $RainY2 += 5
  654.                     _Rain()
  655.                 Else
  656.                     $rfall = 0
  657.                 EndIf
  658.                 _A2D_DrawBitMap($boden, 0, 430, 900, 290)
  659.                 For $count = 1 To $MaxTerrObj Step +1
  660.                     If $TerrObj[$count][0] = 4 Then
  661.                         If $TerrObj[$count][1] > -150 Then
  662.                             _A2D_ObjUpdate("tr" & $count, $schlucht, $TerrObj[$count][1], $TerrObj[$count][4], $TerrObj[$count][2] - ($PandaW + 1), $TerrObj[$count][3], 2, $TerrObj[$count][0], $count)
  663.                             _A2D_DrawBitMap($schlucht, $TerrObj[$count][1] - ($PandaW - 1), $TerrObj[$count][4] + 1, $TerrObj[$count][2] + ($PandaW + 1), $TerrObj[$count][3])
  664.                             #cs
  665.                             If $raining = 1 Or $TerrObj[$count][6] = True Then
  666.                                 If $TerrObj[$count][1] < 901 Then $TerrObj[$count][6] = True
  667.                                 If $TerrObj[$count][7] < 21 And $TerrObj[$count][1] < 901 Then $TerrObj[$count][7] += 0.05
  668.                                 _A2D_DrawBitMap(-1, $TerrObj[$count][1] - ($PandaW - 1), $TerrObj[$count][4] + 292 - $TerrObj[$count][7], $TerrObj[$count][2] + ($PandaW + 1), 20, 0xFF4B68B3)
  669.                             EndIf
  670.                             #ce
  671.                         EndIf
  672.                     EndIf
  673.                 Next
  674.                 For $count = 1 To $MaxTerrObj Step +1
  675.                     If $TerrObj[$count][0] = 6 Then
  676.                         If $TerrObj[$count][1] > -150 Then
  677.                             _A2D_ObjDraw("tr" & $count, 1, $TerrObj[$count][1], $TerrObj[$count][4], $TerrObj[$count][2], $TerrObj[$count][3], 2, $TerrObj[$count][0], $count)
  678.                         EndIf
  679.                     EndIf
  680.                 Next
  681.                 _A2D_DrawBitMap(-1,0, $WaterY, 900, 700, 0xFF4B68B3)
  682.                 _A2D_DrawBitMap(-1,0,$WaterY+500,900,100,0xFFc2b280)
  683.                 _A2D_ObjDraw("Panda", 1, $PandaX, $PandaY, $PandaW, $PandaH, 1, 0, 0, Eval("panda" & $panda_an))
  684.                 _A2D_DrawString("Punkte: " & $score, 30, 650, 30)
  685.                 _A2D_DrawString("Highscore: " & $HighScore, 30, 650, 50)
  686.                 _A2D_DrawString($GameVersion, 10, 2, 718)
  687.                 _A2D_DrawString("Made for my best Bruh",10,800,718)
  688.                 _A2D_FPS()
  689.                 _A2D_Buffer()
  690.                 Sleep($gsp)
  691.             WEnd
  692.             AdlibRegister("_Draw", $gsp)
  693.         Case 5 ;JumpBoost
  694.             ;ConsoleWrite("go")
  695.             $TerrObj[$collnum][0] = -1
  696.             _A2D_ObjStatus("tr" & $collnum, -1)
  697.             _A2D_ObjUpdate("tr" & $collnum, 0)
  698.             $collnum = 0
  699.             $OldJumpValue = $standardJumpValue
  700.             $standardJumpValue = 11
  701.             If $moon = 0 Then $Gravity = 0.2
  702.             $RemJump = 10000
  703.             AdlibRegister("_DisJump", 10)
  704.         Case 6 ;Matsch
  705.             $StageSpeed = 2
  706.             $panda_m = 1.5
  707.             $inm = 1
  708.         Case 7
  709.             ConsoleWrite(@CRLF & "COLL WITH LFISH")
  710.             $TerrObj[$collnum][0] = -1
  711.             _A2D_ObjStatus("tr" & $collnum, -1)
  712.             $score += 100
  713.             $scorecount += 100
  714.             $hscore += $anti_t * 100
  715.             _A2D_ObjUpdate("tr" & $collnum, 0)
  716.             $collnum = 0
  717.             Return
  718.         Case 8
  719.             _Die()
  720.         Case 9
  721.             _Die()
  722.     EndSwitch
  723. EndFunc   ;==>_CollCheck
  724. Func _DisJump()
  725.     If $infiniteJump = 0 Then $RemJump -= 10
  726.     If $RemJump = 0 Then
  727.         $standardJumpValue = 8
  728.         If $moon = 0 Then $Gravity = 0.3
  729.         AdlibUnRegister("_DisJump")
  730.     EndIf
  731. EndFunc   ;==>_DisJump
  732. Func _Animate()
  733.     ;If $pause = 1 Then Return -1
  734.     $panda_an += 1
  735. EndFunc   ;==>_Animate
  736. HotKeySet("{UP}", "_up")
  737. HotKeySet("{DOWN}", "_down")
  738. HotKeySet("{ENTER}", "_enter")
  739. Func _up()
  740.     If $running = 1 Or $Active = 0 Then Return -1
  741.     If $ch > 1 Then $ch -= 1
  742. EndFunc   ;==>_up
  743. Func _down()
  744.     If $running = 1 Or $Active = 0 Then Return -1
  745.     If $ch < 4 Then $ch += 1
  746. EndFunc   ;==>_down
  747. Func FeedBack()
  748.  
  749. EndFunc   ;==>FeedBack
  750. Func ApplyPressed()
  751.     $gsp = GUICtrlRead($Slider1)
  752.     GUISetState(@SW_HIDE, $settingsform)
  753.     $sloop = 0
  754.     AdlibRegister("_Draw", $gsp)
  755. EndFunc   ;==>ApplyPressed
  756. Func MLGPressed()
  757.     $degr = 0
  758.     If $MLG = 0 Then
  759.         $MLG = 1
  760.     Else
  761.         $MLG = 0
  762.     EndIf
  763. EndFunc
  764. Func ResetPressed()
  765.     GUICtrlSetData($Slider1, 10)
  766.     $gsp = 10
  767. EndFunc   ;==>ResetPressed
  768. Func UpdatePressed()
  769.     $source = _INetGetSource("http://firediver.bplaced.net/PandaRunner/vs.php")
  770.     $SoSplit = StringSplit($source, "|")
  771.     If @error Then
  772.         MsgBox(16, "Fehler", "Fehler beim Lesen der Antwort!")
  773.     Else
  774.         If $GameVersion <> $SoSplit[1] Then
  775.             $choice = MsgBox(4, "Info", $SoSplit[2])
  776.             If $choice = 6 Then
  777.                 ShellExecute("www.firediver.bplaced.net/PandaRunner/Patchnotes.txt")
  778.             EndIf
  779.             SplashTextOn("Info", "Update wird heruntergeladen...", 300, 150)
  780.             InetGet("http://firediver.bplaced.net/PandaRunner/upd.exe", @TempDir & "\upd_pr.exe")
  781.             SplashOff()
  782.             If Not FileExists(@TempDir & "\pandar_upd.bat") Then
  783.                 FileWriteLine(@TempDir & "\pandar_upd.bat", "@echo off")
  784.                 FileWriteLine(@TempDir & "\pandar_upd.bat", "echo Bitte warten...")
  785.                 FileWriteLine(@TempDir & "\pandar_upd.bat", "ping -n 04 localhost>nul")
  786.                 FileWriteLine(@TempDir & "\pandar_upd.bat", "MOVE /Y upd_pr.exe " & @ScriptDir & "\PandaRunner.exe")
  787.                 FileWriteLine(@TempDir & "\pandar_upd.bat", "echo Update erfolgreich beendet!")
  788.                 FileWriteLine(@TempDir & "\pandar_upd.bat", "ping -n 10 localhost>nul")
  789.                 ShellExecute(@TempDir & "\pandar_upd.bat", "", @TempDir)
  790.                 Exit
  791.             EndIf
  792.         Else
  793.             MsgBox(64, "Info", "PandaRunner ist auf dem neuestem stand! (" & $GameVersion & ")")
  794.         EndIf
  795.     EndIf
  796. EndFunc   ;==>UpdatePressed
  797. Func SliderMoved()
  798.     GUICtrlSetData($Label4, Round(1000 / GUICtrlRead($Slider1)) & " FPS")
  799. EndFunc   ;==>SliderMoved
  800. Func InfLPressed()
  801.     If $Invincible = 0 Then
  802.         $Invincible = 1
  803.     Else
  804.         $Invincible = 0
  805.     EndIf
  806. EndFunc   ;==>InfLPressed
  807. Func InfJPressed()
  808.     If $infiniteJump = 0 Then
  809.         $infiniteJump = 1
  810.     Else
  811.         $infiniteJump = 0
  812.     EndIf
  813. EndFunc   ;==>InfJPressed
  814. Func InfBPressed()
  815.     If $infiniteBoost = 0 Then
  816.         $infiniteBoost = 1
  817.     Else
  818.         $infiniteBoost = 0
  819.     EndIf
  820. EndFunc   ;==>InfBPressed
  821. Func MoonPressed()
  822.     If $moon = 0 Then
  823.         $Gravity = 0.05
  824.         $SGravity = 0.05
  825.         $moon = 1
  826.     Else
  827.         $Gravity = 0.3
  828.         $SGravity = 0.3
  829.         $moon = 0
  830.     EndIf
  831. EndFunc   ;==>MoonPressed
  832. Func _enter()
  833.     ;ConsoleWrite(@CRLF & $p_enter & @CRLF & $Active)
  834.     If $running = 1 Or $Active = 0 Then Return -1
  835.     If $p_enter = 1 Then
  836.         Return -1
  837.     Else
  838.         $p_enter = 1
  839.     EndIf
  840.     ;ConsoleWrite("a")
  841.     Switch $ch
  842.         Case 1
  843.             $standardJumpValue = $OldJumpValue
  844.             $score = 0
  845.             $hscore = 0
  846.             $WaterY = 721
  847.             $WaterDone = 0
  848.             $WaterCount = 0
  849.             $ResetWaterObjects = 0
  850.             $WaterCountdown = 0
  851.             $bosscount = 0
  852.             $panda_an = 0
  853.             $StageSpeed = 5
  854.             For $tcount = 1 To $MaxTerrObj Step +1
  855.                 If $TerrObj[$tcount][0] >= 1 Then
  856.                     $TerrObj[$tcount][0] = -1
  857.                 EndIf
  858.             Next
  859.             For $treec = 1 To 4 Step +1
  860.                 $tree[$treec][1] = -1
  861.             Next
  862.             $running = 1
  863.             ;AdlibRegister("_Animate", 100)
  864.         Case 2
  865.             MsgBox(64, "Info", "Funktion noch in Entwicklung")
  866.         Case 3
  867.             AdlibUnRegister("_Draw")
  868.             GUICtrlSetData($Slider1, $gsp)
  869.             If $MLG = 1 Then GUICtrlSetState($Checkbox5, $GUI_CHECKED)
  870.             If $moon = 1 Then GUICtrlSetState($Checkbox4, $GUI_CHECKED)
  871.             If $infiniteBoost = 1 Then GUICtrlSetState($Checkbox3, $GUI_CHECKED)
  872.             If $infiniteJump = 1 Then GUICtrlSetState($Checkbox2, $GUI_CHECKED)
  873.             If $Invincible = 1 Then GUICtrlSetState($Checkbox1, $GUI_CHECKED)
  874.             GUISetState(@SW_SHOW, $settingsform)
  875.         Case 4
  876.             _A2D_Shutdown()
  877.             Exit
  878.     EndSwitch
  879.     $p_enter = 0
  880. EndFunc   ;==>_enter
  881. Func _MoveBossTerrain()
  882.     For $count = 1 To 4 Step +1
  883.         If $tree[$count][1] = 1 Then
  884.             If $tree[$count][2] >= ($tree[$count][4] * -1) Then
  885.                 ;ConsoleWrite(@CRLF & $count)
  886.                 If $MLG = 1 Then _QuickDraw_RotateNext( $tree[$count][2]+($tree[$count][4]/2), 120+(330/2), $degr )
  887.                 _A2D_DrawBitMap($tree[$count][0], $tree[$count][2], 120, $tree[$count][4], 330);$tree[$count][3],$tree[$count][4])
  888.             EndIf
  889.         EndIf
  890.     Next
  891.     _A2D_DrawBitMap($grass, 0, 410, 900, 20)
  892.     _A2D_DrawBitMap($boden, 0, 430, 900, 290)
  893.     If $raining = 1 and $running = 1 and $rfall = 1 and $rcount > 200 or $WaterY < 720 Then
  894.         _A2D_DrawBitMap(-1,0, $WaterY, 900, 700, 0xFF4B68B3)
  895.     EndIf
  896. EndFunc   ;==>_MoveBossTerrain
  897. Func _go()
  898.     AdlibRegister("_throwAN", 50)
  899. EndFunc   ;==>_go
  900. Func _throwAN()
  901.     If $ban = 5 Then $rev = 1
  902.     If $ban = 1 And $rev = 1 Then
  903.         $rev = 0
  904.         AdlibUnRegister("_throwAN")
  905.     EndIf
  906.     If $rev = 0 Then
  907.         $ban += 1
  908.         $StoneX += 1
  909.         $StoneY -= 10
  910.     ElseIf $rev = 1 Then
  911.         $ban -= 1
  912.     EndIf
  913.     If $ban = 3 And $ll = 0 Then _throw()
  914. EndFunc   ;==>_throwAN
  915. Func _throw()
  916.     $ll = 1
  917.     $tt = 0
  918.     $Sjumpvel = Random(12, 17)
  919.     ;$SGravity = 0.3
  920.     $bla2 = 0
  921.     $StoneY = 380
  922.     $SSpeed = Random(5, 10)
  923.     $throw = 1
  924.     $StoneX = 513
  925. EndFunc   ;==>_throw
  926. Func _Boss()
  927.     AdlibUnRegister("_Animate")
  928.     AdlibUnRegister("_GenTerrain")
  929.     $BossFight = 1
  930.     $StoneX = 513
  931.     $PandaX = 100
  932.     $RemBoost = 0
  933.     $RemJump = 0
  934.     $standardJumpValue = $OldJumpValue
  935.     $StoneY = 380
  936.     $StimeM = Random(1500, 3500, 1)
  937.     $StimeC = 0
  938.     $throwed = 0
  939.     While $BossFight = 1
  940.         If $MLG = 1 Then
  941.             If $degr <= 360 Then
  942.                 $degr += 1
  943.             Else
  944.                 $degr = 0
  945.             EndIf
  946.         EndIf
  947.         $lcount += 1
  948.         If $throwed = 5 Then
  949.             $PandaH = 50
  950.             For $tcount = 1 To $MaxTerrObj Step +1
  951.                 If $TerrObj[$tcount][0] >= 1 Then
  952.                     $TerrObj[$tcount][0] = -1
  953.                 EndIf
  954.             Next
  955.             $PandaY = 380
  956.             AdlibRegister("_GenTerrain", $SpawnSpeed)
  957.             $BossFight = 0
  958.             Return 1
  959.         EndIf
  960.         Sleep($gsp)
  961.         ;ConsoleWrite(@CRLF & "C:" & $StimeC & " M:" & $StimeM)
  962.         $StimeC += 10
  963.         If $StimeC >= $StimeM Then
  964.             $StimeM = Random(1500, 3500)
  965.             $StimeC = 0
  966.             $laying = 0
  967.             $throwAN = 1
  968.         EndIf
  969.         If $ban = 5 Then $rev = 1
  970.         If $throwAN = 1 And $lcount >= 5 Then
  971.             $lcount = 0
  972.             If $ban = 1 And $rev = 1 Then
  973.                 $rev = 0
  974.                 $throwAN = 0
  975.             EndIf
  976.             If $rev = 0 Then
  977.                 $ban += 1
  978.                 $StoneX += 1
  979.                 $StoneY -= 10
  980.             ElseIf $rev = 1 Then
  981.                 $ban -= 1
  982.             EndIf
  983.             If $ban = 3 And $ll = 0 Then _throw()
  984.         EndIf
  985.         If _IsPressed("26", $hDLL) Then _jump()
  986.         If _IsPressed("25", $hDLL) Then
  987.             If $PandaX - $panda_m > 3 Then
  988.                 $PandaX -= $panda_m ;links
  989.             EndIf
  990.         EndIf
  991.         If _IsPressed("27", $hDLL) Then
  992.             If $PandaX + $panda_m < 220 Then
  993.                 $panda_an += 1
  994.                 $PandaX += $panda_m ;rechts
  995.             EndIf
  996.         EndIf
  997.         If _IsPressed("28", $hDLL) Then
  998.             $PandaH = 25
  999.             If $injump = 1 Then
  1000.                 If $down = 0 Then $PandaY += 25
  1001.                 If $moon = 0 Then $Gravity = 0.5
  1002.                 $down = 1
  1003.             Else
  1004.                 $PandaY = 405
  1005.             EndIf
  1006.         ElseIf $PandaH <> 50 Then
  1007.             $down = 0
  1008.             $PandaH = 50
  1009.             $PandaY = 380
  1010.         EndIf
  1011.         _A2D_MapDraw($clear, 900, 430, 1)
  1012.         If $throw = 1 Then
  1013.             If $StoneY >= 380 And $tt >= 0.10 Then
  1014.                 $laying += 1
  1015.                 $StoneY = 380
  1016.                 If $laying = 40 Then
  1017.                     $throw = 0
  1018.                     $ll = 0
  1019.                     $throwed += 1
  1020.                     $StoneX = 513
  1021.                 EndIf
  1022.             ElseIf $laying = 0 Then
  1023.                 $tt += 0.10
  1024.                 $StoneX = $StoneX - $SSpeed
  1025.                 $StoneY -= $Sjumpvel * $tt
  1026.                 $Sjumpvel -= $SGravity * $tt
  1027.                 If $Sjumpvel < 0 And $bla2 = 0 Then
  1028.                     $bla2 = 1
  1029.                     $tt = -0.5
  1030.                     $Sjumpvel = 0
  1031.                 Else
  1032.                     $Sjumpvel -= $SGravity * $tt
  1033.                 EndIf
  1034.                 If _A2D_CCollision("custom", 0, 0, $PandaX, $PandaY, $PandaW, $PandaH, $StoneX, $StoneY, 50, 50) And $Invincible = 0 Then
  1035.                     AdlibRegister("_GenTerrain", $SpawnSpeed)
  1036.                     $BossFight = 0
  1037.                     $ll = 0
  1038.                     _Die()
  1039.                     Return 1
  1040.                 EndIf
  1041.             EndIf
  1042.         EndIf
  1043.         If $injump = 1 Then
  1044.             $t += 0.08
  1045.             $PandaY -= $jumpvel * $t
  1046.             $jumpvel -= $Gravity * $t
  1047.             If $jumpvel < 0 And $bla = 0 Then
  1048.                 $bla = 1
  1049.                 $t = -0.5
  1050.                 $jumpvel = 0
  1051.             Else
  1052.                 $jumpvel -= $Gravity * $t
  1053.             EndIf
  1054.             If Not $down = 1 And $PandaY >= 380 Then
  1055.                 $PandaY = 380
  1056.                 $injump = 0
  1057.             ElseIf $down = 1 And $PandaY >= 405 Then
  1058.                 $PandaY = 405
  1059.                 $injump = 0
  1060.             EndIf
  1061.         EndIf
  1062.         _MoveBossTerrain()
  1063.         If $MLG = 1 Then _QuickDraw_RotateNext( $Bagger[1]+($Bagger[3]/2), $Bagger[2]+($Bagger[4]/2), $degr )
  1064.         _A2D_ObjDraw("Bagger", 1, $Bagger[1], $Bagger[2], $Bagger[3], $Bagger[4], 2, 0, 0, $baggerAn[$ban])
  1065.         If $injump = 1 Then
  1066.             _A2D_ObjDraw("Panda", 1, $PandaX, $PandaY, $PandaW, $PandaH, 1, 0, 0, $pandaj)
  1067.         Else
  1068.             _A2D_ObjDraw("Panda", 1, $PandaX, $PandaY, $PandaW, $PandaH, 1, 0, 0, Eval("panda" & $panda_an))
  1069.             If $panda_an >= 3 Then $panda_an = 0
  1070.         EndIf
  1071.         If $MLG = 1 Then _QuickDraw_RotateNext( $StoneX+(50/2), $StoneY+(50/2), $degr )
  1072.         _A2D_DrawBitMap($stone, $StoneX, $StoneY, 50, 50)
  1073.         _A2D_DrawString("Punkte: " & $score, 30, 650, 30)
  1074.         _A2D_DrawString("Highscore: " & $HighScore, 30, 650, 50)
  1075.         _A2D_DrawString($GameVersion, 10, 2, 718)
  1076.         _A2D_DrawString("Made for my best Bruh",10,800,718)
  1077.         _A2D_FPS()
  1078.         _A2D_Buffer()
  1079.     WEnd
  1080. EndFunc   ;==>_Boss
  1081. Func _Rain()
  1082.     If $raining = 1 Then
  1083.         If $RainY > 0 Then
  1084.             $RainY = -450
  1085.         Else
  1086.             $RainY += 5
  1087.         EndIf
  1088.         If $RainY2 > 0 Then
  1089.             $RainY2 = -450
  1090.         Else
  1091.             $RainY2 += 5
  1092.         EndIf
  1093.     EndIf
  1094.     _A2D_DrawBitMap($rain, 0, $RainY, 100, $RainH)
  1095.     _A2D_DrawBitMap($rain, 100, $RainY2, 100, $RainH)
  1096.     _A2D_DrawBitMap($rain, 200, $RainY, 100, $RainH)
  1097.     _A2D_DrawBitMap($rain, 300, $RainY2, 100, $RainH)
  1098.     _A2D_DrawBitMap($rain, 400, $RainY, 100, $RainH)
  1099.     _A2D_DrawBitMap($rain, 500, $RainY2, 100, $RainH)
  1100.     _A2D_DrawBitMap($rain, 600, $RainY, 100, $RainH)
  1101.     _A2D_DrawBitMap($rain, 700, $RainY2, 100, $RainH)
  1102.     _A2D_DrawBitMap($rain, 800, $RainY, 100, $RainH)
  1103.     ;_A2D_DrawBitMap($rain,00,$RainY2,100,$RainH)
  1104. EndFunc   ;==>_Rain
  1105. Func _disRain()
  1106.     $raining = 0
  1107.     AdlibUnRegister("_disRain")
  1108. EndFunc   ;==>_disRain
  1109. Func _Draw()
  1110.     If $MLG = 1 Then
  1111.         If $degr <= 360 Then
  1112.             $degr += 1
  1113.         Else
  1114.             $degr = 0
  1115.         EndIf
  1116.     EndIf
  1117.     ;ConsoleWrite(@CRLF & $raining & " " & $rfall)
  1118.     If $running = 1 And $pause = 0 and $WaterY - $PandaY >= 50 Then
  1119.         If _IsPressed("26", $hDLL) Then _jump()
  1120.         If _IsPressed("25", $hDLL) Then
  1121.             If $PandaX - $panda_m > 3 Then
  1122.                 $PandaX -= $panda_m ;links
  1123.                 $score -= 1
  1124.                 $scorecount -= 1
  1125.                 $hscore -= $anti_t
  1126.             EndIf
  1127.         EndIf
  1128.         If _IsPressed("27", $hDLL) Then
  1129.             If $PandaX + $panda_m < 875 Then
  1130.                 $panda_an += 1
  1131.                 $PandaX += $panda_m ;rechts
  1132.                 $score += 1
  1133.                 $scorecount += 1
  1134.                 $hscore += $anti_t
  1135.             EndIf
  1136.         EndIf
  1137.         $score += 2
  1138.         $hscore += $anti_t * 2
  1139.         $scorecount += 2
  1140.     ElseIf $running = 1 and $pause = 0 and $WaterY - $PandaY < 50 Then
  1141.         $pr = 0
  1142.         If _IsPressed("26", $hDLL) Then
  1143.             $PandaY -= $panda_m/1.5
  1144.             $pr = 1
  1145.         EndIf
  1146.         If _IsPressed("28", $hDLL) Then
  1147.             If $PandaY + $panda_m <= 580 Then
  1148.                 $PandaY += $panda_m/1.5
  1149.                 $pr = 1
  1150.             EndIf
  1151.         EndIf
  1152.         If _IsPressed("25", $hDLL) Then
  1153.             If $PandaX - $panda_m > 3 Then
  1154.                 $PandaX -= $panda_m/1.5 ;links
  1155.                 $score -= 1
  1156.                 $scorecount -= 1
  1157.                 $pr = 1
  1158.                 $hscore -= $anti_t
  1159.             EndIf
  1160.         EndIf
  1161.         If _IsPressed("27", $hDLL) Then
  1162.             If $PandaX + $panda_m < 875 Then
  1163.                 $panda_an += 1
  1164.                 $PandaX += $panda_m/1.5 ;rechts
  1165.                 $score += 1
  1166.                 $pr = 1
  1167.                 $scorecount += 1
  1168.                 $hscore += $anti_t
  1169.             EndIf
  1170.         EndIf
  1171.         If $PandaY - 0.4 < 679 Then $PandaY += 0.4
  1172.         $score += 2
  1173.         $hscore += $anti_t * 2
  1174.         $scorecount += 2
  1175.     EndIf
  1176.     If $WaterCountdown > 0 Then $WaterCountdown -= 1
  1177.     If $scorecount >= 1000 And $running = 1 Then
  1178.         $bosscount += 1
  1179.         $scorecount = 0
  1180.     EndIf
  1181.     If $bosscount >= 10 And $RemBoost = 0 And $RemJump = 0 And $WaterY > 430 Then
  1182.         $bosscount = 0
  1183.         AdlibUnRegister("_Draw")
  1184.         _Boss()
  1185.         AdlibRegister("_Draw", $gsp)
  1186.     EndIf
  1187.     _A2D_MapDraw($clear, 900, 430, 1)
  1188.     If $injump = 1 Then
  1189.         $t += 0.08
  1190.         $PandaY -= $jumpvel * $t
  1191.         $jumpvel -= $Gravity * $t
  1192.         If $jumpvel < 0 And $bla = 0 Then
  1193.             $bla = 1
  1194.             $t = -0.5
  1195.             $jumpvel = 0
  1196.         Else
  1197.             $jumpvel -= $Gravity * $t
  1198.         EndIf
  1199.         If Not $down = 1 And $PandaY >= 380 And $WaterY - $PandaY >= 50 Then
  1200.             $PandaY = 380
  1201.             $injump = 0
  1202.         ElseIf $down = 1 And $PandaY >= 405 And $WaterY - $PandaY >= 50 Then
  1203.             $PandaY = 405
  1204.             $injump = 0
  1205.         ElseIf $PandaY >= $spoint And $WaterY - $PandaY <= 50 Then
  1206.             $PandaY = $spoint
  1207.             $injump = 0
  1208.             $spoint = 1000
  1209.         EndIf
  1210.     EndIf
  1211.     If $running = 1 Then _CollCheck()
  1212.     _MoveTerrain()
  1213.     _A2D_DrawString("Punkte: " & $score, 30, 650, 30)
  1214.     _A2D_DrawString("Highscore: " & $HighScore, 30, 650, 50)
  1215.     If $RemJump > 0 Then _A2D_DrawBitMap($jumpb, 650, 70, 0.02 * $RemJump, 20)
  1216.     If $RemBoost > 0 Then _A2D_DrawBitMap($tr_ex, 650, 90, 0.05 * $RemBoost, 20)
  1217.     If $running = 0 Then
  1218.         _A2D_DrawString("SPIELEN", 40, 360, 200)
  1219.         _A2D_DrawString("HILFE", 40, 385, 250)
  1220.         _A2D_DrawString("EINSTELUNGEN", 40, 305, 300)
  1221.         _A2D_DrawString("VERLASSEN", 40, 340, 350)
  1222.         If $ch = 1 Then
  1223.             _A2D_DrawString("--->                                              <---", 30, 230, 200)
  1224.         ElseIf $ch = 2 Then
  1225.             _A2D_DrawString("--->                                              <---", 30, 230, 250)
  1226.         ElseIf $ch = 3 Then
  1227.             _A2D_DrawString("--->                                              <---", 30, 230, 300)
  1228.         ElseIf $ch = 4 Then
  1229.             _A2D_DrawString("--->                                              <---", 30, 230, 350)
  1230.         EndIf
  1231.     EndIf
  1232.     _A2D_DrawString($GameVersion, 10, 2, 718)
  1233.     _A2D_DrawString("Made for my best Bruh",10,800,718)
  1234.     _A2D_FPS()
  1235.     _A2D_Buffer()
  1236. EndFunc   ;==>_Draw
  1237. While 1
  1238. WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement