Page 6 of 9

Re: Fizz X

Posted: Fri Aug 22, 2014 3:35 pm
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.

Re: Fizz X

Posted: Sat Aug 23, 2014 3:22 pm
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

Re: Fizz X

Posted: Sun Sep 21, 2014 11:14 am
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

Re: Fizz X

Posted: Mon Sep 22, 2014 4:41 pm
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 !!

Re: Fizz X

Posted: Mon Sep 22, 2014 4:52 pm
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

Re: Fizz X

Posted: Mon Sep 22, 2014 5:18 pm
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)

Re: Fizz X

Posted: Sun Sep 28, 2014 2:04 pm
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

Re: Fizz X

Posted: Sat Dec 06, 2014 11:00 pm
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.

Re: Fizz X

Posted: Sun Dec 07, 2014 9:39 am
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. :)

Re: Fizz X

Posted: Sun Dec 07, 2014 11:44 am
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!