fb:porticula NoPaste
Spiel-Code II, Fehlermeldungen, !! wahrscheinlich relevanter Teil !! dotfigure.bas
Uploader: | Mao |
Datum/Zeit: | 21.06.2007 20:59:11 |
#include once "main.bas"
#include once "constants.bas"
#include once "gfx.bas"
Type DotFigure
Const DotWidth=20
Const DotHeight=20
Dim As Integer X, Y
Dim As Double VX, VY
Dim As SrfcePtr DotGraphic
Declare Sub LoadDotGraphic(Filename As String)
Declare Sub Move(DeltaTime As Unsigned Integer)
Declare Sub Show(Surface As SrfcePtr)
End Type
Sub DotFigure.LoadDotGraphic(Filename As String)
DotGraphic=LoadImage(Filename)
End Sub
Sub DotFigure.Move(DeltaTime As Unsigned Integer)
X+=VX*(DeltaTime/1000.0)
If X<=0 Then
X=0
VX*=-1
ElseIf X>=SCREEN_WIDTH-DotWidth Then
X=SCREEN_WIDTH-DotWidth
VX*=-1
End If
Y+=VY*(DeltaTime/1000.0)
If Y<0 Then
Y=0
VY*=-1
ElseIf Y>=SCREEN_HEIGHT-DotHeight Then
Y=SCREEN_HEIGHT-DotHeight
VY*=-1
End If
End Sub
Sub DotFigure.Show(Surface As SrfcePtr)
BlitSurface(X, Y, DotGraphic, Surface)
End Sub