Fizz X

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Murii
Party member
Posts: 216
Joined: Fri Jul 05, 2013 9:58 am
Location: Arad, Romania
Contact:

Re: Fizz X

Post by Murii »

Hello,i found a bug in fizz.lua when i try to remove a shape.So i fixed it :

Code: Select all

function findShape(s)
  local t = s.list
  if t ~= nil then --This needs to be added otherwhise you get errors :(
  for k, v in ipairs(t) do
    if v == s then
      return k, t
      end
    end
  end
end
Also i made the possibility to choose whether or not your sprite should be able to have collision detection.But i`m still testing it to be sure it is working correctly.
User avatar
ivan
Party member
Posts: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Fizz X

Post by ivan »

Murii wrote:Hello,i found a bug in fizz.lua when i try to remove a shape.So i fixed it :

Code: Select all

function findShape(s)
  local t = s.list
  if t ~= nil then --This needs to be added otherwhise you get errors :(
This usually means that you are trying to remove a shape that is not a part of the simulation.
Murii wrote:Also i made the possibility to choose whether or not your sprite should be able to have collision detection.But i`m still testing it to be sure it is working correctly.
Cool. :) If you return false from shape.onCollide the collision should be ignored.

Code: Select all

onCollide(a, b, nx, ny, pen)
where a and b are the colliding shapes,
nx and ny is the collision normal (if ny > 0 something is pushing your shape UP, probably a 'floor' tile)
and pen is the penetration depth
User avatar
ivan
Party member
Posts: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Fizz X

Post by ivan »

Version 8 is out, now supporting slopes and updated to work with the latest version of Love2D.
See original post for a download link.

For the full documentation, check out: https://github.com/2dengine/fizzx
Last edited by ivan on Sat Dec 11, 2021 8:30 am, edited 1 time in total.
User avatar
Murii
Party member
Posts: 216
Joined: Fri Jul 05, 2013 9:58 am
Location: Arad, Romania
Contact:

Re: Fizz X

Post by Murii »

ivan wrote:Version 8 is out, now supporting slopes and updated to work with the latest version of Love2D.
See original post for a download link.

For the full documentation, check out: https://bitbucket.org/itraykov/fizzx

<3 Good job !!
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Fizz X

Post by Positive07 »

Nice!! I love this lib it has helped me a couple of times.

There is just one thing I would love to have: non-axis aligned rectangles (but I guess it is really hard)

I'm thinking on implementing this myself using this tutorial or this simple idea
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
ivan
Party member
Posts: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Fizz X

Post by ivan »

Thanks so much for the support. :)
Yep, using the separating axis theorem it wouldn't be too hard to add rotated rectangles.
I thought about adding "triangles" too, but in my opinion, it's not very useful for platformers or Zelda-like games.
Regarding the separating axis theorem, I suggest taking a look at:
http://games.clowerweb.com/games/phaser ... test07.swf

Fizz uses SAT in the testRectLine and testCircleLine functions.
The code is somewhat confusing in "testRectLine" because handling collisions with the end points of the line segment is a little tricky.
Still haven't come up with an elegant solution but I'll try to put out fixes later on.

This illustrates how SAT is used in "testRectLine":
Image
8 possible cases for rect vs line intersection:
blue point: origin of the segment
red point: rectangle center, projected on the segment axis (sometimes outside of the segment extents)
User avatar
ivan
Party member
Posts: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Fizz X

Post by ivan »

Version 8.1 is out (see first post).
- fixes passing through one sided platforms (line segments)
- shows how to update the simulation using a constant time step
- shows how to handle movement on slopes
User avatar
Lightcycler
Prole
Posts: 18
Joined: Sun Dec 16, 2012 4:31 pm

Re: Fizz X

Post by Lightcycler »

Great engine, I löve it's simplicity :3 EDIT: I removed my problem, I was too dense to see it. I forgot the "fizz." in front of the function. Jeez.
User avatar
ivan
Party member
Posts: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Fizz X

Post by ivan »

Lightcycler wrote:Great engine, I löve it's simplicity :3 EDIT: I removed my problem, I was too dense to see it. I forgot the "fizz." in front of the function. Jeez.
Thanks so much for trying the lib.
I would be curious to see what you come up with and especially if you find any bugs or inconsistencies. :)
User avatar
Murii
Party member
Posts: 216
Joined: Fri Jul 05, 2013 9:58 am
Location: Arad, Romania
Contact:

Re: Fizz X

Post by Murii »

Can you please make more examples for using Fizz X because I`m not entire sure if I`m using it correct.Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests