Tag,
Ich habe vor ca 2 Jahren wo ich noch recht unerfahren im Programmieren / Scripting war mit einem Spiel namens Autohexagon angefangen.
Ich habe mir diese Spielidee von dem Spiel: "Super Hexagon" und "Open Hexagon" abgeguckt.
Letzlich habe ich mir gedacht bei einer community Challenge mit zu machen, weswegen dieses Spiel jetzt auch Spielbar ist (fertig würde ich nicht sagen).
Nunja diese lange Spanne von 2 Jahren hat auch seine Spuren hinterlassen... das Script ist sehr unübersichtlich und in manchen teilen sehr Unprofessional geschrieben, bsp. habe ich erst letztes Jahr die Funktion Modulo für mich entdeckt und kann diese erst jetzt auch Clever einbauen.
Nunja ich will nur nicht das Ihr mich Steinigt
Der Download ist deshalb so groß weil Musik die notwendig ist beiliegt.
Screen:
Spoiler anzeigen
[Blockierte Grafik: http://666kb.com/i/cu58ozuwe8a04vs0z.png]
Das folgende Youtubevideo musste ich in kurze Zeit erstellen, deswegen kann sich der ein und andere Fehler eingeschlichen haben...
Außerdem heißt dieses Spiel dort anders^^
Ich will nicht das man über Youtube sooo schnell mein Forenaccount findet.
https://www.youtube.com/watch?v=ScSLvtSt_lk
Quellcode:
Spoiler anzeigen
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GuiConstantsEx.au3>
#include <Misc.au3>
#include <include\QuickDraw.au3> ; [user='202504']moritz1243[/user]
#include <include\Bass.au3>
#include <include\BassConstants.au3>
Opt("GUIOnEventMode", 1)
HotKeySet("{ESC}", "om")
Global $iGuiX = @DesktopWidth * 0.8, $iGuiY = @DesktopHeight * 0.9, $fpsIngame = 1, $fps2 = 50, $Datei = @ScriptDir & "\Einstellung.ini", $record = 0, $enable = True
If FileExists($Datei) Then
$iGuiX = IniRead($Datei, "save", "guix", $iGuiX)
$iGuiY = IniRead($Datei, "save", "guiy", $iGuiY)
$fps2 = IniRead($Datei, "save", "fps", $fps2)
$fpsIngame = IniRead($Datei, "save", "fps_ingui", $fpsIngame)
EndIf
Global $iCenter = 1500, $aMap, $iM = 0, $iRadius = $iGuiX * 0.67, $iRadius2, $iRadius3, $iMusicPulseTolerance, $Titel = "Autohexagon by ", $Name = "Autohexagon", $version = "0.91 ALPHA"
Global $iPI = 3.1415926535897932384626433832795 ; Ich weis...
Global $iGrad = 360, $iSpeed = $iPI / $iGrad
Global $hGUI, $hGraphic, $hBitmap, $hBuffer, $aPointsBG[4][2], $aPointsWall[4][2], $aPointsPlayer[4][2], $aWallPoints[1][4][2], $aHexaPoints[4][2]
Global $iR = 0, $iRSpeed, $iMSpeed, $irPlayer = 0, $irpSpeed, $irpSpeedTMPl = 0, $irpSpeedTMPr = 0, $iTimeControl, $iWsTmp, $iTimeRotation, $irHexSpeed, $iWallSpeed ;, $iWalls
Global $iPlayer[6], $wPlayerg[2]
Global $bColor[4], $uDLL = DllOpen("user32.dll")
Global $iWaende, $iMaxWaende, $pxWaende, $ChLvlper = 0
Global $iwColor[3] = [1, 0, 0], $awColor, $swColor, $ihColor[3] = [1, 0, 0], $ahColor, $shColor, $ihColor2[3] = [1, 0, 0], $shColor2, $ahColor2
Global $MenueOption = 1;0 - leicht, 1- normal , 2- schwer, 3- extrem, 4 - unmöglich
[/autoit] [autoit][/autoit] [autoit]Global $timerStart = TimerInit(), $Play = False, $SaveTime = False, $SaveTimeing = 5000, $meneu = False, $SaveTimeing_display = $SaveTimeing, $SaveTimingDisplay = False;True
Global $aTimerHG[4][2] = [[-1, -1], [$iGuiX * 0.09 + 70, -1], [$iGuiX * 0.06 + 70, 60], [-1, 70]], $cColorHGtimer = 0xAAAA0000, $color_1 = True, $color_2 = False, $color_3 = False
Global $aMenueHG1[4][2] = [[-1, -1], [$iGuiX + 1, -1], [$iGuiX + 1, $iGuiY + 1], [-1, $iGuiY + 1]], $aMenueHG2[4][2] = [[$iGuiX / 2 - 275, $iGuiY / 2 - 270], [$iGuiX / 2 + 275, $iGuiY / 2 - 270], [$iGuiX / 2 + 275, $iGuiY / 2 + 270], [$iGuiX / 2 - 275, $iGuiY / 2 + 270]]
Global $aMenueOptions[6] = ["Leicht", "Normal", "Schwer", "Extrem", "Unmöglich", "Beenden"], $menueIndex = 1, $menueEingabe = False, $menTexP[6] = [0, 0, 0, 0, 0, 0], $menColP[6] = [0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000], $menPreP[6] = ["", "", "", "", "", ""]
Global $letzterPunktestand = "0", $menueGameOver = False, $Dummy_PicMenue = -1, $MenuePic = False, $menue2 = True
Global $loadColor[3] = [2, 2, 2];[2,2,2]
Global $ShootEgg = True, $ShootTimer, $ShootEgg_p = False, $ShootIntervalMin = 4, $ShootIntervalMax = 10, $ShootInterval = Round(Random($ShootIntervalMin, $ShootIntervalMax), 3), $ShootSaveLocation = 0, $ShootAfterAim = 2.2;Sek
Global $ShootPoints[2] = [0, 0], $shoot = False, $augeX, $augeY, $LaserBreite = 10, $LaserPoints[4][2] = [[0, 0], [0, 0], [0, 0], [0, 0]], $shoot2 = False, $GuiVerltnis = Sqrt($iGuiX * $iGuiX + $iGuiY * $iGuiY), $shootDauer = 1.5, $iRadius = $GuiVerltnis, $fps = 0;, $iCenter = $GuiVerltnis
Global $iLength, $file, $MusicHandle, $MusicVollume = 0.3;Musik
[/autoit] [autoit][/autoit] [autoit]_BASS_STARTUP()
_BASS_Init(0, -1, 44100, 0, "")
$file = @ScriptDir & "\Music\JamerikanBeatz - Last Time (Dubstep).mp3";Touhou
[/autoit] [autoit][/autoit] [autoit]$iHex = 6
$iRSpeed = 1
$iMSpeed = 8
$iMaxFrames = $fps2
$iRadius2 = 100
$iRadius3 = 85
$iMusicPulseTolerance = 37
$iTimeControl = 2 ; Speed
$iTimeRotation = 30
$iTimeWalls = 20
$iWaende = 55
$iMaxWaende = 15
$pxWaende = $iGuiX / $iMaxWaende
$irpSpeed = 0.8 ; Unter 1
$irHexSpeed = 2.0;1.4
$iWallSpeed = 4;3.5
$swColor = "0xFFFF0000,0xFF00FF00,0xFF0000FF,0xFFFF00FF"
$iwColorSpeedPx = 5
$iwColorSpeedTime = 15
;--
$shColor = "0xFFFF00FF,0xFF00FF0F,0xFF0F00FF,0xFF0F00FF"
$shColor2 = "0xFFFFF0FF,0xF000FF0F,0xFF6F604F,0xFA0FB09F"
$ihColorSpeedPx = 5
$ihColorSpeedTime = 10
$color_1 = True
$color_2 = False
$color_3 = False
$ipRadius = $iRadius2 + ($iMusicPulseTolerance / 2.6);100
Global $wPlayer[5] = [20, 15, 25, $ipRadius + 18, $ipRadius + 5]
;----------------------------------------
$wPlayerg[0] = $wPlayer[3]
$wPlayerg[1] = $wPlayer[4]
$iRadius2g = $iRadius2
$iRadius3g = $iRadius3
$irpSpeedTMP = $irpSpeed
$aPointsBG[0][0] = 4
$aPointsWall[0][0] = 4
$aPointsPlayer[0][0] = 4
$irpSpeedTMPr = $irpSpeed
$irpSpeedTMPl = $irpSpeed
$aHexaPoints[0][0] = 4
_Start(0)
[/autoit] [autoit][/autoit] [autoit]_PlayMusic(1)
_Load()
_QuickDraw_Enable($Titel, $iGuiX, $iGuiY, 10, 100, False)
Global $ptrFont = _QuickDraw_CreateFont("Arial"), $Texture1 = _QuickDraw_LoadTexture("gfx\auge_lines.png"), $Texture2 = _QuickDraw_LoadTexture("gfx\auge.png"), $Texture3 = _QuickDraw_LoadTexture("gfx\scope_lined.png")
WinMove($Titel, "", @DesktopWidth / 2 - ($iGuiX / 2), @DesktopHeight / 2 - ($iGuiY / 2) - 35)
$bColor[0] = 0xFF93BB49
$bColor[1] = 0xFF1E66AE
$bColor[2] = 0xFFDF6026
$bColor[3] = 0xFF94D394
$aMap = _LoadMapfString(FileRead(@ScriptDir & "\F.txt"))
AdlibRegister("_Control", $iTimeControl)
$time = TimerInit()
$z = 0
$iTimeSleep = TimerInit()
$iRotationTime = TimerInit()
$iWallTime = TimerInit()
$iwColorTime = TimerInit()
$ihColorTime = TimerInit()
While ( _QuickDraw_Running() And (GUIGetMsg() <> $GUI_EVENT_CLOSE))
If $SaveTime = True And TimerDiff($timerStart) > $SaveTimeing Then $SaveTime = False
If $SaveTime Then $SaveTimingDisplay = True
If $SaveTimingDisplay = True And TimerDiff($timerStart) > $SaveTimeing_display Then $SaveTimingDisplay = False
If TimerDiff($iTimeSleep) > (999 / $iMaxFrames) Then
_QuickDraw_ClearBuffer($ihColor2[1]);0xFF1E66AE )
$iTimeSleep = TimerInit()
_dawHexagon()
$z += 1
EndIf
If TimerDiff($iRotationTime) > $iTimeRotation Then
_Rotation()
$iRotationTime = TimerInit()
EndIf
If TimerDiff($iWallTime) > $iTimeWalls Then
_WallSpeed()
$iWallTime = TimerInit()
EndIf
If TimerDiff($time) > 999 Then
;~ ;;~ ConsoleWrite($z & @CRLF)
;~ ToolTip($z)
$fps = $z
$time = TimerInit()
$z = 0
EndIf
WEnd
Func _dawHexagon()
;~ $tmptimer_2 = TimerInit() ; @@@ TMP
_Effects()
_QuickDraw_Circle($iGuiX / 2, $iGuiY / 2, 100, $Texture1, 0xFFFFFFFF)
For $iH = 1 To $iHex
$aPointsBG[1][0] = $iGuiX / 2 + Cos(2 * $iPI / 360 * ($iH * ($iGrad / $iHex) + $iR)) * $iRadius
$aPointsBG[1][1] = $iGuiY / 2 - Sin(2 * $iPI / 360 * ($iH * ($iGrad / $iHex) + $iR)) * $iRadius
$aPointsBG[2][0] = $iGuiX / 2 + Cos(2 * $iPI / 360 * (($iH + 1) * ($iGrad / $iHex) + $iR)) * $iRadius
$aPointsBG[2][1] = $iGuiY / 2 - Sin(2 * $iPI / 360 * (($iH + 1) * ($iGrad / $iHex) + $iR)) * $iRadius
$aPointsBG[0][0] = $iGuiX / 2 + Cos(2 * $iPI / 360 * ($iH * ($iGrad / $iHex) + $iR)) * $iRadius2
$aPointsBG[0][1] = $iGuiY / 2 - Sin(2 * $iPI / 360 * ($iH * ($iGrad / $iHex) + $iR)) * $iRadius2
$aPointsBG[3][0] = $iGuiX / 2 + Cos(2 * $iPI / 360 * (($iH + 1) * ($iGrad / $iHex) + $iR)) * $iRadius2
$aPointsBG[3][1] = $iGuiY / 2 - Sin(2 * $iPI / 360 * (($iH + 1) * ($iGrad / $iHex) + $iR)) * $iRadius2
$aHexaPoints[0][0] = $iGuiX / 2 + Cos(2 * $iPI / 360 * ($iH * ($iGrad / $iHex) + $iR)) * $iRadius3
$aHexaPoints[0][1] = $iGuiY / 2 - Sin(2 * $iPI / 360 * ($iH * ($iGrad / $iHex) + $iR)) * $iRadius3
$aHexaPoints[3][0] = $iGuiX / 2 + Cos(2 * $iPI / 360 * (($iH + 1) * ($iGrad / $iHex) + $iR)) * $iRadius3
$aHexaPoints[3][1] = $iGuiY / 2 - Sin(2 * $iPI / 360 * (($iH + 1) * ($iGrad / $iHex) + $iR)) * $iRadius3
$aHexaPoints[1][0] = $aPointsBG[0][0]
$aHexaPoints[1][1] = $aPointsBG[0][1]
$aHexaPoints[2][0] = $aPointsBG[3][0]
$aHexaPoints[2][1] = $aPointsBG[3][1]
_QuickDraw_Polygon(0, 0, $aHexaPoints, 4, $Draw_Fill, $iwColor[1]);$bColor[3])
[/autoit] [autoit][/autoit] [autoit]If Mod($iH, 2) Then
_QuickDraw_Polygon(0, 0, $aPointsBG, 4, $Draw_Fill, $ihColor2[1]);$bColor[1])
Else
_QuickDraw_Polygon(0, 0, $aPointsBG, 4, $Draw_Fill, $ihColor[1]);$bColor[2])
EndIf
Next
If $iWaende * $pxWaende <= $iM Then ; Map neu(e) laden
$iM = 0 - $iCenter
_Load_dif($menueIndex, False)
EndIf
AdlibUnRegister("_Control")
[/autoit] [autoit][/autoit] [autoit]If $shoot And $ShootEgg Then
$augeX = $iGuiX / 2 + Cos(2 * $iPI / 360 * ($wPlayer[0] + $iR + $ShootSaveLocation)) * 30 ; Oben X ; Das Auge das sich mit dem Player dreht
$augeY = $iGuiY / 2 - Sin(2 * $iPI / 360 * ($wPlayer[0] + $iR + $ShootSaveLocation)) * 30 ; Y
_QuickDraw_RotateNext($augeX, $augeY, 360 - ($wPlayer[0] + $iR + $ShootSaveLocation))
Else
$augeX = $iGuiX / 2 + Cos(2 * $iPI / 360 * ($wPlayer[0] + $iR + $irPlayer)) * 30 ; Oben X ; Das Auge das sich mit dem Player dreht
$augeY = $iGuiY / 2 - Sin(2 * $iPI / 360 * ($wPlayer[0] + $iR + $irPlayer)) * 30 ; Y
_QuickDraw_RotateNext($augeX, $augeY, 360 - ($wPlayer[0] + $iR + $irPlayer))
EndIf
_QuickDraw_Circle($augeX, $augeY, 40, $Texture2, 0xFFFFFFFF) ; Auge
If $MenuePic = True Then
_QuickDraw_Rect(0, 0, $iGuiX, $iGuiY, $Dummy_PicMenue, 0xFFFFFFFF)
Else
EndIf
[/autoit] [autoit][/autoit] [autoit]If $meneu = False Then
_CalcWall()
For $iWs = 0 To $iWsTmp
_2D3_Load($iWs)
_QuickDraw_Polygon(0, 0, $aPointsWall, 4, $Draw_Fill, $iwColor[1]);$bColor[0])
Next
AdlibRegister("_Control", $iTimeControl)
_QuickDraw_Polygon(0, 0, $aPointsPlayer, 4, $Draw_Fill, $iwColor[1]);$bColor[3])
[/autoit] [autoit][/autoit] [autoit]If $ShootEgg Then _calcShoot(); Fadenkreuz berechnen/Zeichnen
[/autoit] [autoit][/autoit] [autoit]_QuickDraw_Polygon(0, 0, $aTimerHG, 4, $Draw_Fill, $cColorHGtimer) ; Timer HG / hintergrund
$tmpTime_Anzeige = Round(TimerDiff($timerStart) / 1000, 1) ; Anzeige Timer
If Mod($tmpTime_Anzeige, 1) = 0 Then $tmpTime_Anzeige &= ".0"
_QuickDraw_Text(20, 30, $tmpTime_Anzeige & " Sek.", 28, $ptrFont, $Draw_Fill, 0xFF000000);anzeige
If $SaveTimingDisplay Then
$tmpTime_SaveTime = Round($SaveTimeing_display / 1000 - (TimerDiff($timerStart) / 1000))
If $tmpTime_SaveTime < 0 Then $tmpTime_SaveTime = 0
If $tmpTime_SaveTime <= -0.99 Then $SaveTimingDisplay = False
_QuickDraw_Circle($iGuiX / 2, $iGuiY / 3.5, 40, $Draw_Fill, 0xAA0000FF)
_QuickDraw_Text($iGuiX / 2 - 20, $iGuiY / 3.5 + 25, $tmpTime_SaveTime, 78, $ptrFont, $Draw_Fill, 0xFF00FF00)
;SaveTime display, anzeigen wenn save mode an ist.
EndIf
If $menue2 = True Then
om()
EndIf
Else ; Menue offen
_QuickDraw_Polygon(0, 0, $aMenueHG1, 4, $Draw_Fill, 0xAA000000);D34B25 )
_QuickDraw_Polygon(0, 0, $aMenueHG2, 4, $Draw_Fill, 0xAA06193C)
_QuickDraw_Text($iGuiX / 2 - 170, $iGuiY / 2 - 175, $menPreP[0] & $aMenueOptions[0], 78 + $menTexP[0], $ptrFont, $Draw_Fill, $menColP[0]) ; Menue Einträge
_QuickDraw_Text($iGuiX / 2 - 170, $iGuiY / 2 - 100, $menPreP[1] & $aMenueOptions[1], 78 + $menTexP[1], $ptrFont, $Draw_Fill, $menColP[1])
_QuickDraw_Text($iGuiX / 2 - 170, $iGuiY / 2 - 25, $menPreP[2] & $aMenueOptions[2], 78 + $menTexP[2], $ptrFont, $Draw_Fill, $menColP[2])
_QuickDraw_Text($iGuiX / 2 - 170, $iGuiY / 2 + 50, $menPreP[3] & $aMenueOptions[3], 78 + $menTexP[3], $ptrFont, $Draw_Fill, $menColP[3])
_QuickDraw_Text($iGuiX / 2 - 170, $iGuiY / 2 + 125, $menPreP[4] & $aMenueOptions[4], 78, $ptrFont, $Draw_Fill, $menColP[4])
_QuickDraw_Text($iGuiX / 2 - 170, $iGuiY / 2 + 200, $menPreP[5] & $aMenueOptions[5], 78 + $menTexP[5], $ptrFont, $Draw_Fill, $menColP[5])
If $menue2 = False Then
If $record < $letzterPunktestand Then
_QuickDraw_Text($iGuiX / 2 - 170, $iGuiY / 2 + 260, " Rekord!: " & $letzterPunktestand & " Sek", 40, $ptrFont, $Draw_Fill, 0xFF00FFFF)
IniWrite($Datei, "highscore", $menueIndex, $letzterPunktestand)
Else
_QuickDraw_Text($iGuiX / 2 - 170, $iGuiY / 2 + 260, "Kein Rekord: " & $letzterPunktestand & " Sek", 40, $ptrFont, $Draw_Fill, 0xFF00FFFF)
EndIf
If $menueGameOver Then _QuickDraw_Text($iGuiX / 2 - 150, $iGuiY / 2 - 280, "GAMEOVER", 60, $ptrFont, $Draw_Fill, 0xFFFF0000) ; Gameover text
Else
_QuickDraw_Text($iGuiX / 2 - 150, $iGuiY / 2 - 280, $Name, 60, $ptrFont, $Draw_Fill, 0xFFFF0000)
EndIf
_QuickDraw_Text( $iGuiX/2-40, $iGuiY-14,"SkipToPlay", 15, $ptrFont, $Draw_Fill, 0x18FF0000 )
_QuickDraw_Text($iGuiX - 260, $iGuiY - 40 - $ChLvlper / 8, "Musik:", 15, $ptrFont, $Draw_Fill, 0xFF00FFF0)
_QuickDraw_Text($iGuiX - 260 - $ChLvlper, $iGuiY - 20 - $ChLvlper / 8, "JamerikanBeatz @ YouTube", 20 + $ChLvlper / 8, $ptrFont, $Draw_Fill, 0xFF00FF00)
If $menueEingabe = True Then
Switch $menueIndex ; Menue einträge bei "Enter" abarbeiten
Case 0
$MenuePic = False
_F1()
_PlayMusic($menueIndex)
Case 1
$MenuePic = False
_F2()
_PlayMusic($menueIndex)
Case 2
$MenuePic = False
_PlayMusic($menueIndex)
_f3()
Case 3
$MenuePic = False
_PlayMusic($menueIndex)
_F4()
Case 4
$MenuePic = False
_PlayMusic($menueIndex)
_F5()
Case 5
_Exit()
EndSwitch
$menueEingabe = False
$meneu = False
$menueGameOver = False
EndIf
If Not ($menueIndex = 5) Then _QuickDraw_Text($iGuiX / 2 - 150, $iGuiY / 2 + 300, "Rekordzeit: " & $record & " Sek.", 40, $ptrFont, $Draw_Fill, 0xFFFF0000)
EndIf
If $fpsIngame = 1 Then
If $fps < $iMaxFrames Then
_QuickDraw_Text($iGuiX - 50, 30, $fps, 28, $ptrFont, $Draw_Fill, 0xFFFF0000)
Else
_QuickDraw_Text($iGuiX - 50, 30, $fps, 28, $ptrFont, $Draw_Fill, 0xFFFFFF00)
EndIf
EndIf
_QuickDraw_SwapBuffers()
EndFunc ;==>_dawHexagon
Func _Effects()
_MusicPulse()
If $color_1 Then _ColorHexagon()
If $color_2 Then _ColorWalls()
;~ If $color_3 Then _ColorWallSwitch()
;~ _WallPulse()
EndFunc ;==>_Effects
Func _ColorWalls()
If TimerDiff($iwColorTime) >= $iwColorSpeedTime Then
$iwColor[1] = _ChangeColor($iwColor[1], $iwColor[2], $iwColorSpeedPx)
If $iwColor[1] = -1 Then _NextColor(0)
$iwColorTime = TimerInit()
EndIf
EndFunc ;==>_ColorWalls
Func _ColorHexagon()
If TimerDiff($ihColorTime) >= $ihColorSpeedTime Then
$ihColor[1] = _ChangeColor($ihColor[1], $ihColor[2], $ihColorSpeedPx)
$ihColor2[1] = _ChangeColor($ihColor2[1], $ihColor2[2], $ihColorSpeedPx)
If $ihColor[1] = -1 Then _NextColor(1)
If $ihColor2[1] = -1 Then _NextColor(2)
$ihColorTime = TimerInit()
EndIf
EndFunc ;==>_ColorHexagon
Func _NextColor($ic)
If $ic = 0 Then
$iwColor[1] = $iwColor[2]
$iwColor[0] += 1
$iwColor[2] = $awColor[$iwColor[0]]
If $iwColor[0] >= $awColor[0] Then $iwColor[0] = 1
ElseIf $ic = 1 Then
$ihColor[1] = $ihColor[2]
$ihColor[0] += 1
$ihColor[2] = $ahColor[$ihColor[0]]
If $ihColor[0] >= $ahColor[0] Then $ihColor[0] = 1
ElseIf $ic = 2 Then
$ihColor2[1] = $ihColor2[2]
$ihColor2[0] += 1
$ihColor2[2] = $ahColor2[$ihColor2[0]]
If $ihColor2[0] >= $ahColor2[0] Then $ihColor2[0] = 1
EndIf
EndFunc ;==>_NextColor
Func _ChangeColor($iOld, $iNew, $iColorSpeedPx) ; Danke an minx
If $iOld = Dec(StringRight($iNew, 8)) Then Return -1
Local $iAo = BitAND($iOld, 0xFF000000) / 256 / 256 / 256
Local $iRo = BitAND($iOld, 0x00FF0000) / 256 / 256
Local $iGo = BitAND($iOld, 0x0000FF00) / 256
Local $iBo = BitAND($iOld, 0x000000FF)
Local $iAn = BitAND($iNew, 0xFF000000) / 256 / 256 / 256
Local $iRn = BitAND($iNew, 0x00FF0000) / 256 / 256
Local $iGn = BitAND($iNew, 0x0000FF00) / 256
Local $iBn = BitAND($iNew, 0x000000FF)
If $iAo < $iAn Then $iAo += $iColorSpeedPx
If $iRo < $iRn Then $iRo += $iColorSpeedPx
If $iGo < $iGn Then $iGo += $iColorSpeedPx
If $iBo < $iBn Then $iBo += $iColorSpeedPx
If $iAo > $iAn Then $iAo -= $iColorSpeedPx
If $iRo > $iRn Then $iRo -= $iColorSpeedPx
If $iGo > $iGn Then $iGo -= $iColorSpeedPx
If $iBo > $iBn Then $iBo -= $iColorSpeedPx
Return $iAo * 256 * 256 * 256 + $iRo * 256 * 256 + $iGo * 256 + $iBo
EndFunc ;==>_ChangeColor
Func _Load()
$awColor = StringSplit($swColor, ",")
$iwColor[0] = $loadColor[0]
$iwColor[1] = $awColor[1]
$iwColor[2] = $awColor[2]
$ahColor = StringSplit($shColor, ",")
$ihColor[0] = $loadColor[1]
$ihColor[1] = $ahColor[1]
$ihColor[2] = $ahColor[2]
$ahColor2 = StringSplit($shColor2, ",")
$ihColor2[0] = $loadColor[2]
$ihColor2[1] = $ahColor2[1]
$ihColor2[2] = $ahColor2[2]
EndFunc ;==>_Load
Func _MusicPulse()
$levels = _BASS_ChannelGetLevel($MusicHandle)
$rightChLvl = _BASS_LoWord($levels)
$LeftChLvl = _BASS_HiWord($levels)
$ChLvlper = (((Round(($LeftChLvl / 32768) * 100, 0) + Round(($rightChLvl / 32768) * 100, 0)) / 2) / 100) * $iMusicPulseTolerance
$iRadius2 = $iRadius2g - ($iMusicPulseTolerance / 3.2) + $ChLvlper
$iRadius3 = $iRadius3g - ($iMusicPulseTolerance / 3.2) + $ChLvlper
$wPlayer[3] = $wPlayerg[0] - ($iMusicPulseTolerance / 3.2) + $ChLvlper / 2.2
$wPlayer[4] = $wPlayerg[1] - ($iMusicPulseTolerance / 3.2) + $ChLvlper / 2.2
EndFunc ;==>_MusicPulse
Func _Control()
If _IsPressed(25, $uDLL) Then $irPlayer += $irpSpeedTMPl ;links
If _IsPressed(27, $uDLL) Then $irPlayer -= $irpSpeedTMPr ;rechts
If $irPlayer >= 361 Then $irPlayer = 1
If $irPlayer <= -1 Then $irPlayer = 359
$aPointsPlayer[0][0] = $iGuiX / 2 + Cos(2 * $iPI / 360 * ($wPlayer[0] + $iR + $irPlayer)) * $wPlayer[3] ; Oben X
$aPointsPlayer[0][1] = $iGuiY / 2 - Sin(2 * $iPI / 360 * ($wPlayer[0] + $iR + $irPlayer)) * $wPlayer[3] ; Y
$aPointsPlayer[3][0] = $aPointsPlayer[1][0] ; x
$aPointsPlayer[3][1] = $aPointsPlayer[1][1] ; y
$aPointsPlayer[1][0] = $iGuiX / 2 + Cos(2 * $iPI / 360 * ($wPlayer[1] + $iR + $irPlayer)) * $wPlayer[4] ; Unten X
$aPointsPlayer[1][1] = $iGuiY / 2 - Sin(2 * $iPI / 360 * ($wPlayer[1] + $iR + $irPlayer)) * $wPlayer[4] ; Y
$aPointsPlayer[2][0] = $iGuiX / 2 + Cos(2 * $iPI / 360 * ($wPlayer[2] + $iR + $irPlayer)) * $wPlayer[4] ; x
$aPointsPlayer[2][1] = $iGuiY / 2 - Sin(2 * $iPI / 360 * ($wPlayer[2] + $iR + $irPlayer)) * $wPlayer[4] ; y
_cFrei()
For $iH = 1 To $iHex
For $iW = 1 To $iWaende ; alle Wände auf der Map
If $aMap[$iH][$iW] = 1 And ($iW * $pxWaende - $iM) < $iGuiX Then
$iWRadius1 = (($iW + 1) * $pxWaende - $iM) ; Radius für Oben
$iWRadius2 = ($iW * $pxWaende - $iM) ; Radius für unten
$irTmp = ($iH * ($iGrad / $iHex))
$irTmp2 = ($iH * ($iGrad / $iHex)) + ($iGrad / $iHex)
If ($iWRadius2 < $wPlayer[3] And $iWRadius1 > $wPlayer[4] And Round(19 + $irPlayer) = $irTmp) Or ($iWRadius2 < $wPlayer[3] And $iWRadius1 > $wPlayer[4] And Round(19 + $irPlayer) = $irTmp2) Then ;15 25
_cBlock(1)
ElseIf ($iWRadius2 < $wPlayer[3] And $iWRadius1 > $wPlayer[4] And Round(21 + $irPlayer) = $irTmp) Or ($iWRadius2 < $wPlayer[3] And $iWRadius1 > $wPlayer[4] And Round(21 + $irPlayer) = $irTmp2) Then
_cBlock(0)
EndIf
EndIf
Next
Next
EndFunc ;==>_Control
Func _Rotation()
$iR += $irHexSpeed
If $iR >= 361 Then $iR = 1
If $iR <= -1 Then $iR = 359
EndFunc ;==>_Rotation
Func _WallSpeed()
$iM += $iWallSpeed
EndFunc ;==>_WallSpeed
Func _CalcWall()
$iWalls = $iHex * $iWaende
$iWsTmp = 0
For $iH = 1 To $iHex ; die Seiten
For $iW = 1 To $iWaende ; alle Wände auf der Map
If $aMap[$iH][$iW] = 1 And ($iW * $pxWaende - $iM) < $iGuiX Then
$iWRadius1 = (($iW + 1) * $pxWaende - $iM) ; Radius für Oben
$iWRadius2 = ($iW * $pxWaende - $iM) ; Radius für unten
If ($iW * $pxWaende - $iM) + $pxWaende <= $iRadius2 Then $aMap[$iH][$iW] = 0 ; Damit die Wand verschwindet
If ($iW * $pxWaende - $iM) <= $iRadius2 Then $iWRadius2 = $iRadius2 ; Damit die Wände hinter dem "Hexagon" verschwinden
$aPointsWall[1][0] = $iGuiX / 2 + Cos(2 * $iPI / 360 * ($iH * ($iGrad / $iHex) + $iR)) * $iWRadius1 ; oben x
$aPointsWall[1][1] = $iGuiY / 2 - Sin(2 * $iPI / 360 * ($iH * ($iGrad / $iHex) + $iR)) * $iWRadius1 ; y
$aPointsWall[2][0] = $iGuiX / 2 + Cos(2 * $iPI / 360 * (($iH + 1) * ($iGrad / $iHex) + $iR)) * $iWRadius1 ; x r
$aPointsWall[2][1] = $iGuiY / 2 - Sin(2 * $iPI / 360 * (($iH + 1) * ($iGrad / $iHex) + $iR)) * $iWRadius1 ; y r
$aPointsWall[0][0] = $iGuiX / 2 + Cos(2 * $iPI / 360 * ($iH * ($iGrad / $iHex) + $iR)) * $iWRadius2 ; unten x
$aPointsWall[0][1] = $iGuiY / 2 - Sin(2 * $iPI / 360 * ($iH * ($iGrad / $iHex) + $iR)) * $iWRadius2 ; y
$aPointsWall[3][0] = $iGuiX / 2 + Cos(2 * $iPI / 360 * (($iH + 1) * ($iGrad / $iHex) + $iR)) * $iWRadius2 ; x r
$aPointsWall[3][1] = $iGuiY / 2 - Sin(2 * $iPI / 360 * (($iH + 1) * ($iGrad / $iHex) + $iR)) * $iWRadius2 ; y r
_2D3_Set($aPointsWall, $iWsTmp)
If _Kollision_Viereck_Punkt($aPointsWall[1][0], $aPointsWall[1][1], $aPointsWall[2][0], $aPointsWall[2][1], $aPointsWall[0][0], $aPointsWall[0][1], $aPointsWall[3][0], $aPointsWall[3][1], $aPointsPlayer[0][0], $aPointsPlayer[0][1]) And $Play And Not $SaveTime Then _GameOver();ConsoleWrite("! NOPE "&@SEC&@CRLF);Beep(500,100)
$iWsTmp += 1
EndIf
Next
Next
$iWsTmp -= 1
EndFunc ;==>_CalcWall
Func _cFrei()
$irpSpeedTMPr = $irpSpeed
$irpSpeedTMPl = $irpSpeed
EndFunc ;==>_cFrei
Func _cBlock($id)
If $id Then
$irpSpeedTMPr = 0
Else
$irpSpeedTMPl = 0
EndIf
EndFunc ;==>_cBlock
Func _LoadMapfString($mString)
Return _Splitt2D($mString, @CR, ",")
EndFunc ;==>_LoadMapfString
Func _Splitt2D($sMap, $sSplitt, $sSplitt2)
Local $arMap[256][256]
$aSplitt = StringSplit($sMap, $sSplitt)
For $iS = 1 To $aSplitt[0]
$aSplitt2 = StringSplit($aSplitt[$iS], $sSplitt2)
For $iS2 = 1 To $aSplitt2[0]
$arMap[$iS][$iS2] = $aSplitt2[$iS2]
Next
Next
Return $arMap
EndFunc ;==>_Splitt2D
Func _2D3_Set($2DArray, $iCol) ; 2d array in 3d array abspeichern
$itmp1 = UBound($aWallPoints)
$itmp2 = UBound($aWallPoints, 2)
$itmp3 = UBound($aWallPoints, 3)
If $itmp1 <= $iCol Then ReDim $aWallPoints[$iCol + 1][$itmp2][$itmp3]
For $i = 0 To ($itmp2 - 1)
For $i2 = 0 To ($itmp3 - 1)
$aWallPoints[$iCol][$i][$i2] = $2DArray[$i][$i2]
Next
Next
EndFunc ;==>_2D3_Set
Func _2D3_Load($iCol) ; 2d array von 3d array laden
$itmp1 = UBound($aWallPoints, 1)
$itmp2 = UBound($aWallPoints, 2)
$itmp3 = UBound($aWallPoints, 3)
If $itmp1 <= $iCol Then
ReDim $aWallPoints[$iCol + 1][2][4]
EndIf
For $i = 0 To ($itmp2 - 1)
For $i2 = 0 To ($itmp3 - 1)
$aPointsWall[$i][$i2] = $aWallPoints[$iCol][$i][$i2]
Next
Next
EndFunc ;==>_2D3_Load
Func _Kollision_Viereck_Punkt($x1, $y1, $x2, $y2, $x3, $y3, $x4, $y4, $px, $py)
Return _Kollision_Dreieck_Punkt($x1, $y1, $x2, $y2, $x3, $y3, $px, $py) Or _Kollision_Dreieck_Punkt($x4, $y4, $x2, $y2, $x1, $y1, $px, $py)
EndFunc ;==>_Kollision_Viereck_Punkt
Func _Kollision_Dreieck_Punkt($x1, $y1, $x2, $y2, $x3, $y3, $px, $py)
Return ((($x1 - $px) * ($x2 - $px) + ($y1 - $py) * ($y2 - $py)) / ((($x1 - $px) ^ 2 + ($y1 - $py) ^ 2) ^ 0.5 * (($x2 - $px) ^ 2 + ($y2 - $py) ^ 2) ^ 0.5) + (($x2 - $px) * ($x3 - $px) + ($y2 - $py) * ($y3 - $py)) / ((($x2 - $px) ^ 2 + ($y2 - $py) ^ 2) ^ 0.5 * (($x3 - $px) ^ 2 + ($y3 - $py) ^ 2) ^ 0.5) + (($x3 - $px) * ($x1 - $px) + ($y3 - $py) * ($y1 - $py)) / ((($x3 - $px) ^ 2 + ($y3 - $py) ^ 2) ^ 0.5 * (($x1 - $px) ^ 2 + ($y1 - $py) ^ 2) ^ 0.5)) <= -1
EndFunc ;==>_Kollision_Dreieck_Punkt
Func _Exit()
_QuickDraw_Disable()
_BASS_Free()
DllClose($uDLL)
Exit
EndFunc ;==>_Exit
Func _Start($Schwierigkeit)
Switch $Schwierigkeit
Case 0 ; leicht
$iHex = 6
$iRSpeed = 1
$iMSpeed = 7.5
$irpSpeed = 0.7 ; Unter 1
$irHexSpeed = 1.8;1.4
$iWallSpeed = 4;3.5
$color_1 = True
$color_2 = False
$color_3 = False
;----------------------
$ShootEgg = False
_Load()
Case 1 ; normal
$iHex = 6
$iRSpeed = 1.1
$iMSpeed = 8.1
$irpSpeed = 0.8 ; Unter 1
$irHexSpeed = 2.0;1.4
$iWallSpeed = 4;3.5
;----------------------
$swColor = "0xFFFF0000,0xFF00FF00,0xFF0000FF,0xFFFF00FF";0xFFF3F3F3, ;0xFF1A246B , ; 0xFFF9DC0C , ; 0xFFE26D26
;~ $swColor = "0xFFF3F3F3,0xFF1A246B,0xFFF9DC0C,0xFFE26D26"
$iwColorSpeedPx = 5
$iwColorSpeedTime = 15
;--
;~ $shColor = "0xFFFF00FF,0xFF00FF0F,0xFF0F00FF,0xFF0F00FF"
;~ $shColor = "0xFFF3F3F3,0xFF1A246B,0xFFF9DC0C,0xFFE26D26"
;~ $shColor2 = "0xFFFFF0FF,0xF000FF0F,0xFF6F604F,0xFA0FB09F"
;~ $shColor2 = "0xFFF3F3F3,0xFF1A246B,0xFFF9DC0C,0xFFE26D26"
;~ $ihColorOn = True
$ihColorSpeedPx = 5
$ihColorSpeedTime = 10
;-----------------------------
$color_1 = True
$color_2 = False
$color_3 = False
;-------
$ShootEgg = True
$shootDauer = 0.7
$ShootAfterAim = 2.2
$ShootIntervalMin = 4.3
$ShootIntervalMax = 8.2
_Load()
Case 2 ; schwer
$iHex = 4;7
$iRSpeed = 1.4
$iMSpeed = 8.6
$irpSpeed = 0.9 ; Unter 1
$irHexSpeed = 1.6;2.1;1.4
$iWallSpeed = 3.1;3.5
$color_1 = True
$color_2 = True
$color_3 = False
;~ $swColor = "0xFFFF0000,0xFF00FF00,0xFF0000FF,0xFFFF00FF"
$iwColorSpeedPx = 5
$iwColorSpeedTime = 15
;--
;~ $shColor = "0xFFFF00FF,0xFF00FF0F,0xFF0F00FF,0xFF0F00FF"
;~ $shColor2 = "0xFFFFF0FF,0xF000FF0F,0xFF6F604F,0xFA0FB09F"
;~ $ihColorOn = True
$ihColorSpeedPx = 5
$ihColorSpeedTime = 10
;-------------
$ShootEgg = True
$shootDauer = 0.4;1.3
$ShootAfterAim = 2.1
$ShootIntervalMin = 4
$ShootIntervalMax = 6.5
_Load()
Case 3 ; extrem
$iHex = 8
$iRSpeed = 1.9
$iMSpeed = 9
$irpSpeed = 0.85 ; Unter 1
$irHexSpeed = 2.4;1.4
$iWallSpeed = 4;3.5
$color_1 = False
$color_2 = True
$color_3 = False
;---------------------
$ShootEgg = True
$shootDauer = 1.5
$ShootAfterAim = 0.5;2.5
$ShootIntervalMin = 3.5
$ShootIntervalMax = 6.9
_Load()
Case 4 ; unmöglich
$iHex = 10;8
$iRSpeed = 2;1.9
$iMSpeed = 9.1
$irpSpeed = 0.75 ; Unter 1
$irHexSpeed = 3;1.4
$iWallSpeed = 5;4.2;3.5
$color_1 = True
$color_2 = True
$color_3 = False
;---------------------
$ShootEgg = True
$shootDauer = 1.4
$ShootAfterAim = 0.55;1.5
$ShootIntervalMin = 2.1
$ShootIntervalMax = 5.2
_Load()
EndSwitch
$Play = True
$SaveTime = True
$timerStart = TimerInit()
EndFunc ;==>_Start
Func _GameOver($start = 1, $fail = True)
AdlibUnRegister("_Control")
Local $gameoverTime = TimerDiff($timerStart)
$letzterPunktestand = Round($gameoverTime / 1000, 1)
$Play = False
If $fail Then
$menueGameOver = True
$MenuePic = True
$Dummy_PicMenue = _QuickDraw_ReadTextureFormBuffer(0, 0, $iGuiX, $iGuiY)
om()
EndIf
$record = IniRead($Datei, "highscore", $menueIndex, 0)
$enable = True
$menue2 = False
_Start($start)
EndFunc ;==>_GameOver
Func _F1($z = True)
$aMap = _LoadMapfString(FileRead(@ScriptDir & "\F.txt"))
If $z = True Then
_GameOver(0, False)
$SaveTime = True
EndIf
EndFunc ;==>_F1
Func _F2($z = True)
$aMap = _LoadMapfString(FileRead(@ScriptDir & "\F.txt"))
If $z = True Then
_GameOver(1, False)
$SaveTime = True
EndIf
EndFunc ;==>_F2
Func _f3($z = True)
$aMap = _LoadMapfString(FileRead(@ScriptDir & "\F2.txt"))
If $z = True Then
_GameOver(2, False)
$SaveTime = True
EndIf
EndFunc ;==>_f3
Func _F4($z = True)
$aMap = _LoadMapfString(FileRead(@ScriptDir & "\F3.txt"))
If $z = True Then
_GameOver(3, False)
$SaveTime = True
EndIf
EndFunc ;==>_F4
Func _F5($z = True)
$aMap = _LoadMapfString(FileRead(@ScriptDir & "\F4.txt"))
If $z = True Then
_GameOver(4, False)
$SaveTime = True
EndIf
EndFunc ;==>_F5
Func _Load_dif($difficult, $z = False)
Switch $difficult
Case 0
_F1($z)
Case 1
_F2($z)
Case 2
_f3($z)
Case 3
_F4($z)
Case 4
_F5($z)
EndSwitch
EndFunc ;==>_Load_dif
Func om()
If $meneu Then
HotKeySet("{up}")
HotKeySet("{down}")
HotKeySet("{enter}")
$meneu = False
$menueGameOver = False
_Start($MenueOption)
_Load_dif($MenueOption)
;~ _Bass_SetVolume($MusicVollume)
Else
$gameoverTime = TimerDiff($timerStart)
$letzterPunktestand = Round($gameoverTime / 1000, 1)
HotKeySet("{up}", "_up")
HotKeySet("{down}", "_down")
HotKeySet("{enter}", "_enter")
_MenueUpdate()
$meneu = True
$SaveTimingDisplay = False
;~ _Bass_SetVolume($MusicVollume/3)
EndIf
EndFunc ;==>om
Func _MenueUpdate()
For $t = 0 To 5
$menTexP[$t] = 0
$menColP[$t] = 0xFF000000
$menPreP[$t] = ""
Next
For $t = 0 To 5
If $t = $menueIndex Then
$menTexP[$t] = 14
$menColP[$t] = 0xFF00FF00
$menPreP[$t] = "-> "
EndIf
Next
EndFunc ;==>_MenueUpdate
Func _up()
$menueIndex -= 1
If $menueIndex < 0 Then $menueIndex = 0
$record = IniRead($Datei, "highscore", $menueIndex, 0)
$enable = False
$menue2 = True
_MenueUpdate()
EndFunc ;==>_up
Func _down()
$menueIndex += 1
If $menueIndex > 5 Then $menueIndex = 5
$record = IniRead($Datei, "highscore", $menueIndex, 0)
$enable = False
$menue2 = True
_MenueUpdate()
EndFunc ;==>_down
Func _enter()
$menueEingabe = True
_MenueUpdate()
EndFunc ;==>_enter
Func _calcShoot()
If $ShootEgg_p Then
If TimerDiff($ShootTimer) >= $ShootInterval * 1000 Then
$ShootSaveLocation = $irPlayer
$shoot = True
$ShootEgg_p = False
EndIf
ElseIf $ShootEgg_p = False And $shoot = False Then
$ShootTimer = TimerInit()
$ShootEgg_p = True
$ShootInterval = Round(Random($ShootIntervalMin, $ShootIntervalMax), 3)
ElseIf $shoot And $shoot2 = False Then
If TimerDiff($ShootTimer) >= (($ShootInterval + $ShootAfterAim) * 1000) Then
$shoot2 = True
Else
$ShootPoints[0] = $iGuiX / 2 + Cos(2 * $iPI / 360 * ($wPlayer[0] + $iR + $ShootSaveLocation)) * $wPlayer[3] ; Oben X
$ShootPoints[1] = $iGuiY / 2 - Sin(2 * $iPI / 360 * ($wPlayer[0] + $iR + $ShootSaveLocation)) * $wPlayer[3] ; Y
_QuickDraw_Circle($ShootPoints[0] - 20, $ShootPoints[1] - 20, 40, $Texture3, 0xFFFFFFFF)
EndIf
ElseIf $shoot2 = True Then
If TimerDiff($ShootTimer) <= (($ShootInterval + $ShootAfterAim + $shoot + $shootDauer) * 1000) Then
$LaserPoints[0][0] = $augeX + Cos(2 * $iPI / 360 * ($wPlayer[0] + $iR + $ShootSaveLocation + 180 / -2)) * 10
$LaserPoints[0][1] = $augeY - Sin(2 * $iPI / 360 * ($wPlayer[0] + $iR + $ShootSaveLocation + 180 / -2)) * 10 ; Y
$LaserPoints[1][0] = $augeX + Cos(2 * $iPI / 360 * ($wPlayer[0] + $iR + $ShootSaveLocation + 180 / 2)) * 10
$LaserPoints[1][1] = $augeY - Sin(2 * $iPI / 360 * ($wPlayer[0] + $iR + $ShootSaveLocation + 180 / 2)) * 10 ; Y
$LaserPoints[2][0] = $augeX + Cos(2 * $iPI / 360 * ($wPlayer[0] + $iR + $ShootSaveLocation + $LaserBreite / 2)) * $GuiVerltnis ; Kordinaten +/- Sin/Cos(Winkel) * Radius
$LaserPoints[2][1] = $augeY - Sin(2 * $iPI / 360 * ($wPlayer[0] + $iR + $ShootSaveLocation + $LaserBreite / 2)) * $GuiVerltnis ; Y
$LaserPoints[3][0] = $augeX + Cos(2 * $iPI / 360 * ($wPlayer[0] + $iR + $ShootSaveLocation + $LaserBreite / -2)) * $GuiVerltnis
$LaserPoints[3][1] = $augeY - Sin(2 * $iPI / 360 * ($wPlayer[0] + $iR + $ShootSaveLocation + $LaserBreite / -2)) * $GuiVerltnis ; Y
_QuickDraw_Polygon(0, 0, $LaserPoints, 4, $Draw_Fill, 0xAAFF0000)
_QuickDraw_Circle($augeX, $augeY, 20, $Draw_Fill, 0xAAFF0000)
If _Kollision_Viereck_Punkt($LaserPoints[1][0], $LaserPoints[1][1], $LaserPoints[2][0], $LaserPoints[2][1], $LaserPoints[0][0], $LaserPoints[0][1], $LaserPoints[3][0], $LaserPoints[3][1], $aPointsPlayer[0][0], $aPointsPlayer[0][1]) And $Play And Not $SaveTime Then _GameOver()
Else
$shoot2 = False
$shoot = False
EndIf
EndIf
EndFunc ;==>_calcShoot
[/autoit] [autoit][/autoit] [autoit]Func _PlayMusic($index)
_BASS_ChannelStop($MusicHandle)
Switch $index
Case 0 ; Leicht
$file = @ScriptDir & "\Music\JamerikanBeatz - Party Boy (Electro).mp3"
;~ $file = @ScriptDir & "\Music\Big_Cars.mp3"
Case 1 ; Normal
$file = @ScriptDir & "\Music\JamerikanBeatz - Last Time (Dubstep).mp3"
;~ $file = @ScriptDir & "\Music\Dub_Star.mp3"
Case 2 ; Schwer
$file = @ScriptDir & "\Music\JamerikanBeatz - Techno Toys (Techno).mp3"
;~ $file = @ScriptDir & "\Music\ColdRise.mp3"
Case 3 ; Extrem
$file = @ScriptDir & "\Music\JamerikanBeatz - Home Dance (Electro).mp3"
;~ $file = @ScriptDir & "\Music\Mile_High.mp3"
Case 4 ; Unmöglich
$file = @ScriptDir & "\Music\JamerikanBeatz - X-Mas Wobble (Dubstep_16-Bit).mp3"
;~ $file = @ScriptDir & "\Music\The_End_Is_Near.mp3"
EndSwitch
$MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0)
$iLength = _BASS_ChannelGetLength($MusicHandle, $BASS_POS_BYTE)
$sLength = _SecFormat($MusicHandle, $iLength)
AdlibRegister("_Play", $sLength * 1000)
;~ ConsoleWrite($sLength * 1000 & @CRLF)
_Play()
EndFunc ;==>_PlayMusic
Func _Play()
_BASS_ChannelPlay($MusicHandle, 1)
_Bass_SetVolume($MusicVollume)
EndFunc ;==>_Play
Func _SecFormat($hMusic, $iBytes)
Local $iSeconds = _BASS_ChannelBytes2Seconds($hMusic, $iBytes)
Return $iSeconds
EndFunc ;==>_SecFormat
Download
https://www.dropbox.com/s/bv6d6d1nxn25…exagon.rar?dl=0
Ich würde gerne wissen wie Ihr dieses Spiel findet