Pardon the mess, Play My Code is in beta!

READY TO PLAY?
CLICK TO LOG IN!

sign up - lost password

Spiral »

You do not own this project, so changes will not be saved

// Was a little bored so did this :)
//
// Nothing fancy, just a simple spiral with a pinch of salt

// Andy

$screenWidth  = getScreenWidth()
$screenHeight = getScreenHeight()
$halfWidth    = $screenWidth / 2
$halfHeight   = $screenHeight / 2

tt2          = new Image("tt2.png")
image        = new Image("blob2.png")

setFont( 'Arial', 32, 'italic' )

a = 5
b = 5
aa = 0.1
av = 0.001
onEachFrame() do
    fill( 0, 0, 0 )
    setBlend(:add)
    x = $halfWidth
    y = $halfHeight
    if (aa > 4 || aa < 0)
        av = -av
    end
    aa = aa + av * getDelta()
    360.times() do |i|
        lastX = x
        lastY = y
        angle = aa * i
        x = $halfWidth  + (a + b * angle) * angle.cos()
        y = $halfHeight + (a + b * angle) * angle.sin() 
        drawImage(image, x, y, i*aa*2, i*aa*2, true)
        setColor( i/2, 255, i/3 )
        drawLine(lastX, lastY, x, y, 2)
    end
end


ERRORS

YOUR BROWSER DOES NOT SUPPORT HTML5!

Please use one of these instead

Our games cannot run in your browser