love.graphics.point makes it unable to draw anything.
Posted: Sat Nov 08, 2014 2:22 pm
Hi! I'm making an asteroids-like game. I wanted to make it have a funky starry sky but I've enountered a big problem.
When I don't have any points, everything's perfectly fine. But when I make the game draw points, But only they appear on screen. Nothing else gets drawn anymore. :/
Here's code:
I included a .love file of my game. The star-drawing code is in main.lua. (By the way, the number is the ship's angle. I left it because part of it is seen through, but most of it is not.)
When I don't have any points, everything's perfectly fine. But when I make the game draw points, But only they appear on screen. Nothing else gets drawn anymore. :/
Here's code:
Code: Select all
function love.draw()
love.graphics.clear()
love.graphics.setColor(255,255,255)
love.graphics.setPointSize(2)
for i=0, StarCount, 1 do
love.graphics.point(0.5+StarPos[i][1],0.5+StarPos[i][2])
end
Ship:Draw()
end
Code: Select all
function Ship:Draw()
love.graphics.setColor(255,255,255)
love.graphics.print(Ship.Angle,200,200)
love.graphics.translate(Ship.X,Ship.Y)
love.graphics.rotate(math.rad(Ship.Angle))
love.graphics.line(-15, 15, 0, -25)
love.graphics.line(0, -25, 15, 15)
love.graphics.line(-15, 15, 0, 0)
love.graphics.line(0, 0, 15, 15)
end