{ @code [ local objects = {} local id = 0 ] } { @ initialize LOVE event handlers , spawn 1000 circles } @love event draw { @ ( draw circles . ) , draw fps } @love event update $dt { dt $dt ; @ ( update circles . ) } @ ( draw circles . ) ; circles $id { circles.stash $id ; @ ( $id draw circle with radius 10 . draw circles . ) } @ ( draw circles . ) { @ ( circles.stash move to circles . ) } @ ( update circles . ) ; circles $id ; dt $dt { circles.stash $id ; dt $dt ; @ ( self := $id . self t := self t + $dt . self x := self t cos * self speed + self cx . self y := self t sin * self speed + self cy . self drop . update circles . ) } @ ( update circles . ) ; dt $dt { @ ( circles.stash move to circles . ) } @ spawn n circles ; n := $n { @ spawn $n circles } @ spawn 0 circles { } @ spawn $n circles { @ ( n := $n - 1 . ) , spawn a circle , spawn n circles } @ spawn a circle { @ ( self := object new . self x := 100 random upto 500 . self y := 100 random upto 500 . self speed := 1 random upto 100 . self cx := self x . self cy := self y . self t := 1 random upto 360 . circles <- self . ) } @ ( $name := ) { slot $name } @ ( $name $field := ) { slot $name $field } @ ( self drop . ) ; self := $id { } @ ( self $field ) ; self := $id { self := $id ; @ $value ; @code [$value = objects[$id][$field]] } @ ( $number cos ) { @ $cos ; @code [$cos = math.cos(tonumber($number))] } @ ( $number sin ) { @ $sin ; @code [$sin = math.sin(tonumber($number))] } @ ( $x + self $field ) ; self := $self { self := $self ; @ $z ; @code [$z = tostring($x + objects[$self][$field])] } @ ( $x * self $field ) ; self := $self { self := $self ; @ $z ; @code [$z = tostring($x * objects[$self][$field])] } @ ( $x + $y ) { @ $z ; @code [$z = tostring($x + $y)] } @ ( $x * $y ) { @ $z ; @code [$z = tostring($x * $y)] } @ ( $x - $y ) { @ $z ; @code [$z = tostring($x - $y)] } @ ( object new ) { @ $id ; @code [ id = id + 1 local object = { id = id } objects[object.id] = object $id = id ] } @ ( $lower random upto $upper ) { @ $n ; @code [$n = tostring(love.math.random(tonumber($lower), tonumber($upper)))] } @ ( $value . ) ; slot self { self := $value } @ ( $value . ) ; slot n { n := $value } @ ( $value . ) ; slot self $field ; self := $id { self := $id ; @code [objects[$id][$field] = $value] } @ ( self <- $value . ) { self := $value } @ ( circles <- self . ) ; self := $id { circles $id } @ ( circles.stash move to circles . ) ; circles.stash $id { circles $id ; @ ( circles.stash move to circles . ) } @ ( circles.stash move to circles . ) { } @ ( $id draw circle with radius $r . ) { @code [love.graphics.circle("fill", objects[$id].x, objects[$id].y, $r)] } @ draw fps { @code [love.graphics.print(tostring(love.timer.getFPS( )) .. " - circles: " .. tostring(#objects), 0, 0)] }