-- the magic of trigonometry

local t = 0
local a = 0

function main()
  while true do
    if current_sprite.x > 0 then
      current_sprite.x = current_sprite.x - 1
      dink.wait(10)
    else
      current_sprite.x = 650
    end
    -- use math.floor to convert to int for y val so sprite position will accept it
    a = math.floor(math.deg(math.sin(t)) + 0.5)

    current_sprite.y = a + 250
    t = t + 0.1

    current_sprite.size = math.floor(math.deg(math.cos(t)) + 100)
  end
end

function talk()
  current_sprite:say("`4Have fun in 0.86!")
  main()
end
