Using Rectangle for hitbox.
Opened this issue · 8 comments
As I said in my other issue, I'm doing some refactoring, and I'm wondering if there's a reason why we're not using Rectangle to describe the Entity's hitbox.
If there isn't, would you be interested in me changing it to a Rectangle, and then refactoring the methods that use it?
Why use Rectangle ? What are benefits ?
hi! i made a patch that uses a polygon for the hitbox, it works fine with the entity class (rotation,scaling) but have a syc trouble with one test class (an entity used only in the tests) if you have some time, you can test it.
Gornova, I think that if we start looking at shapes for hitboxes, we gain a lot:
all of the methods already written for those shapes
the ability to have slopes, or convex polygonal hitboxes.
As long as we keep the exposed methods the same, people who are used to doing it the current way (and don't need more complex collision) don't have to change what they're doing.
well, we can investigate what are benefits, but for version 0.4, are you ok?
I'm not sure about the versioning, I think I have 3.0. And I've changed some stuff in the entity and in some other places.
So I'd have to carefully look at the new stuff before adding it. As far as hitboxes, that's fine, although I would like to push some stuff I've added.
For instance, World now has a method that returns a list of all visible entities, this makes Line of Sight testing much quicker.
Using shapes as collision zones was indeed already discussed with Sabathorn which gives us rotating and scaling collision zones (important issue). That was the biggest benefit I guess.
flowstate, are your changes just locally on your computer or in some repository?
They're on a repository, on code.google . I was talking to Gornova about putting it up here, but I don't know how to use Git, or how to use it together with SVN.
Yeah, I'd absolutely love to be able to rotate and such, so I might make the change to shapes after I finish my movers.
I moved this on Milestone v0.4, let us know where is this repository :D