local image = love.graphics.newImage("assets/asteroid.png")
function Asteroid:new(x, y)
self.image = image
...
It's just importent that you don't call love.graphics.newImage inside your constructor (Asteroid:new()).
If you prefer it you can also load the image inside another file or in your main, just refer it to your object and dont load the image inside it.
-- assets.lua
return {
["playerImage"] = love.graphics.newImage(path),
["enemyImage"] = love.graphics.newImage(otherpath),
}
-- main.lua
assets = require("assets")
...
-- player.lua
...
function Asteroid:new(x, y)
self.image = assets.playerImage -- or you draw this image directly from the assets table without assigning it to the player object.
...
Last edited by MadByte on Sat Mar 26, 2016 6:41 pm, edited 1 time in total.
Sulunia wrote:Welp, in that case, it's the general stuff.. Update video drivers, remove internal dust, maybe even reinstall the OS you're currently using.
believe me ive tried all that, just gotta wait till i have money then ill stop using terrible AMD graphics cards lol
MadByte wrote:just out of curiosity .. do you use the latest LÖVE version (0.10.0)? If so - try another one (0.9.2 e.g), if not - try 0.10.0.
I use 0.9.2, I had even more troubles with the latest version where the window would just randomly clear itself of any graphics after a few seconds of running.
Alright. What about other OpenGL based games on your system (e.g Minecraft), do they work as intended? What about other games? Do you have graphical glitches in most of them? Because if the problem is a damaged GPU you should notice more problems like that. If not then it's more likely that there is a problem with your drivers / OS.
MadByte wrote:Alright. What about other OpenGL based games on your system (e.g Minecraft), do they work as intended? What about other games? Do you have graphical glitches in most of them? Because if the problem is a damaged GPU you should notice more problems like that. If not then it's more likely that there is a problem with your drivers / OS.
My graphics drivers crash frequently lol, the only game i play that crashes is CS:GO, most games like minecraft, league, ect run fine