### Author Topic: Circles  (Read 1682 times)

#### Cosmo

• Guest
##### Circles
« on: February 04, 2014, 12:40:17 pm »
Last demo.
I write a small game, to learn Lua correctly. That will need a bit time.

Hi Tomaaz, is this also a rosetta thing or what rosetta is ?
Code: [Select]
`--' Cosmo o4.o2.14function rand(minzahl,maxzahl)   maxzahl = (maxzahl-minzahl)   return int(rnd()*maxzahl+minzahl)endscreen(800,600,0,"Circles")setframetimer(60)local h = screenheight()/2local w = screenwidth() /2local a,m,t = 0,0,0repeatk=getkey()clearscreen()if a<1   then m=1; endif a>150 then m=0; endif m==1 then   a=a +2else   a=a -1endt=timerticks()/1000for i=1,100 do   color(rand(32,255),rand(32,255),rand(32,255))   circle(w+sin(i*90+t)/2*(20+a),h+cos(i*90+t)*(20+a)/2,a/2)   color(255,255,255)   circle(w+sin(i*90+t)*200,h+cos(i*90+t)*200,50)endredraw()until k==27closewindow()`

#### Tomaaz

• Guest
##### Re: Circles
« Reply #1 on: February 04, 2014, 02:22:08 pm »
Hi Tomaaz, is this also a rosetta thing or what rosetta is ?

I don't know (I'm kinda specializing in fractals  ), but it's definitely poorly coded. If you're using setframetimer(), use sync() instead of redraw().