Jump to content

Small basic program (Geo)

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
Geo

Geo

    Newbie

  • Members
  • Pip
  • 1 posts
:c-thumbdown: I have a query about a program for small basic that I wrote. Not related to this topic but can someone who knows programming solve me this query and tell me where can I share my ideas
κ.τ.λ

here's the proggam : :c-^_^:

GraphicsWindow.BackgroundColor = "LightYellow"
 GraphicsWindow.Width = "700"
 GraphicsWindow.Height = "600"
 
  start :
  For i = 1 To 15
balls = Shapes.AddEllipse(30,30)  
  x = Math.GetRandomNumber(470)
  xa[i] = x
  Array.ContainsIndex(xa,i)  
  y = Math.GetRandomNumber(500)
  ya[i] = y
  Array.ContainsIndex(ya,i)
  
  For k=1 To i-1
    l = (xa[k]-xa[i]+10)
    p = (ya[k]-ya[i]+10)
   If Math.abs(xa[k]-xa[i])<60 And math.Abs(ya[k]-ya[i])<60 Then 
     Shapes.move(balls,xa[i]+l,ya[i]+p)
   Else 
     Shapes.move(balls,xa[i],ya[i]) 
    
  EndIf 
  EndFor  
EndFor  

If Math.Abs(xa[k]-xa[i])<60 And Math.Abs(ya[k]-ya[i])<60 Then
  Goto start
  EndIf



    GraphicsWindow.DrawRectangle(510,1,80,900)
    GraphicsWindow.BrushColor = "LightGreen"
    GraphicsWindow.FillRectangle(510,1,80,900)
    GraphicsWindow.BrushColor = "DarkRed"
    GraphicsWindow.DrawBoundText(550,20,90,"Hits")    
  
  
      For i = 1 To 7
      k = Math.GetRandomNumber(50)*10 
      n = Math.GetRandomNumber(35)*10 
      Shapes.Animate(balls,k,n,1000)
      xk[i] = k
      Array.ContainsIndex(xk,i)
      xn[i] = n
      Array.ContainsIndex(xn,i)
      
      EndFor
-->> So far I want someone to help me by telling me HOW I can wag all the balls and not only one
:c-mad:. then HOW can I make it don't concur. I've tried once as you see but did not succeed
:((

Thanks for reading me,
George , beginner , 13

Edited by Alexander, 20 December 2010 - 11:27 PM.
Reformatted bbcode


#2
ANG AfterShock

ANG AfterShock

    Newbie

  • Members
  • PipPip
  • 24 posts
Is balls some sort of control or is it a variable? If it is a variable then make sure you accounted for all of the different balls when declaring it. If its a control then it's probably somewhere in that code and I don't know too much about that.
Posted Image
If you need any help with designing your program with graphics to the caliber of the above then just hit me up with a PM. I'd be more than willing to help! God bless! :c-cool: