Hi guys, I am new with LOVE2D and I seek your ancient knowledge. basically, I'm having a big difficult with the collision/hitboxes, specifically with the weapon hitbox.
So, the game I trying to make is an action platform (like a Castlevania), and in the combat system I want to make an arc-shaped collision, and make it appears in front of the player hitbox (like a sword swiping down) when the attack button is pressed, and when the button is released, make that collision disappears, I have no idea how I can do this.
Until now I am using the "Winfield" library to build all the physics, but if you guys know a better library, I'd like to experiment
Btw, English is not my first language, so sorry if I didn't made clear what I am trying to say.
Help with Collisions/Hitbox [Solved]
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Help with Collisions/Hitbox [Solved]
Last edited by Leumy on Thu Jun 20, 2024 3:55 pm, edited 1 time in total.
Re: Help with Collisions/Hitbox
There's no need to create a complicated collision shape. Just place an AABB roughly encompassing the extents of the slash animation for the amount of time it lasts. While it's active it can be tested against enemy AABBs to damage them. It will be so brief that the inaccuracy won't be noticeable and you can just tweak the dimensions until you're happy with how it looks.
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Help with Collisions/Hitbox
Windfield you mean; also do stop using that since it's deprecated and unmaintained. Use love.physics if you must, but your game might not need such realistic physics in the first place.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Help with Collisions/Hitbox
> want to make an arc-shaped collision
Maybe "collision" is the wrong word? You can do an animation of a sword swing using a sprite sheet. The game I have in my sig is a sword fighting game that has a sword swing animation. Collision detection is probably not on the sword itself but the area the sword swings through.
If you really do need physics, which is unlikely, then love.physics is not that hard to use.
Maybe "collision" is the wrong word? You can do an animation of a sword swing using a sprite sheet. The game I have in my sig is a sword fighting game that has a sword swing animation. Collision detection is probably not on the sword itself but the area the sword swings through.
If you really do need physics, which is unlikely, then love.physics is not that hard to use.
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Idle gridiron. Set team orders then idle and watch: https://togfox.itch.io/idle-gridiron
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Idle gridiron. Set team orders then idle and watch: https://togfox.itch.io/idle-gridiron
Re: Help with Collisions/Hitbox
I studied more and implemented your advices, it worked! I think I was exaggerating in simple things and made it more difficult than it was. So, thank you guys, if any problem happens again,ni will come back
Who is online
Users browsing this forum: Ahrefs [Bot] and 5 guests