Best way to attach paddles to each other?
Posted: Fri Dec 02, 2022 4:00 pm
I'm working on a pong variant that makes the paddles add a layer when the player scores. The paddle detection is working perfectly for the first "layer", but on subsequent layers, the new shapes/fixtures don't seem to be working to detect collision like the first ones. My theory is that this has to do with how the new shape and fixture interact with the base body, but I can't for the life of me troubleshoot my way out of this one.
I initially looked into weldJoints for this, but it seemed overkill when what I really need is to just effectively increase the width of the paddle and slap on a second fixture (I think?).
https://github.com/kristinalustig/pongburger Here's my code (the relevant stuff is in physics.lua, namely in beginContact() and startNewRound() (as well as in createPaddleObject()). I also included the latest build in dist/0.0.2 if you want to see the issue I've described for yourself. W/S are up + down for left paddle, Up + Down for right.
Thank you so much for your help - I've made several games in love2d thus far but this is my first one even partially using the physics engine so I'm a bit out of my depth. This lovely community has made my dream of making indie games a reality <3
I initially looked into weldJoints for this, but it seemed overkill when what I really need is to just effectively increase the width of the paddle and slap on a second fixture (I think?).
https://github.com/kristinalustig/pongburger Here's my code (the relevant stuff is in physics.lua, namely in beginContact() and startNewRound() (as well as in createPaddleObject()). I also included the latest build in dist/0.0.2 if you want to see the issue I've described for yourself. W/S are up + down for left paddle, Up + Down for right.
Thank you so much for your help - I've made several games in love2d thus far but this is my first one even partially using the physics engine so I'm a bit out of my depth. This lovely community has made my dream of making indie games a reality <3