Page 1 of 1

newRectangleCollider wall acting...weird

Posted: Thu Sep 21, 2023 11:18 pm
by artschoolcamouflage
I'm learning LOVE, following video tutorials (currently on this one from Challacade, https://www.youtube.com/watch?v=dZzAxYr ... x=8&t=491s) and I've hit a figurative wall, literally. I've double checked the code with the tutorial, and it's the same, save for what sprites I'm using and the keys for movement (I prefer wads vs arrow keys). As you can see from the video below, when the code:

Code: Select all

local wall = world:newRectangleCollider(100, 200, 120, 300)
is commented out, it works fine. Once it's back in it generates infinite rectangles and pushes them out endlessly. It's fun to watch, but it doesn't help me with collisions. My main question is; why is it creating other rectangles? My follow up is, how do I make it work?

Video: https://www.youtube.com/watch?v=ffdi_ODMGUo

Re: newRectangleCollider wall acting...weird

Posted: Fri Sep 22, 2023 1:47 am
by knorke
You call newRectangleCollider in love.update(), at least the other code visible in the video seems like stuff that would belong in update()
But in the tutorial it is in love.load()
Please always post code as text or attached file, video is okay to show the bug but for looking at the actual code it is bad.

Re: newRectangleCollider wall acting...weird

Posted: Fri Sep 22, 2023 2:22 am
by artschoolcamouflage
Ha! Yeah, not sure how I didn't notice that. Thanks for pointing that out.