Jump rope game small basic

Anonymous
2021-06-20T01:23:32.387+00:00

Hi, I'm making a jump rope kind of game in small basic and I was wondering if anyone can help with code. So, I'm trying to make the ball bounce up and down each time you click the mouse, but I can't figure it out. If anyone can help that'd be great

Developer technologies | Small BASIC
0 comments No comments
{count} votes

Accepted answer
  1. WhTurner 1,611 Reputation points
    2021-06-20T08:35:52.443+00:00

    What kind of movement do you want the ball to make?

    • from no movement : mouseclick ball moves up. second click move down to "earth"
    • or with mouseclick reverse movement,
    • or an other reaction on click.

    Computer programmimg is to be precise. You have to describe exactly in words what you want, and then try to translate that into programming language.


1 additional answer

Sort by: Most helpful
  1. WhTurner 1,611 Reputation points
    2021-06-20T13:32:02.69+00:00

    As a start:

    GwH=GraphicsWindow.Height
    GwW=GraphicsWindow.Width
    
    GraphicsWindow.BackgroundColor="lightyellow"
    GraphicsWindow.BrushColor="green"
    GraphicsWindow.FillRectangle(0,GwH-30,GwW,30)
    ball=Shapes.AddEllipse(20,20)
    Shapes.Move(ball,100,GwH-50)
    GraphicsWindow.MouseDown=MD  '' subroutine executed when mouseclicked
    
    While "true"  ''endless loop
      Program.Delay(950)
      If click=1 Then
        For xxx=50 To 300 step 3
          shapes.Move(ball,100,GwH-xxx)
          Program.Delay(.5)
        EndFor
        For xxx=300 To 50 Step -3
          Shapes.Move(ball,100,GwH-xxx)
          Program.Delay(.5)
        EndFor
        click=0
    
      EndIf
    EndWhile
    
    Sub MD
      click=1
    EndSub
    
    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.