Crashing problems
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Crashing problems
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
-
- main.lua
- (2.01 KiB) Downloaded 193 times
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Crashing problems
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 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.
Re: Crashing problems
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?
Mind if I use this thread as a general questions thing?
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Crashing problems
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.
Who is online
Users browsing this forum: Bing [Bot] and 8 guests