ISO

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: ISO

Post by MarekkPie »

I could be completely wrong. I have a tendency to give something about 10 seconds of thought before I express an opinion.
User avatar
Camoy
Prole
Posts: 17
Joined: Fri May 06, 2011 8:03 pm

Re: ISO

Post by Camoy »

I'll likely end up using HardonCollider and represent each Sprite with a rectangle of its dimensions. Sounds simple enough ;)
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: ISO

Post by MarekkPie »

I don't know if you want to to the full size on the sprite. The "grounding" part was to try and coincide with the z-indexing of an isometric map, since it's more representative of their place on it.
User avatar
Camoy
Prole
Posts: 17
Joined: Fri May 06, 2011 8:03 pm

Re: ISO

Post by Camoy »

MarekkPie wrote:I don't know if you want to to the full size on the sprite. The "grounding" part was to try and coincide with the z-indexing of an isometric map, since it's more representative of their place on it.
Then how much of the sprite should detect against collision?
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: ISO

Post by MarekkPie »

The black circle is kinda what I meant. You use the fact that its small enough to hide the fact that you are not colliding on the isometric plane.
Attachments
shadow.png
shadow.png (1.79 KiB) Viewed 3177 times
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: ISO

Post by tentus »

I would, in this case, encourage a separation of collision and rendering. Doing the math on squares and circles colliding is easy. The math for parallelograms and ellipses is significantly more complex.
Kurosuke needs beta testers
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: ISO

Post by MarekkPie »

Right. It may not be evident from the little image but the black circle is in fact a circle, not an ellipse.
User avatar
Camoy
Prole
Posts: 17
Joined: Fri May 06, 2011 8:03 pm

Re: ISO

Post by Camoy »

Collision detection is in ISO (complements to HardonCollider). Line 81 and 120 in this file decides what portion of the sprite is checked for collision. Right now it is using the entire sprite, but I'm interested MarekkPie's solution if you'd like to implement it.
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: ISO

Post by MarekkPie »

Was having trouble navigating through your source code, so I made a little mockup. It's not using ISO, but it shows my idea. Use the arrow keys to move and ESC to quit.
Attachments
fakeisocollision.love
(134.92 KiB) Downloaded 127 times
User avatar
Camoy
Prole
Posts: 17
Joined: Fri May 06, 2011 8:03 pm

Re: ISO

Post by Camoy »

MarekkPie wrote:Was having trouble navigating through your source code, so I made a little mockup. It's not using ISO, but it shows my idea. Use the arrow keys to move and ESC to quit.
I put it in, however in sprites whose width is greater than their height, the collision area is way too large. Here is the commit.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest