Menu

#10 Ball starts rolling as soon as it is dropped

open
nobody
None
5
2004-03-12
2004-03-12
Anonymous
No

After playing a few games, I notice that there is an
increased likelihood that the new ball will start
rolling as soon as it is dropped, i.e. before the mouse
is moved. It is as if there is a leftover vector from
the previous ball? This never happens on the first
ball, only on second, third, fourth balls.

Otherwise a really kicking game!

Discussion

  • Matthias Neeracher

    Logged In: YES
    user_id=37219

    I just had a deeper look at this, because in the MacOS X / fink port, this
    happens all the time (In fact, I thought that there was some sort of
    gravity factor making this a design feature).

    It turns out that dx and dy in Player::tick are simply not initialized to 0,
    and they don't get initialized in all paths. Therefore, depending on stack
    conditions, they can easily pick up nonzero values when they shouldn't.

    diff -ru trackballs-1.0.0-orig/src/player.cc trackballs-1.0.0/src/player.cc
    --- trackballs-1.0.0-orig/src/player.cc Sat Mar 20 02:04:32 2004
    +++ trackballs-1.0.0/src/player.cc Sat Mar 20 02:05:32 2004
    @@ -68,6 +68,7 @@

    if(!Game::current) return;
    if(!playing) return;
    + dx = dy = 0.0;
    Map *map = Game::current->map;
    health+=t * 0.4; if(health > 1.0) health = 1.0;

     
  • Nobody/Anonymous

    Logged In: NO

    Thanks neeri! I had the same problem. Every second game I
    got this bug, and I couldn't figure out why. I thought it was
    related to my system somehow.

    your "huge" diff fixed it for me ;) Thanks!

     
  • mik3z0r

    mik3z0r - 2004-10-11

    Logged In: YES
    user_id=1137131

    I second this bug -Debian 3.0r2, trackballs version 1.0.0-3.
    Really nice game though! Keep up the good work.

     

Log in to post a comment.

MongoDB Logo MongoDB