Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More maths differences #3

Open
gingerbeardman opened this issue Sep 14, 2015 · 3 comments
Open

More maths differences #3

gingerbeardman opened this issue Sep 14, 2015 · 3 comments
Labels

Comments

@gingerbeardman
Copy link
Contributor

Contrast the following cart in pico8 and picolove

http://www.lexaloffle.com/bbs/?tid=2464

14153 p8

It's set to tween using ease_in_out_cubicwhich gets great results in pico8, but bad results in picolove. Other easing functions are also affected.

function ease_in_out_cubic(t,b,c,d)  -- cubic easing in/out - acceleration until halfway, then deceleration
  t /= d/2
  if (t < 1) return c/2*t*t*t + b
  t -= 2
  return c/2*(t*t*t + 2) + b
end

I've ruled out short operators by manually expanding them. No difference.

Perhaps an issue with expression parsing?

@ftsf
Copy link
Collaborator

ftsf commented Sep 15, 2015

Thanks, good find!

The problem is with t /= d/2

This expands to t = t / d/2 when it should expand to t = t / (d/2)

@ftsf
Copy link
Collaborator

ftsf commented Sep 15, 2015

Sadly, this is not an easy fix, I'll need to implement a modified lua parser to handle this case, and also some of the other shorthand.

@gingerbeardman
Copy link
Contributor Author

Thanks for the info.

The workaround in my code is to do:

t /= (d/2)

which then expands correctly.

@Shoozza Shoozza added the bug label Jul 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants