peter
15-10-2012, 20:12
Hi,
A little bit Spiro and some bubbles.
Uses "ui"
DWord hwin
hwin=Canvas_Window("Spiro Ball Manhatten",1,1,640,480)
Canvas_Attach(hwin,0,%TRUE)
Canvas_Font("georgia",18,%CANVAS_FONTSTYLE_BOLD)
Randomize
Single ix,x,y
While IsWindow(hwin)
Canvas_Clear(0)
For ix=0 To 6.4 Step 0.17
x=Sin(ix)*100+200
y=Cos(ix)*100+200
DrawCenter(x+150,y+80)
Next
Canvas_Redraw
If GetAsyncKeyState(27) Then Exit While
Wend
Canvas_Window End
Sub DrawCenter(x,y As Single)
Local sx,sy As Single
sx= x-40
sy= y-40
Canvas_Circle(sx,sy,119,Rgb(255,155,34))
Canvas_Circle(sx,sy,120,Rgb(255,255,64))
Canvas_Circle(sx,sy,121,Rgb(255,200,128))
End Sub
Uses "ui"
DWord hwin
hwin=Canvas_Window("Spiro Ball Manhatten",1,1,800,600)
Canvas_Attach(hwin,0,%TRUE)
Canvas_Font("georgia",18,%CANVAS_FONTSTYLE_BOLD)
Randomize
Type Bubb
xBubb As Long
yBubb As Long
speed As Long
End Type
Dim Bubbs(250) As Bubb
Long xRes =800
Long yRes =600
InitBubbs()
While IsWindow(hwin)
Canvas_Clear(Rgb(0,100,200))
MoveBubbs()
Canvas_Color(Rgb(0,255,0),Rgb(0,100,200))
Canvas_SetPos(320,16)
Canvas_Print("BUBBLES")
Canvas_Redraw
If GetAsyncKeyState(27) Then Exit While
Sleep 10
Wend
Canvas_Window End
Function InitBubbs()
Local i As Long
For i=1 To 250
Bubbs(i).xBubb = Rnd(1,xRes-2)
Bubbs(i).yBubb = Rnd(1,yRes-2)
Bubbs(i).speed = Rnd(1,4)
Next
End Function
Function MoveBubbs()
Local i As Long
For i=1 To 250
Canvas_Circle(Bubbs(i).xBubb,Bubbs(i).yBubb,Rnd(2,15),Rgb(155,200,255))
Bubbs(i).xBubb = Bubbs(i).xBubb + Bubbs(i).speed
If Bubbs(i).xBubb > xRes Then
Bubbs(i).xBubb = 0
Bubbs(i).yBubb = Rnd(1,yRes -2)
Bubbs(i).speed = Rnd(2,6)
End If
Next
End Function
A little bit Spiro and some bubbles.
Uses "ui"
DWord hwin
hwin=Canvas_Window("Spiro Ball Manhatten",1,1,640,480)
Canvas_Attach(hwin,0,%TRUE)
Canvas_Font("georgia",18,%CANVAS_FONTSTYLE_BOLD)
Randomize
Single ix,x,y
While IsWindow(hwin)
Canvas_Clear(0)
For ix=0 To 6.4 Step 0.17
x=Sin(ix)*100+200
y=Cos(ix)*100+200
DrawCenter(x+150,y+80)
Next
Canvas_Redraw
If GetAsyncKeyState(27) Then Exit While
Wend
Canvas_Window End
Sub DrawCenter(x,y As Single)
Local sx,sy As Single
sx= x-40
sy= y-40
Canvas_Circle(sx,sy,119,Rgb(255,155,34))
Canvas_Circle(sx,sy,120,Rgb(255,255,64))
Canvas_Circle(sx,sy,121,Rgb(255,200,128))
End Sub
Uses "ui"
DWord hwin
hwin=Canvas_Window("Spiro Ball Manhatten",1,1,800,600)
Canvas_Attach(hwin,0,%TRUE)
Canvas_Font("georgia",18,%CANVAS_FONTSTYLE_BOLD)
Randomize
Type Bubb
xBubb As Long
yBubb As Long
speed As Long
End Type
Dim Bubbs(250) As Bubb
Long xRes =800
Long yRes =600
InitBubbs()
While IsWindow(hwin)
Canvas_Clear(Rgb(0,100,200))
MoveBubbs()
Canvas_Color(Rgb(0,255,0),Rgb(0,100,200))
Canvas_SetPos(320,16)
Canvas_Print("BUBBLES")
Canvas_Redraw
If GetAsyncKeyState(27) Then Exit While
Sleep 10
Wend
Canvas_Window End
Function InitBubbs()
Local i As Long
For i=1 To 250
Bubbs(i).xBubb = Rnd(1,xRes-2)
Bubbs(i).yBubb = Rnd(1,yRes-2)
Bubbs(i).speed = Rnd(1,4)
Next
End Function
Function MoveBubbs()
Local i As Long
For i=1 To 250
Canvas_Circle(Bubbs(i).xBubb,Bubbs(i).yBubb,Rnd(2,15),Rgb(155,200,255))
Bubbs(i).xBubb = Bubbs(i).xBubb + Bubbs(i).speed
If Bubbs(i).xBubb > xRes Then
Bubbs(i).xBubb = 0
Bubbs(i).yBubb = Rnd(1,yRes -2)
Bubbs(i).speed = Rnd(2,6)
End If
Next
End Function