[SOLVED] Game freezes fatally after only 20 seconds of gameplay

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Stepanchicko
Prole
Posts: 6
Joined: Thu May 09, 2024 3:54 pm
Location: Russia, Podolsk
Contact:

[SOLVED] Game freezes fatally after only 20 seconds of gameplay

Post by Stepanchicko »

I'm a newb who's working on a big project, and having thought about how big it actually is and how unexperienced I am, I decided to make a small game to get used to the love2d working sphere.
I tried making a simple game (a simple 2d remake of the classic Get Crushed By A Speeding Wall), and everything was working fine until I decided to playtest it for a bit longer. Then I realised that after literally 20 seconds of playing the FPS gradually decreases, and a second after the game freezes. The music is still playing, but nothing is moving, the background video is torn between two frames, and if you try to click on anything, the cursor freezes up. I have no idea what has happened to cause the freeze, could somebody help me? My game isn't using love.physics nor am I making a lot of calculations at once... :cry:
Attachments
Be Crushed By A Speeding Wall.love
the love file
(3.8 MiB) Downloaded 182 times
Last edited by Stepanchicko on Fri Jun 14, 2024 2:06 pm, edited 1 time in total.
Xugro
Party member
Posts: 114
Joined: Wed Sep 29, 2010 8:14 pm

Re: Game freezes fatally after only 20 seconds of gameplay

Post by Xugro »

The problem is, that you are loading the images thegovernment.jpg and textures/normal.png every frame. Load them once in love.load() like you do with the videos and music. This fixes the freeze for me.
Stepanchicko
Prole
Posts: 6
Joined: Thu May 09, 2024 3:54 pm
Location: Russia, Podolsk
Contact:

Re: Game freezes fatally after only 20 seconds of gameplay

Post by Stepanchicko »

Xugro wrote: Thu May 09, 2024 8:22 pm The problem is, that you are loading the images thegovernment.jpg and textures/normal.png every frame. Load them once in love.load() like you do with the videos and music. This fixes the freeze for me.
Thank you thank you and a million times thank you! Helped me out a lot.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 6 guests