erstmal der code
Code: Alles auswählen
; Init
InitSprite()
InitKeyboard()
OpenScreen(640,480,16,"")
Global BallX.w
Global BallY.w
Global SchlaegerX.w
Global SchlaegerY.w
Global Punkte.w
Global Lives.w
Global Ball.w
Global BewegX.w
Global BewegY.w
BallX = 319
BallY = 239
Lives = 3
BewegX = -50
BewegY = -50
SchlaegerX = 639 - 10
SchlaegerY = 239 - (30 / 2)
LoadSprite(1,"GFX\Back.bmp", 0)
Repeat
If BallX > 460
Durchgefallen = Durchgefallen + 1
EndIf
; Malen!!!!
StartDrawing(ScreenOutput())
FrontColor(255,255,255)
Box(0,0,0,480)
Box(0,0,640,20)
Box(0,460,640,20)
StopDrawing()
StartDrawing(ScreenOutput())
FrontColor(0,255,0)
Box(SchlaegerX,SchlaegerY,10,30)
StopDrawing()
StartDrawing(ScreenOutput())
FrontColor(255,255,255)
Box(BallX-1,BallY-1,3,3)
StopDrawing()
FlipBuffers()
DisplaySprite(1,0,0)
; Tastatureingaben
ExamineKeyboard()
If KeyboardPushed(200)
SchlaegerY - 1
EndIf
If KeyboardPushed(208)
SchlaegerY + 1
EndIf
If SchlaegerY < 21
SchlaegerY = 20
ElseIf SchlaegerY > 460 - 30
SchlaegerY = 460 - 30
EndIf
; Ball Bewegung
BallX + BewegX
BallY + BewegY
If BallX < 20
BewegX = 1
EndIf
If BallY < 20
BewegY = 1
EndIf
If BallY > 460
BewegY = -1
EndIf
If BallX > SchlaegerX And BallX < SchlaegerX + 10 And BallY > SchlaegerY And BallY < SchlaegerY + 30
BewegX = -1
EndIf
Until KeyboardPushed(1) Or Lives = 0
ich will da die live anzeige mitreinbringen, was dann so aussehen müsste
(oder auch nicht)
Code: Alles auswählen
; Init
InitSprite()
InitKeyboard()
OpenScreen(640,480,16,"")
Global BallX.w
Global BallY.w
Global SchlaegerX.w
Global SchlaegerY.w
Global Punkte.w
Global Lives.w
Global Ball.w
Global BewegX.w
Global BewegY.w
BallX = 319
BallY = 239
Lives = 3
BewegX = -50
BewegY = -50
SchlaegerX = 639 - 10
SchlaegerY = 239 - (30 / 2)
LoadSprite(1,"GFX\Back.bmp", 0)
Repeat
If BallX > 460
Durchgefallen = Durchgefallen + 1
EndIf
; Malen!!!!
StartDrawing(ScreenOutput())
FrontColor(255,255,255)
Box(0,0,0,480)
Box(0,0,640,20)
Box(0,460,640,20)
StopDrawing()
StartDrawing(ScreenOutput())
FrontColor(0,255,0)
Box(SchlaegerX,SchlaegerY,10,30)
StopDrawing()
StartDrawing(ScreenOutput())
FrontColor(255,255,255)
Box(BallX-1,BallY-1,3,3)
StopDrawing()
FlipBuffers()
DisplaySprite(1,0,0)
; Tastatureingaben
ExamineKeyboard()
If KeyboardPushed(200)
SchlaegerY - 1
EndIf
If KeyboardPushed(208)
SchlaegerY + 1
EndIf
If SchlaegerY < 21
SchlaegerY = 20
ElseIf SchlaegerY > 460 - 30
SchlaegerY = 460 - 30
EndIf
; Anzeigen
StartDrawing(ScreenOutput())
DrawingMode(1)
Locate(10,0)
FrontColor(0,0,255)
DrawText("Lives:" + Str(Lives))
StopDrawing()
FlipBuffers()
ClearScreen(0,0,0)
; Ball Bewegung
BallX + BewegX
BallY + BewegY
If BallX < 20
BewegX = 1
EndIf
If BallY < 20
BewegY = 1
EndIf
If BallY > 460
BewegY = -1
EndIf
If BallX > SchlaegerX And BallX < SchlaegerX + 10 And BallY > SchlaegerY And BallY < SchlaegerY + 30
BewegX = -1
EndIf
Until KeyboardPushed(1) Or Lives = 0
also.. bei mir flimmert der bildschirm
1. frage
wieso?
2.frage
wie setz ich den ball wieder in die mitte wenn er raus fliegt?
andres problem
wenn ich versuch die lives abzuziehen mit den code
Code: Alles auswählen
If BallX > 460
Lives = Lives - 1
Endif
ok das wars erstmal, sorry für die newbie post..
ich will ehrliche antworten^^