Oxygen Basic
Programming => Example Code => Topic started by: Peter on November 28, 2015, 06:50:03 AM
-
Hi,
include "gp.inc"
Window 800,600,1
SetCaption " LEVITATING CLOUDS"
SmoothMode 1
loadimage "bmp/bigstar.png",1
Type Star
sys xStar
sys yStar
sys speed
End Type
Dim Stars(250) As Star
sys xRes =800
sys yRes =600
sys i
For i=1 To 250
Stars(i).xStar = Rnd(1, xRes -2)
Stars(i).yStar = Rnd(1, yRes -2)
Stars(i).speed = Rnd(1, 4)
Next
Sub MoveStars()
sys i
For i=1 To 250
color 55,255,250,250
FillEllipse Stars(i).xStar,Stars(i).yStar,200,100
Stars(i).xStar = Stars(i).xStar + Stars(i).speed
iF Stars(i).xStar > xRes
Stars(i).xStar = -128
Stars(i).yStar = Rnd(1, yRes -2)
Stars(i).speed = Rnd(1, 4)
End iF
Next
End Sub
while Key(27)=0
cls 55,0,0,0
drawimage 1,300,200,0
MoveStars
color 255,0,255,0
text 320,16,28,"CLOUDS "
redraw
wait 10
wend
.
-
hello Peter
have a look at this web site, there's tons of interesting Javascript graphic demos with source http://bl.ocks.org/mbostock
-
Thanks Jack,
But Java is not so easy to translate to OxygenBasic.
I am missing a lot of commands here in OxygenBasic.
I would have to improvise too much.
-
But Java is not so easy to translate to OxygenBasic.
I'm sure it is but that isn't what Jack's link to the examples are written in. JavaScript has nothing to do with Java other than the first four characters of its name happen to be the same for some strange reason.
Java vs. JavaScript: What’s the Difference? (http://www.seguetech.com/blog/2013/02/15/java-vs-javascript)