What the program does:
Draws a tilemap to the screen using Kikito's string method
Draws a controllable character (Up, Down, Left, Right) to the screen from another tileset
The Problem: The program runs fully functioning for about 10 seconds, though with each passing second it uses 8% more RAM until the program crashes.
After some troubleshooting I believe I've pinpointed the issue to my function for drawing the character -
Code: Select all
function drawPlayer()
playerImage = love.graphics.newImage('/tilesets/characters.png')
fancyGhoul = love.graphics.newQuad(0, 0, 64, 64, 640, 640)
love.graphics.drawq(playerImage, fancyGhoul, player.act_x, player.act_y)
end
Code: Select all
function love.draw()
drawMap()
drawPlayer()
end
My first intuition was that redrawing the character every frame was using exponential amounts of RAM, if it saves a new character rather than overwrite the current one. However, my intuition isn't programming minded yet, so after trying some different things and failing I have come to you!