Naja habs aufgeben trotzdem Danke das ihrs versucht habt mir zu helfen.
-Sprite drehen ohen 3D Befehle (Codes die ich dazu gefunden haben funtkionieren leider nicht so wie sie sollen)
Code: Alles auswählen
Enumeration
#bild1
#bild2
#bild3
#bild4
EndEnumeration
Procedure Window()
Protected EventID
Shared Quit
EventID = WindowEvent()
Repeat
If EventID = #PB_Event_CloseWindow
Quit = 1
EndIf
EventID = WindowEvent()
Until EventID = 0
EndProcedure
;/
Procedure Ende(Text$)
Shared Titel$
MessageRequester(Titel$, Text$)
End
EndProcedure
;/
Structure Stein
image.l
X.l
Y.l
EndStructure
NewList stein.stein()
If Not (InitSprite() And InitKeyboard())
Ende("Init Error")
EndIf
ScreenX = 450
ScreenY = 600
XZ = 0
ZX = 0
If OpenWindow(0, XZ, ZX, ScreenX, ScreenY, "X360´s Tetris", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If OpenWindowedScreen(WindowID(0), XZ, ZX, ScreenX, ScreenY, 0, 0, 0)
SetFrameRate(50)
Else
Ende("Screen Error")
EndIf
Else
Ende("Window Error")
EndIf
;/ Startbildschirm
CreateSprite(8, 15, 15)
StartDrawing(SpriteOutput(8))
Box(0, 0, 14, 14, RGB(255, 255, 255))
StopDrawing()
Global Dim LevelDaten.l(410, 200)
Procedure LevelEinlesen()
Restore map
For Yl = 0 To 39
For Xl = 0 To 19
Read LevelDaten(Yl, Xl)
Next
Next
EndProcedure
Procedure LevelAusgeben()
For Yl = 0 To 39
For Xl = 0 To 19
If LevelDaten(Yl, Xl) = 1
DisplaySprite(8, Xl*15, Yl*15)
EndIf
Next
Next
EndProcedure
;Viereck
CreateSprite(1, 30, 30);, #PB_Sprite_Texture)
StartDrawing(SpriteOutput(1))
Box(0, 0, 30, 30, $FFFFFF)
Line(0, 15, 30, 0, $000000)
Line(15, 0, 0, 30, $000000)
StopDrawing()
CreateSprite(2, 45, 30);, #PB_Sprite_Texture)
StartDrawing(SpriteOutput(2))
Box(15, 0, 15, 15, $FFFFFF)
Box(0, 15, 45, 15, $FFFFFF)
Line(15, 14, 15, 0, $000000)
Line(14, 15, 0, 15, $000000)
Line(29, 15, 0, 15, $000000)
StopDrawing()
CreateSprite(3, 60, 15);, #PB_Sprite_Texture)
StartDrawing(SpriteOutput(3))
Box(0, 0, 60, 15, $FFFFFF)
For i = 15 To 45 Step 15
Line(i, 0, 0, 15, $000000)
Next
StopDrawing()
CreateSprite(4, 45, 30);, #PB_Sprite_Texture)
StartDrawing(SpriteOutput(4))
Box(0, 0, 45, 30, $FFFFFF)
Box(0, 0, 30, 15, $000000)
Line(30, 14, 15, 0, $000000)
Line(14, 15, 0, 15, $000000)
Line(29, 15, 0, 15, $000000)
StopDrawing()
CreateSprite(5, 45, 30)
StartDrawing(SpriteOutput(5))
Box(0, 0, 45, 30, $FFFFFF)
Box(15, 0, 30, 15, $000000)
Line(0, 14, 15, 0, $000000)
Line(15, 15, 0, 15, $000000)
Line(30, 15, 0, 15, $000000)
StopDrawing()
CreateSprite(6, 45, 30)
StartDrawing(SpriteOutput(6))
Box(0, 0, 45, 30, $FFFFFF)
Box(0, 0, 15, 15, $000000)
Box(30, 14, 30, 16, $000000)
Line(30, 0, 0, 15, $000000)
Line(14, 15, 0, 15, $000000)
Line(15, 14, 15, 0, $000000)
StopDrawing()
CreateSprite(7, 45, 30)
StartDrawing(SpriteOutput(7))
Box(0, 0, 45, 30, $FFFFFF)
Box(0, 15, 15, 15, $000000)
Box(30, 0, 15, 16, $000000)
Line(15, 15, 15, 0, $000000)
Line(14, 0, 0, 15, $000000)
Line(30, 15, 0, 15, $000000)
StopDrawing()
CreateSprite(#bild1, 125, 20)
CreateSprite(#bild2, 125, 20)
CreateSprite(#bild3, 125, 20)
CreateSprite(#bild4, 125, 20)
StartDrawing(SpriteOutput(#bild1))
DrawingMode(#PB_2DDrawing_Transparent)
Box(0, 0, 125, 20, $444444)
Box(3, 3, 119, 14, $222222)
DrawText(4, 1, "Neustarten | F1", $FFFFFF)
StopDrawing()
StartDrawing(SpriteOutput(#bild2))
DrawingMode(#PB_2DDrawing_Transparent)
Box(0, 0, 125, 20, $444444)
Box(3, 3, 119, 14, $222222)
DrawText(4, 1, "Pause | F2", $FFFFFF)
StopDrawing()
StartDrawing(SpriteOutput(#bild3))
DrawingMode(#PB_2DDrawing_Transparent)
Box(0, 0, 125, 20, $444444)
Box(3, 3, 119, 14, $222222)
DrawText(4, 1, "Highscore reset", $FFFFFF)
StopDrawing()
StartDrawing(SpriteOutput(#bild4))
DrawingMode(#PB_2DDrawing_Transparent)
Box(0, 0, 125, 20, $444444)
Box(3, 3, 119, 14, $222222)
DrawText(4, 1, "Beenden| F3", $FFFFFF)
StopDrawing()
For i = 1 To 6
TransparentSpriteColor(i, $000000)
Next
Steinvorschau2 = Random(6) + 1
Steinvorschau = Random(6) + 1
neu = 0
anzeige = 1
LevelEinlesen()
Repeat
If start = 1
For Yl = 0 To 39
For Xl = 0 To 19
If Xl*15 = Stein()\x And yl*15 = Stein()\Y
If SpriteHeight(stein()\image) = 30
; LevelDaten(Stein()\Y/15, Stein()\X/15) = 1
EndIf
EndIf
Next
Next
EndIf
Window()
ClearScreen($00000)
DisplaySprite(#bild1, 315, 480)
DisplaySprite(#bild2, 315, 510)
DisplaySprite(#bild3, 315, 540)
DisplaySprite(#bild4, 315, 570)
Timer = (ElapsedMilliseconds()-Timer2)/1000
ExamineKeyboard()
If Punkte>(1000*level) + Random(500)
Level + 1
EndIf
If start2 = 1
Punkte = 0
Level = 1
Timer2 = ElapsedMilliseconds()
start2 = 0
EndIf
If start = 0
If KeyboardPushed(#PB_Key_All)
start = 1
start2 = 1
EndIf
EndIf
brb + 3
brb2 + 1
If KeyboardPushed(#PB_Key_Escape)
Quit = 1
EndIf
If whait = 1
If KeyboardPushed(#PB_Key_Right)And brb>15 And Not Stein()\x>285-(SpriteWidth(Stein()\image))
brb = 0
Stein()\x + 15
EndIf
If KeyboardPushed(#PB_Key_Down) And brb2>5
brb2 = 0
If stein()\y<screeny;-SpriteHeight(stein()\image)
Stein()\y + 15
EndIf
EndIf
If KeyboardPushed(#PB_Key_Space) And whait = 1 And brb2>10
brb2 = 0
If stein()\y<screeny;-SpriteHeight(stein()\image)
unten = screeny-stein()\y
Stein()\y + unten
EndIf
EndIf
If KeyboardPushed(#PB_Key_Left) And brb>15 And Not Stein()\x<Stein()\image
brb = 0
Stein()\x-15
EndIf
EndIf
brb + 1
If start = 1
If neu = 0
Steinvorschau2 = Random(6) + 1
EndIf
DisplaySprite(Steinvorschau2, 350, 70)
EndIf
If start = 1 And neu = 0
AddElement(Stein())
Stein()\X = 30
Stein()\image = Steinvorschau
Stein()\y = 0
neu = 1
EndIf
ForEach Stein()
DisplayTransparentSprite(Stein()\image, Stein()\x, Stein()\y-SpriteHeight(Stein()\image))
Next
If start = 1
If count = 0
count = 1
counter = ElapsedMilliseconds()
EndIf
If (ElapsedMilliseconds()-counter)>2000/(level/0.8)
If stein()\y<screeny
Stein()\y + 15
count = 0
Else
Steinvorschau = Steinvorschau2
neu = 0
EndIf
EndIf
EndIf
StartDrawing(ScreenOutput())
LevelAusgeben()
If KeyboardPushed(#PB_Key_Up) And brb2>30
EndIf
DrawingMode(#PB_2DDrawing_Transparent)
FrontColor(0)
DrawText(340, 5, "Vorschau", $FFFFFF)
Line(300, 0, 0, ScreenY, $FFFFFF)
Line(300, 150, 150, 0, $FFFFFF)
If Start = 0
DrawText(20, 260, "Beliebige Taste drücken um zu Starten", $FFFFFF)
EndIf
MX = WindowMouseX(0)
MY = WindowMouseY(0)
DrawText(310, 160, "Highscore", $EEEEEE)
DrawText(310, 210, "Level", $EEEEEE)
DrawText(310, 260, "Punkte", $EEEEEE)
DrawText(310, 310, "Spielzeit", $EEEEEE)
If start = 1 And whait = 1
DrawText(330, 230, Str(Level), $FFFFFF)
DrawText(330, 280, Str(Punkte), $FFFFFF)
DrawText(330, 330, Str(Timer) + " Sekunden", $FFFFFF)
Else
DrawText(330, 230, "0", $FFFFFF)
DrawText(330, 280, "0", $FFFFFF)
DrawText(330, 330, "0", $FFFFFF)
EndIf
If start = 1 And whait = 0
whait = 1
brb2 = 0
EndIf
Line(300, 450, 150, 0, $FFFFFF)
DrawText(310, 455,"Spielmenü",$FFFFFF)
StopDrawing()
Delay(1)
FlipBuffers()
Until Quit
End
DataSection
map:
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
EndDataSection
Ich versuche gerade verschiedene Minispiele in Schwarz weiß umzusetzen ("viele" gelingen , "viele" nicht
(Ich plane einen kleinen Retro Automaten wo man die verschiedenen Spiele auswählen kann ... )