1. Chris Klimas
  2. zoetrope
  3. Issues
Issue #9 resolved

Using acceleration doesn't work

Anonymous created an issue

Just found this amazing pack for love2d, and I'm checking out the tutorials. I'm on the first one, where I have to write a program which creates some gravity. Sadly, the program errors out when using acceleration.

The problem here is that in sprite.lua, the acceleration is trying to perform a multiplication on the velocity, which in this case is 0. Love then errors out, as it hates to try and perform multiplication on zeroes.

Anyway, if you somehow work this out, that'd be great.

Lemme know, ModernPixel

Comments (3)

  1. Chris Klimas repo owner

    Whoops, this is actually a bug in how it looks at acceleration -- it assumes you specify x, y, and rotation if you specify any of them. (Multiplying by zero is totally ok! :) Dividing by zero is not so good.) Quick fix while I get this fixed would be to set acceleration to something like { x = 0, y = 100, rotation = 0 }.

  2. Log in to comment