none
error RRS feed

  • Question

  • I'm trying to make a code that is kind of like the moving guy in space invaders, but I'm getting a

    "3,25:The operation 'GraphicsWindow.DrawEllipse' is expected to return a value, but doesn't return anything"

    __________________________________________________________________________________________________

    Init:
    x = 400
    player = GraphicsWindow.DrawEllipse(x, 700, 50, 50)


    move:
    GraphicsWindow.KeyDown = onkeydown
    GraphicsWindow.KeyUp = onkeyup


    Sub onkeydown
      key = GraphicsWindow.LastKey
      If (key = "left")Then
        nextx = x - 5
        Shapes.Animate(player, nextx, 700, 400)
        x = nextx
      EndIf
      If (key = "right")Then
        nextx = x + 5
        Shapes.Animate(player, nextx, 700, 400)
      EndIf
    EndSub


    Sub onkeyup

    EndSub

    ____________________________________________________________________________________________________________________

    This code isn't done, and if you could help me understand this error

    PS I should really change my username!

      
    Wednesday, March 28, 2012 5:09 AM

Answers

  • Hello ProgrammerHelp!

    GraphicsWindow.DrawEllipse() just draws a static ellipse on the background. It has nothing to do w/ Shapes. If you highlight it, you'll see an SB's explanation on the right side, appointing the fact it returns: nothing.
    Try Shapes.AddEllipse() instead!
    Another detail -> "left" & "right" are not recognized as valid keys. Shoulda been "Left" & "Right".
    Keeping moving forward!  :D
    Wednesday, March 28, 2012 6:49 AM
    Answerer

All replies