Collision bug

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
TC1061
Prole
Posts: 32
Joined: Sat Oct 14, 2017 3:50 pm

Collision bug

Post by TC1061 »

Hello. I'm doing a game, but cars don't collide with blocks. What am I doing wrong? And, there is another bug. Then I disconnect from a server, I can't connect again.
err.png
err.png (156.14 KiB) Viewed 1996 times
CarWar.love
(3.83 MiB) Downloaded 155 times
User avatar
Azhukar
Party member
Posts: 478
Joined: Fri Oct 26, 2012 11:54 am

Re: Collision bug

Post by Azhukar »

In server.lua you create your box2d world at line 203, then you add all your static fixtures, but then you AGAIN create a box2d world at line 242. Which means the terrain is in a different world from your cars.

Also your variable naming scheme is bad, using single letter global variables everywhere is unreadable and prone to errors. Always name your variables to be sufficiently descriptive.
User avatar
TC1061
Prole
Posts: 32
Joined: Sat Oct 14, 2017 3:50 pm

Re: Collision bug

Post by TC1061 »

Thanks!!!!!! You very very very very very helped me!
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 37 guests