Android Tutorial JumpingSmiley - GameView example III

Status
Not open for further replies.

James Abalos

New Member
Not all code paths return a value.

Public Sub Tick As Boolean
mAnimator.vy = vy
Dim visible As Boolean = mAnimator.Tick(bd)
vy = 0
If Not(visible) Then
bd.Delete = True
Return True
End If
End Sub

//

Private Sub CreateBrick(y As Int) As Brick
Dim brck As Brick
Dim bd As BitmapData
Dim size As Float = Rnd(15%x, 25%x)
Dim x As Float = Rnd(0, 100%x - size)
bd.DestRect.Initialize(x, y, x + size, y + 2%y)
gv.BitmapsData.Add(bd)
Dim animator As SpriteAnimator
animator.Initialize
animator.width = size
animator.height = 2%y
Dim r As Rect
Dim bmp As Bitmap
brck.Initialize(bd, animator)
If Rnd(1, 5) = 4 Then
'disappearing brick
bmp = disappearBrickImage
brck.disappearing = True
Else
bmp = regularBrickImage
End If
animator.SetFrames(bd, Array As Rect(r), Array As Bitmap(bmp))

bricks.Add(brck)
If Rnd(1, 5) = 4 Then animator.vx = PerXToCurrent(Rnd(-12, 12) / 10)

End Sub
 
Status
Not open for further replies.
Top