Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function love.load()
- orx = 200
- ory = 300
- orw = 100
- orh = 50
- timer = 0
- maxtimer = 3
- end
- function love.update(dt)
- dt = math.min(dt, 1/30)
- timer = timer + dt
- if timer >= maxtimer then
- timer = timer - maxtimer
- end
- end
- function love.draw()
- love.graphics.setLineWidth(1)
- love.graphics.setColor(0, 55, 0, 255)
- love.graphics.line(orx-orw, ory, orx+orw, ory)
- love.graphics.line(orx, ory, orx, ory-orh)
- love.graphics.setColor(0, 255, 0, 255)
- love.graphics.line(orx-3, ory, orx+3, ory)
- love.graphics.line(orx, ory-3, orx, ory+3)
- love.graphics.setColor(255, 0, 0, 255)
- local factor = 1.5 - timer/maxtimer
- love.graphics.circle("fill", orx + math.cos(math.pi*2*factor)*orw, ory - math.abs( math.sin(math.pi*2*factor) )*orh, 3, 16)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement