Crashing problems

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
User avatar
FoiL
Prole
Posts: 8
Joined: Sun Oct 05, 2008 12:44 pm

Crashing problems

Post by FoiL »

So, after a couple of years I picked up love once again. My goal still being achieving something along the lines of this little thing. And so so far I think I have the movement down, but sometimes it just crashes. The dt variable is still updated, but the little triangle thing just stops moving.
Attachments
hamster.png
hamster.png (1.88 KiB) Viewed 3299 times
main.lua
(2.01 KiB) Downloaded 195 times
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Crashing problems

Post by kikito »

I suspect the problem is that the triangle "exits" the world (which is 400x400 units).

When box2d objects "get out of the world" they enter a state known as "frozen", on which they don't answer to impulses or forces any more.

If this is the case, one possible solution would be to surround your world with 4 fixed (mass = 0) rectangles on the frontiers. Another one is detecting that the tank is approaching the world's limits and put it somewhere else. For example, on the opposite side of the map (like pacman).

Regards!
When I write def I mean function.
User avatar
FoiL
Prole
Posts: 8
Joined: Sun Oct 05, 2008 12:44 pm

Re: Crashing problems

Post by FoiL »

Yeah, I felt really stupid when, literally, 2 minutes after posting the thing I looked at the code and solved it. Oh well.

Mind if I use this thread as a general questions thing?
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Crashing problems

Post by kikito »

I'd recommend using a different thread per question. That'll make answers more easily searchable for others.
When I write def I mean function.
Post Reply

Who is online

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