From 9ade1dde6a6bc14766c18822fefe46f53bac454a Mon Sep 17 00:00:00 2001 From: "felix.montenegro-re" Date: Sat, 5 May 2018 18:27:14 +0200 Subject: [PATCH] ... --- main.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/main.lua b/main.lua index 0966801..a0b7d2f 100644 --- a/main.lua +++ b/main.lua @@ -88,7 +88,9 @@ function love.load() local planetSprite = love.graphics.newImage('sprites/' .. planetName .. '.png') table.insert(planetSprites, planetSprite) end - + + asteroidSprite = love.graphics.newImage('sprites/asteroid.png') + for i = 1, settings.planetCount do local radius = love.math.random(50, 100) local x, y = getRandomPosition() @@ -118,6 +120,7 @@ end function addObject(x, y, r) local object = {collision = physics.makeCircle(x, y, r, true)} + object.x, object.y, object.r = x, y, r table.insert(objects, object) end @@ -172,8 +175,10 @@ function love.draw() -- draw dynamic objects for _, object in ipairs(objects) do - love.graphics.setColor(0.2, 0.8, 0.7) - drawCircle(object.collision) + love.graphics.setColor(1, 1, 1) + --drawCircle(object.collision) + love.graphics.draw(asteroidSprite, object.collision:getX(), object.collision:getY(), object.collision:getAngle(), object.r/52*2, object.r/52*2, object.r*2, object.r*2) + end for _, powerup in ipairs(powerups) do