newRectangleCollider wall acting...weird

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
artschoolcamouflage
Prole
Posts: 4
Joined: Sat Jun 13, 2020 8:16 pm

newRectangleCollider wall acting...weird

Post 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
User avatar
knorke
Party member
Posts: 239
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: newRectangleCollider wall acting...weird

Post 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.
artschoolcamouflage
Prole
Posts: 4
Joined: Sat Jun 13, 2020 8:16 pm

Re: newRectangleCollider wall acting...weird

Post by artschoolcamouflage »

Ha! Yeah, not sure how I didn't notice that. Thanks for pointing that out.
Post Reply

Who is online

Users browsing this forum: pgimeno and 66 guests