Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_Icon=icon.ico
- #AutoIt3Wrapper_UseUpx=y
- #AutoIt3Wrapper_Res_Description=PandaRunner
- #AutoIt3Wrapper_Res_Fileversion=B1.0
- #AutoIt3Wrapper_Res_LegalCopyright=Alle Rechte liegen bei FireDiver (yt/FireDiver)
- #AutoIt3Wrapper_Res_Language=1031
- #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
- #include "G:\A2D\A2D.au3"
- #include <Misc.au3>
- #include <Crypt.au3>
- #include <Array.au3>
- #include <Zip.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <INet.au3>
- #include <Math.au3>
- #include <WindowsConstants.au3>
- If FileExists(@TempDir & "\pandar_upd.bat") Then FileDelete(@TempDir & "\pandar_upd.bat")
- If not FileExists(@ScriptDir & "\Data") Then
- SplashTextOn("Entpacke...","Dateien werden Entpackt...",200,70)
- FileInstall("G:\A2D\Panda\d.zip",@TempDir & "\panda_d.zip",1)
- _Zip_UnzipAll(@TempDir & "\panda_d.zip", @ScriptDir & "\",1)
- Sleep(7500) ;Nur zur Sicherheit
- SplashOff()
- EndIf
- Dim $gsp = 0, $anti_t,$lasttree = 1,$MaxTerrObj = 30, $TerrObj[1000][10], $hscore = 0,$injump = 0, $jumpvel = 0, $Step = 0, $t, $Gravity, $MaxJumpVel, $bla, $score = 0, $standardJumpValue = 8,$OldJumpValue = 8,$pause = 0, $scorecount = 0, $StageSpeed = 4, $ExtraTerrActive = 0, $ExtraTerr
- 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
- Dim $down = 0,$pause = 0,$RemJump,$RemBoost,$panda_m = 3,$inm = 0,$p_enter = 0,$GameVersion = "Beta v1.0",$Active = 1,$baggerAn[6],$Bagger[6],$bosscount = 0,$ban = 1,$throw = 0,$tt,$bla2,$SGravity,$Sjumpvel,$StoneX,$StoneY,$rev = 0,$laying = 0,$ll = 0
- For $count = 1 To 3 Step +1
- $split = StringSplit(FileReadLine(@ScriptDir & "\Data\settings.ini", $count), ":")
- Switch $split[1]
- Case "FPSspeed"
- $Begingsp = $split[2]
- $lastsleep = $Begingsp
- $gsp = $split[2]
- Case "Speed"
- $Beginsta = $split[2]
- $StageSpeed = $split[2]
- Case "Invincible"
- $BegInvincible = $split[2]
- EndSwitch
- Next
- $anti_t = Random(30,90,1)
- $HighScore = _A2D_Decrypt(@ScriptDir & "\Data\score.a2d")
- AdlibRegister("_Resize",500)
- _A2D_Startup("PandaRunner", 900, 720, 900, 720, 2, 1, 5)
- $clear = _A2D_LoadImage(@ScriptDir & "\Data\Images\clear.jpg")
- $Logo = _A2D_LoadImage(@ScriptDir & "\Data\Images\BG.jpeg")
- _A2D_MapDraw($clear, 900, 720, 1)
- _A2D_DrawBitMap($Logo, 0, 0, 900, 720)
- _A2D_Buffer()
- For $count = 1 To 3 Step +1
- Assign("panda" & $count, _A2D_LoadImage(@ScriptDir & "\Data\Images\panda\panda" & $count & ".jpg"))
- Next
- $hHsc = $HighScore*$anti_t
- $stone = _A2D_LoadImage(@ScriptDir & "\Data\Images\stone.png")
- $matsch = _A2D_LoadImage(@ScriptDir & "\Data\Images\matsch.jpg")
- $grass = _A2D_LoadImage(@ScriptDir & "\Data\Images\grass.jpg")
- $pandaj = _A2D_LoadImage(@ScriptDir & "\Data\Images\panda\pandaj.jpg")
- $pandab = _A2D_LoadImage(@ScriptDir & "\Data\Images\pandab.jpg")
- $boden = _A2D_LoadImage(@ScriptDir & "\Data\Images\boden.jpg")
- $jumpb = _A2D_LoadImage(@ScriptDir & "\Data\Images\jumpb.jpg")
- $schlucht = _A2D_LoadImage(@ScriptDir & "\Data\Images\schlucht.jpg")
- $tr_ex = _A2D_LoadImage(@ScriptDir & "\Data\Images\tr_ex.jpg")
- $tr1 = _A2D_LoadImage(@ScriptDir & "\Data\Images\tr1.jpg")
- $tr2 = _A2D_LoadImage(@ScriptDir & "\Data\Images\tr2.jpg")
- $size[1] = 550*0.5
- $size[2] = 550*0.5
- $size[3] = 550*0.5
- $size[4] = 250*0.5
- For $count = 1 to 5 Step +1
- $baggerAn[$count] = _A2D_LoadImage(@ScriptDir & "\Data\Images\bagger\bagger" & $count & ".png")
- Next
- For $count = 1 to 4 Step +1
- $tree[$count][0] = _A2D_LoadImage(@ScriptDir & "\Data\Images\tree" & $count & ".png")
- $tree[$count][4] = $size[$count]
- Next
- _A2D_ObjCreate($panda1, 100, 380, 25, 50, "Panda")
- _A2D_ObjStatus("Panda",1)
- $Bagger[1] = 540 ;X
- $Bagger[2] = 157 ;Y
- $Bagger[3] = 350 ;Width
- $Bagger[4] = 300 ;Height
- _A2D_ObjCreate($baggerAn[1],$Bagger[1],$Bagger[2],$Bagger[3],$Bagger[4],"Bagger")
- _A2D_ObjStatus("Bagger",1)
- $PandaW = 25
- $PandaH = 50
- $PandaX = 100
- $PandaY = 380
- For $count = 1 to 4 Step +1
- $tree[$count][2] = $count*1000
- Next
- ;Sleep(5000)
- _GenTerrain()
- $hDLL = DllOpen("user32.dll")
- AdlibRegister("_GenTerrain", $SpawnSpeed)
- ;AdlibRegister("_Animate", 100)
- $running = 0
- $ch = 1
- HotKeySet("{ESC}", "_go")
- ;_Boss()
- Func _pause()
- If $running = 0 or $falling = 1 Then Return -1
- Switch $pause
- Case 0
- AdlibUnRegister("_GenTerrain")
- $OldStageSpeed = $StageSpeed
- $StageSpeed = 0
- $pause = 1
- Case 1
- $StageSpeed = $OldStageSpeed
- $pause = 0
- AdlibRegister("_GenTerrain", $SpawnSpeed)
- EndSwitch
- EndFunc ;==>_pause
- Func _stopboost()
- $RemBoost -= 10
- If $RemBoost = 0 Then
- $StageSpeed = $OldStageSpeed
- $Invincible = $BegInvincible
- AdlibRegister("_GenTerrain", $SpawnSpeed)
- AdlibUnRegister("_stopgen")
- AdlibUnRegister("_stopboost")
- EndIf
- EndFunc ;==>_stopboost
- Func _stopgen()
- AdlibUnRegister("_GenTerrain")
- EndFunc ;==>_stopgen
- Func _jump()
- If $injump = 1 Then Return -1
- $t = 0
- $bla = 0
- $injump = 1
- $jumpvel = $standardJumpValue
- $Gravity = 0.3
- EndFunc ;==>_jump
- Func _Difference($1, $2)
- If $1 > $2 Then
- Return $1 - $2
- ElseIf $2 > $1 Then
- Return $2 - $1
- ElseIf $2 = $1 Then
- Return 0
- EndIf
- EndFunc ;==>_Difference
- Func _ReCalcDistance()
- $oX = Random(901,2901,1)
- $exit = 0
- While $exit = 0
- $n = 0
- For $tcount = 1 to $MaxTerrObj Step +1
- Switch $TerrObj[$tcount][0]
- Case 1 to 5
- If _Difference($oX,$TerrObj[$tcount][1]) < 60 and _Difference($oX,$TerrObj[$tcount][1]+$TerrObj[$tcount][2]) < 60 Then
- $oX = Random(901,2901,1)
- $n = 1
- EndIf
- EndSwitch
- Next
- If $n = 0 Then
- Return $oX
- EndIf
- WEnd
- EndFunc ;==>_ReCalcDistance
- Func _CheckType($tp)
- Switch $tp
- Case 1 to 10
- Return 2
- Case Else
- Return 1
- EndSwitch
- EndFunc
- Func _TerrCreate($bm,$y,$w,$h,$it,$t,$e1)
- $oX = _ReCalcDistance()
- For $tcount = 1 To $MaxTerrObj Step +1
- If _CheckType($TerrObj[$tcount][0]) = 1 Then
- If $TerrObj[$tcount][0] = -1 Then
- _A2D_ObjUpdate("tr" & $tcount, $bm, $oX, $y, $w, $h, $t, $e1, $tcount)
- _A2D_ObjStatus("tr" & $tcount,1)
- Else
- _A2D_ObjCreate($bm, $oX, $y, $w, $h, "tr" & $tcount, $t, $e1, $tcount)
- _A2D_ObjStatus("tr" & $tcount,1)
- EndIf
- $TerrObj[$tcount][0] = $it
- $TerrObj[$tcount][1] = $oX
- $TerrObj[$tcount][2] = $w ;width
- $TerrObj[$tcount][3] = $h ;height
- $TerrObj[$tcount][4] = $y ;y
- ExitLoop
- EndIf
- Next
- EndFunc
- Func _idle()
- $Active = 0
- Do
- If WinGetState("PandaRunner") = 5 Then
- _A2D_Shutdown()
- Exit
- EndIf
- Sleep(100)
- Until WinActive("PandaRunner")
- $Active = 1
- EndFunc
- Func _Resize()
- If not WinActive("PandaRunner") Then _idle()
- $size2 = WinGetClientSize ("PandaRunner")
- If $size2[0] <> 900 or $size2[1] <> 720 Then
- $pos = WinGetPos("PandaRunner")
- WinMove("PandaRunner","",$pos[0],$pos[1],900,720)
- EndIf
- EndFunc
- Func _GenTerrain()
- If not WinActive("PandaRunner") Then _idle()
- If Random(1,3,1) = 1 Then ;Bäume
- $oX = Random(901,2901,1)
- $exit = 0
- While $exit = 0
- $n = 0
- For $count = 1 to 4 Step +1
- If $tree[$count][1] = 1 and _Difference($oX,$tree[$count][2]) < 250 Then
- $oX = Random(901,2901,1)
- $n = 1
- ElseIf $count = 4 and $n = 0 Then
- $exit = 1
- EndIf
- Next
- WEnd
- $lasttree = $oX
- For $count = 1 to 4 Step +1
- If $tree[$count][1] <> 1 Then
- $tree[$count][1] = 1
- $tree[$count][2] = $oX
- ExitLoop
- EndIf
- Next
- EndIf
- If Random(1, 30, 1) = 1 Then ;Speedboost
- _TerrCreate($tr_ex,400,23,30,2,2,2)
- EndIf
- If Random(1, 20, 1) = 1 Then ;JumpBoost
- _TerrCreate($jumpb,400,23,30,5,2,2)
- EndIf
- If Random(1, 3, 1) = 1 Then ;Babypandas
- _TerrCreate($pandab,400,23,30,3,2,3)
- EndIf
- If Random(1, 5, 1) = 1 Then ;Schlucht
- $oX = _ReCalcDistance()
- For $tcount = 1 To $MaxTerrObj Step +1
- If _CheckType($TerrObj[$tcount][0]) = 1 Then
- If $TerrObj[$tcount][0] = -1 Then
- _A2D_ObjUpdate("tr" & $tcount, $schlucht, $oX, 430, 75, 290, 2, 1, $tcount)
- _A2D_ObjStatus("tr" & $tcount,1)
- Else
- _A2D_ObjCreate($schlucht, $oX, 430, 75, 290, "tr" & $tcount, 2, 1, $tcount)
- _A2D_ObjStatus("tr" & $tcount,1)
- EndIf
- $TerrObj[$tcount][0] = 4
- $TerrObj[$tcount][1] = $oX + ($PandaW - 1) ;x + pandawidth
- $TerrObj[$tcount][2] = 75 - ($PandaW - 1);width - pandawidth
- $TerrObj[$tcount][3] = 290 ;height
- $TerrObj[$tcount][4] = 429 ;y
- ExitLoop
- EndIf
- Next
- EndIf
- If Random(1, 5, 1) = 1 Then ;Matsch
- _TerrCreate($matsch,429,75,10,6,2,3)
- EndIf
- $NorTerr = Random(1, 2, 1) ;Hindernis
- _TerrCreate(Eval("tr" & $NorTerr),400,23,30,1,2,1)
- EndFunc ;==>_GenTerrain
- Func _MoveTerrain()
- For $count = 1 to 4 Step +1
- If $tree[$count][1] = 1 Then
- If $tree[$count][2] >= ($tree[$count][4]*-1) Then
- $tree[$count][2] -= $StageSpeed
- ;ConsoleWrite(@CRLF & $count)
- _A2D_DrawBitMap($tree[$count][0],$tree[$count][2],120,$tree[$count][4],330);$tree[$count][3],$tree[$count][4])
- Else
- $tree[$count][1] = -1
- EndIf
- EndIf
- Next
- $gx = 0
- ;For $count = 1 to 18 Step +1
- _A2D_DrawBitMap($grass,0,410,900,20)
- ;$gx += 50
- ;Next
- _A2D_DrawBitMap($boden, 0, 430, 900, 290)
- For $count = 1 To $MaxTerrObj Step +1
- If $TerrObj[$count][0] = 4 Then
- If $TerrObj[$count][1] > -150 Then
- $TerrObj[$count][1] -= $StageSpeed
- _A2D_ObjUpdate("tr" & $count, $schlucht, $TerrObj[$count][1], $TerrObj[$count][4], $TerrObj[$count][2] - ($PandaW + 1), $TerrObj[$count][3], 2, $TerrObj[$count][0], $count)
- _A2D_DrawBitMap($schlucht, $TerrObj[$count][1] - ($PandaW - 1), $TerrObj[$count][4] + 1, $TerrObj[$count][2] + ($PandaW + 1), $TerrObj[$count][3])
- Else
- _A2D_ObjStatus("tr" & $count,-1)
- $TerrObj[$count][0] = -1
- EndIf
- ElseIf $TerrObj[$count][0] >= 1 And $TerrObj[$count][0] <> 4 Then
- If $TerrObj[$count][1] > -150 Then
- $TerrObj[$count][1] -= $StageSpeed
- _A2D_ObjDraw("tr" & $count, 1, $TerrObj[$count][1], $TerrObj[$count][4], $TerrObj[$count][2], $TerrObj[$count][3], 2, $TerrObj[$count][0], $count)
- Else
- _A2D_ObjStatus("tr" & $count,-1)
- $TerrObj[$count][0] = -1
- EndIf
- EndIf
- Next
- EndFunc ;==>_MoveTerrain
- Func _FallAn()
- $PandaY += 10
- If $PandaY > 720 Then
- _Die()
- AdlibUnRegister("_FallAn")
- EndIf
- EndFunc ;==>_FallAn
- Func _Die()
- _CheckHS()
- AdlibUnRegister("_Animate")
- AdlibUnRegister("_stopgen")
- AdlibUnRegister("_stopboost")
- AdlibUnRegister("_DisJump")
- $Gravity = 0.2
- $RemJump = 0
- $PandaH = 50
- $PandaY = 380
- $RemBoost = 0
- $running = 0
- $bosscount = 0
- $scorecount = 0
- $PandaX = 100
- $falling = 0
- $standardJumpValue = $OldJumpValue
- AdlibUnRegister("_GenTerrain")
- AdlibRegister("_GenTerrain", $SpawnSpeed)
- EndFunc
- Func _CheckHS()
- If $BegInvincible = 1 Then Return -1
- If $score > $HighScore Then
- If $hscore/$anti_t <> $score or $hHsc/$anti_t <> $HighScore Then
- MsgBox(64,"Info","Nice Hax but no",5)
- Exit
- EndIf
- _A2D_Encrypt($score,@ScriptDir & "\Data\score.a2d")
- $HighScore = $score
- $hHsc = $HighScore*$anti_t
- EndIf
- EndFunc
- Func _CollCheck()
- $collnum = _A2D_CCollision("objM:single", 0, 2, $PandaX, $PandaY, $PandaW, $PandaH)
- If $Invincible = 1 Then Return -1
- If $StageSpeed <> 12 and $collnum <> 6 and $inm = 1 Then
- $StageSpeed = $Beginsta
- $panda_m = 3
- $inm = 0
- EndIf
- Switch $TerrObj[$collnum][0]
- Case 1
- ;ConsoleWrite(@CRLF & "COL: " & $Timer)
- _Die()
- Case 2
- $OldStageSpeed = $StageSpeed
- $StageSpeed = 12
- $Invincible = 1;$BegInvincible
- $ExtraTerrActive = 0
- AdlibRegister("_stopgen", 2000)
- $RemBoost = 4000
- AdlibRegister("_stopboost", 10)
- $collnum = 0
- Return
- Case 3
- $TerrObj[$collnum][0] = -1
- _A2D_ObjStatus("tr" & $collnum,-1)
- $score += 100
- $scorecount += 100
- $hscore += $anti_t*100
- _A2D_ObjUpdate("tr" & $collnum, 0)
- $collnum = 0
- Return
- Case 4
- AdlibUnRegister("_GenTerrain")
- AdlibUnRegister("_Animate")
- AdlibRegister("_FallAn", 10)
- $falling = 1
- While 1
- $start_tt = @MSEC
- If $running = 0 Then
- $PandaY = 380
- ExitLoop
- EndIf
- _A2D_MapDraw($clear, 900, 430, 1)
- For $count = 1 to 4 Step +1
- If $tree[$count][1] = 1 Then
- _A2D_DrawBitMap($tree[$count][0],$tree[$count][2],120,$tree[$count][4],330)
- EndIf
- Next
- _A2D_DrawBitMap($grass,0,410,900,20)
- _A2D_DrawBitMap($boden, 0, 430, 900, 290)
- For $count = 1 To $MaxTerrObj Step +1
- If $TerrObj[$count][0] >= 1 And $TerrObj[$count][0] <> 4 Then
- _A2D_ObjDraw("tr" & $count)
- ElseIf $TerrObj[$count][0] = 4 Then
- _A2D_DrawBitMap($schlucht, $TerrObj[$count][1] - ($PandaW - 1), $TerrObj[$count][4] + 1, $TerrObj[$count][2] + ($PandaW + 1), $TerrObj[$count][3])
- EndIf
- Next
- _A2D_ObjDraw("Panda", 1, $PandaX, $PandaY, $PandaW, $PandaH, 1, 0, 0, Eval("panda" & $panda_an))
- _A2D_DrawString("Punkte: " & $score, 30, 650, 30)
- _A2D_DrawString("Highscore: " & $HighScore, 30, 650, 50)
- _A2D_FPS()
- _A2D_Buffer()
- Sleep(10)
- WEnd
- Case 5 ;JumpBoost
- ;ConsoleWrite("go")
- $TerrObj[$collnum][0] = -1
- _A2D_ObjStatus("tr" & $collnum,-1)
- _A2D_ObjUpdate("tr" & $collnum, 0)
- $collnum = 0
- $OldJumpValue = $standardJumpValue
- $standardJumpValue = 11
- $Gravity = 0.3
- $RemJump = 10000
- AdlibRegister("_DisJump",10)
- Case 6 ;Matsch
- $StageSpeed = 2
- $panda_m = 1.5
- $inm = 1
- EndSwitch
- EndFunc ;==>_CollCheck
- Func _DisJump()
- $RemJump -= 10
- If $RemJump = 0 Then
- $standardJumpValue = 7
- $Gravity = 0.3
- AdlibUnRegister("_DisJump")
- EndIf
- EndFunc
- Func _Animate()
- ;If $pause = 1 Then Return -1
- $panda_an += 1
- EndFunc ;==>_Animate
- HotKeySet("{UP}","_up")
- HotKeySet("{DOWN}","_down")
- HotKeySet("{ENTER}","_enter")
- Func _up()
- If $running = 1 or $Active = 0 Then Return -1
- If $ch > 1 Then $ch -= 1
- EndFunc
- Func _down()
- If $running = 1 or $Active = 0 Then Return -1
- If $ch < 4 Then $ch += 1
- EndFunc
- Func _enter()
- ;ConsoleWrite(@CRLF & $p_enter & @CRLF & $Active)
- If $running = 1 or $Active = 0 Then Return -1
- If $p_enter = 1 Then
- Return -1
- Else
- $p_enter = 1
- EndIf
- ;ConsoleWrite("a")
- Switch $ch
- Case 1
- $standardJumpValue = $OldJumpValue
- $score = 0
- $hscore = 0
- $bosscount = 0
- $panda_an = 0
- $Invincible = $BegInvincible
- $gsp = $Begingsp
- $StageSpeed = $Beginsta
- For $tcount = 1 To $MaxTerrObj Step +1
- If $TerrObj[$tcount][0] >= 1 Then
- $TerrObj[$tcount][0] = -1
- EndIf
- Next
- For $treec = 1 to 4 Step +1
- $tree[$treec][1] = -1
- Next
- $running = 1
- ;AdlibRegister("_Animate", 100)
- Case 2
- $source = _INetGetSource("http://firediver.bplaced.net/PandaRunner/vs.php")
- $SoSplit = StringSplit($source,"|")
- If @error Then
- MsgBox(16,"Fehler","Fehler beim Lesen der Antwort!")
- Else
- If $GameVersion <> $SoSplit[1] Then
- $choice = MsgBox(4,"Info",$SoSplit[2])
- If $choice = 6 Then
- ShellExecute("www.firediver.bplaced.net/PandaRunner/Patchnotes.txt")
- EndIf
- SplashTextOn("Info","Update wird heruntergeladen...",300,150)
- InetGet("http://firediver.bplaced.net/PandaRunner/upd.exe",@TempDir & "\upd_pr.exe")
- SplashOff()
- If not FileExists(@TempDir & "\pandar_upd.bat") Then
- FileWriteLine(@TempDir & "\pandar_upd.bat","@echo off")
- FileWriteLine(@TempDir & "\pandar_upd.bat","echo Bitte warten...")
- FileWriteLine(@TempDir & "\pandar_upd.bat","ping -n 04 localhost>nul")
- FileWriteLine(@TempDir & "\pandar_upd.bat","MOVE /Y upd_pr.exe " & @ScriptDir & "\PandaRunner.exe")
- FileWriteLine(@TempDir & "\pandar_upd.bat","echo Update erfolgreich beendet!")
- FileWriteLine(@TempDir & "\pandar_upd.bat","ping -n 10 localhost>nul")
- ShellExecute(@TempDir & "\pandar_upd.bat","",@TempDir)
- Exit
- EndIf
- Else
- MsgBox(64,"Info","PandaRunner ist auf dem neuestem stand! (" & $GameVersion & ")")
- EndIf
- EndIf
- Case 3
- MsgBox(64,"Info","Funktion noch in Entwicklung")
- Case 4
- _A2D_Shutdown()
- Exit
- EndSwitch
- $p_enter = 0
- EndFunc
- Func _MoveBossTerrain()
- For $count = 1 to 4 Step +1
- If $tree[$count][1] = 1 Then
- If $tree[$count][2] >= ($tree[$count][4]*-1) Then
- ;ConsoleWrite(@CRLF & $count)
- _A2D_DrawBitMap($tree[$count][0],$tree[$count][2],120,$tree[$count][4],330);$tree[$count][3],$tree[$count][4])
- EndIf
- EndIf
- Next
- _A2D_DrawBitMap($grass,0,410,900,20)
- _A2D_DrawBitMap($boden, 0, 430, 900, 290)
- EndFunc
- Func _go()
- AdlibRegister("_throwAN",50)
- EndFunc
- Func _throwAN()
- If $ban = 5 Then $rev = 1
- If $ban = 1 and $rev = 1 Then
- $rev = 0
- AdlibUnRegister("_throwAN")
- EndIf
- If $rev = 0 Then
- $ban += 1
- $StoneX += 1
- $StoneY -= 10
- ElseIf $rev = 1 Then
- $ban -= 1
- EndIf
- If $ban = 3 and $ll = 0 Then _throw()
- EndFunc
- Func _throw()
- $ll = 1
- $tt = 0
- $Sjumpvel = Random(12,17)
- $SGravity = 0.3
- $bla2 = 0
- $StoneY = 380
- $SSpeed = Random(5,10)
- $throw = 1
- $StoneX = 513
- EndFunc
- Func _Boss()
- AdlibUnRegister("_Animate")
- AdlibUnRegister("_GenTerrain")
- $BossFight = 1
- $StoneX = 513
- $PandaX = 100
- $RemBoost = 0
- $RemJump = 0
- $standardJumpValue = $OldJumpValue
- $StoneY = 380
- $StimeM = Random(1500,3500,1)
- $StimeC = 0
- $throwed = 0
- While $BossFight = 1
- If $throwed = 5 Then
- $PandaH = 50
- For $tcount = 1 To $MaxTerrObj Step +1
- If $TerrObj[$tcount][0] >= 1 Then
- $TerrObj[$tcount][0] = -1
- EndIf
- Next
- $PandaY = 380
- AdlibRegister("_GenTerrain",$SpawnSpeed)
- $BossFight = 0
- Return 1
- EndIf
- Sleep(10)
- ;ConsoleWrite(@CRLF & "C:" & $StimeC & " M:" & $StimeM)
- $StimeC += 10
- If $StimeC >= $StimeM Then
- $StimeM = Random(1500,3500)
- $StimeC = 0
- $laying = 0
- AdlibRegister("_throwAN",50)
- EndIf
- If _IsPressed("26", $hDLL) Then _jump()
- If _IsPressed("25", $hDLL) Then
- If $PandaX - $panda_m > 3 Then
- $PandaX -= $panda_m ;links
- EndIf
- EndIf
- If _IsPressed("27", $hDLL) Then
- If $PandaX + $panda_m < 220 Then
- $panda_an += 1
- $PandaX += $panda_m ;rechts
- EndIf
- EndIf
- If _IsPressed("28", $hDLL) Then
- $PandaH = 25
- If $injump = 1 Then
- If $down = 0 Then $PandaY += 25
- $Gravity = 0.5
- $down = 1
- Else
- $PandaY = 405
- EndIf
- ElseIf $PandaH <> 50 Then
- $down = 0
- $PandaH = 50
- $PandaY = 380
- EndIf
- _A2D_MapDraw($clear, 900, 430, 1)
- If $throw = 1 Then
- If $StoneY >= 380 and $tt >= 0.10 Then
- $laying += 1
- $StoneY = 380
- If $laying = 40 Then
- $throw = 0
- $ll = 0
- $throwed += 1
- $StoneX = 513
- EndIf
- ElseIf $laying = 0 Then
- $tt += 0.10
- $StoneX = $StoneX - $SSpeed
- $StoneY -= $Sjumpvel * $tt
- $Sjumpvel -= $SGravity * $tt
- If $Sjumpvel < 0 And $bla2 = 0 Then
- $bla2 = 1
- $tt = -0.5
- $Sjumpvel = 0
- Else
- $Sjumpvel -= $SGravity * $tt
- EndIf
- If _A2D_CCollision("custom", 0, 0, $PandaX, $PandaY, $PandaW, $PandaH,$StoneX,$StoneY,50,50) Then
- AdlibRegister("_GenTerrain",$SpawnSpeed)
- $BossFight = 0
- $ll = 0
- _Die()
- Return 1
- EndIf
- EndIf
- EndIf
- If $injump = 1 Then
- $t += 0.08
- $PandaY -= $jumpvel * $t
- $jumpvel -= $Gravity * $t
- If $jumpvel < 0 And $bla = 0 Then
- $bla = 1
- $t = -0.5
- $jumpvel = 0
- Else
- $jumpvel -= $Gravity * $t
- EndIf
- If not $down = 1 and $PandaY >= 380 Then
- $PandaY = 380
- $injump = 0
- ElseIf $down = 1 and $PandaY >= 405 Then
- $PandaY = 405
- $injump = 0
- EndIf
- EndIf
- _MoveBossTerrain()
- _A2D_ObjDraw("Bagger", 1, $Bagger[1], $Bagger[2], $Bagger[3], $Bagger[4], 2, 0, 0, $baggerAn[$ban])
- If $injump = 1 Then
- _A2D_ObjDraw("Panda", 1, $PandaX, $PandaY, $PandaW, $PandaH, 1, 0, 0, $pandaj)
- Else
- _A2D_ObjDraw("Panda", 1, $PandaX, $PandaY, $PandaW, $PandaH, 1, 0, 0, Eval("panda" & $panda_an))
- If $panda_an >= 3 Then $panda_an = 0
- EndIf
- _A2D_DrawBitMap($stone,$StoneX,$StoneY,50,50)
- _A2D_DrawString("Punkte: " & $score, 30, 650, 30)
- _A2D_DrawString("Highscore: " & $HighScore, 30, 650, 50)
- _A2D_DrawString($GameVersion, 10, 2, 718)
- _A2D_FPS()
- _A2D_Buffer()
- WEnd
- EndFunc
- Func _Draw()
- _A2D_MapDraw($clear, 900, 430, 1)
- If $injump = 1 Then
- $t += 0.08
- $PandaY -= $jumpvel * $t
- $jumpvel -= $Gravity * $t
- If $jumpvel < 0 And $bla = 0 Then
- $bla = 1
- $t = -0.5
- $jumpvel = 0
- Else
- $jumpvel -= $Gravity * $t
- EndIf
- If not $down = 1 and $PandaY >= 380 Then
- $PandaY = 380
- $injump = 0
- ElseIf $down = 1 and $PandaY >= 405 Then
- $PandaY = 405
- $injump = 0
- EndIf
- EndIf
- If $running = 1 Then _CollCheck()
- _MoveTerrain()
- If $injump = 1 And $running = 1 Then
- _A2D_ObjDraw("Panda", 1, $PandaX, $PandaY, $PandaW, $PandaH, 1, 0, 0, $pandaj)
- ElseIf $running = 1 Then
- _A2D_ObjDraw("Panda", 1, $PandaX, $PandaY, $PandaW, $PandaH, 1, 0, 0, Eval("panda" & $panda_an))
- If $panda_an >= 3 Then $panda_an = 0
- EndIf
- _A2D_DrawString("Punkte: " & $score, 30, 650, 30)
- _A2D_DrawString("Highscore: " & $HighScore, 30, 650, 50)
- If $RemJump > 0 Then _A2D_DrawBitMap($jumpb,650,70,0.02*$RemJump,20)
- If $RemBoost > 0 Then _A2D_DrawBitMap($tr_ex,650,90,0.05*$RemBoost,20)
- If $running = 0 Then
- _A2D_DrawString("SPIELEN", 40, 360, 200)
- _A2D_DrawString("UPDATE", 40, 365, 250)
- _A2D_DrawString("HILFE", 40, 385, 300)
- _A2D_DrawString("EXIT", 40, 395, 350)
- If $ch = 1 Then
- _A2D_DrawString("---> <---", 30, 309, 200)
- ElseIf $ch = 2 Then
- _A2D_DrawString("---> <---", 30, 309, 250)
- ElseIf $ch = 3 Then
- _A2D_DrawString("---> <---", 30, 309, 300)
- ElseIf $ch = 4 Then
- _A2D_DrawString("---> <---", 30, 309, 350)
- EndIf
- EndIf
- _A2D_DrawString($GameVersion, 10, 2, 718)
- _A2D_FPS()
- _A2D_Buffer()
- EndFunc ;==>_Draw
- While 1
- $start_t = @MSEC
- If $running = 1 and $pause = 0 Then
- If _IsPressed("26", $hDLL) Then _jump()
- If _IsPressed("25", $hDLL) Then
- If $PandaX - $panda_m > 3 Then
- $PandaX -= $panda_m ;links
- $score -= 1
- $scorecount -= 1
- $hscore -= $anti_t
- EndIf
- EndIf
- If _IsPressed("27", $hDLL) Then
- If $PandaX + $panda_m < 875 Then
- $panda_an += 1
- $PandaX += $panda_m ;rechts
- $score += 1
- $scorecount += 1
- $hscore += $anti_t
- EndIf
- EndIf
- #cs
- If _IsPressed("28", $hDLL) Then
- $PandaH = 25
- If $injump = 1 Then
- If $down = 0 Then $PandaY += 25
- $Gravity = 0.5
- $down = 1
- Else
- $PandaY = 405
- EndIf
- ElseIf $PandaH <> 50 Then
- $down = 0
- $PandaH = 50
- $PandaY = 380
- EndIf
- #ce
- $score += 2
- $hscore += $anti_t*2
- $scorecount += 2
- EndIf
- _Draw()
- If $scorecount >= 1000 and $running = 1 Then
- $bosscount += 1
- $scorecount = 0
- $StageSpeed += 0.1
- EndIf
- If $bosscount >= 10 and $RemBoost = 0 and $RemJump = 0 Then
- $bosscount = 0
- _Boss()
- EndIf
- $end_t = @MSEC
- Sleep(10)
- WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement