Android Tutorial JumpingSmiley - GameView example III

Discussion in 'Tutorials & Examples' started by Erel, Feb 7, 2013.

Thread Status:
Not open for further replies.
  1. James Abalos

    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
     
  2. DonManfred

    DonManfred Expert Licensed User

    1. It is never a good idea to post to existing threads. Always create a NEW thread for any Question you have
    2. Please use [CODE]code here...[/CODE] tags when posting code.

    [​IMG]
    [​IMG]
    [​IMG]
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    This is a very old example. There is no reason to learn it. Use XUI2D instead: [XUI2D] Example Pack
     
Thread Status:
Not open for further replies.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice