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
Best way to attach paddles to each other?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- kristinamay
- Prole
- Posts: 3
- Joined: Sat Nov 12, 2022 6:15 pm
- Contact:
- kristinamay
- Prole
- Posts: 3
- Joined: Sat Nov 12, 2022 6:15 pm
- Contact:
Re: Best way to attach paddles to each other?
Update - I actually think it sort of works, just only on paddles past paddle # 1 for some reason. :-O
Re: Best way to attach paddles to each other?
Assuming you're using physics engine you could destroy the paddle and instantly create one with a different size or you can check my last game. It has a physics space ship that grows over time.
https://github.com/togfoxy/Asteroids/tree/master/Source
I'll try to find the bit for you.
Edit: I'm on mobile so can't do much but point you to my functions.lua which destroys and recreates a larger ship in its place.
https://github.com/togfoxy/Asteroids/tree/master/Source
I'll try to find the bit for you.
Edit: I'm on mobile so can't do much but point you to my functions.lua which destroys and recreates a larger ship in its place.
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
Who is online
Users browsing this forum: Google [Bot] and 3 guests