Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mouse = {}
- circle = {}
- enemy = {}
- function love.load()
- circle.mode = "fill"
- circle.x = 0
- circle.y = 0
- circle.radius = 15
- enemy.mode = "fill"
- enemy.x = love.math.random(0, 800)
- enemy.y = love.math.random(-15, -50)
- enemy.width = love.math.random(10, 100)
- enemy.height = love.math.random(10, 100)
- end
- function love.update(dt)
- mouse.x, mouse.y = love.mouse.getPosition()
- circle.x = mouse.x
- circle.y = mouse.y
- enemy.y = enemy.y + love.math.random(200, 500) * dt -- falling speed
- end
- function love.draw()
- love.graphics.setColor(0, 1, 0)
- love.graphics.circle(circle.mode, circle.x, circle.y, circle.radius)
- love.graphics.setColor(1, 0, 0)
- love.graphics.rectangle(enemy.mode, enemy.x, enemy.y, enemy.width, enemy.height)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement