287 questions
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.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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
What kind of movement do you want the ball to make?
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