Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LDGraphicsWindow.state = 2 'full screen
- w = GraphicsWindow.Width
- h = GraphicsWindow.Height
- GraphicsWindow.BackgroundColor = "Black"
- numstar = 120
- GraphicsWindow.BrushColor = "White"
- For x = 1 To numstar
- distx[x] = Math.GetRandomNumber(w) 'gen rnd x pos for star
- disty[x] = Math.GetRandomNumber(h) 'gen rnd y pos for star
- If Math.Remainder(x,2) = 0 Then
- distx[x] = -distx[x] 'move 50% of stars to left/top of central pivot
- disty[x] = -disty[x]
- EndIf
- size = 5+Math.GetRandomNumber(12) 'size is rnd between 5 and 12
- shape = Shapes.AddEllipse(size,size)
- Shapes.SetOpacity(shape,Math.GetRandomNumber(100))
- Shapes.Move(shape,distx[x],disty[x])
- stars[x] = LDFastShapes.ShapeIndex(shape) 'use ldfastshapes for speed
- sp[x] = Math.GetRandomNumber(150)/100 'speed array of orbitting stars
- sizes[x] = size 'size array of stars
- EndFor
- While 1=1
- a = a + .5 'half degree of rotation per frame
- z = z + 0.0001 'slowly increasing height of rotation
- GraphicsWindow.title = z
- For x = 1 To numstar
- sin = Math.Sin(Math.GetRadians(a * sp[x])) 'sin and cos pos of each star
- cos = Math.Cos(Math.GetRadians(a * (sp[x] * z)))
- LDFastShapes.Zoom(x,sizes[x] * sin/2 * distx[x]/10000,sizes[x]*sin/2 * distx[x]/10000)
- xpos = w/2 + distx[x] * (sin/2) 'W/2 & H/2 become central pivot
- ypos = h/2 + disty[x] * (cos/2) 'spin faster laterally
- LDFastShapes.Move(x,xpos,ypos)
- EndFor
- LDFastShapes.Update()
- Program.Delay(10)
- EndWhile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement