# Small & Negative x/y coordinates Gliding and Creeping

**URL:** <https://forum.kirupa.com/t/small-negative-x-y-coordinates-gliding-and-creeping/316081>\
**Category:** flash\
**Created:** [November 11, 2010, 10:01pm UTC](https://forum.kirupa.com/t/small-negative-x-y-coordinates-gliding-and-creeping/316081 "2010-11-11T22:01:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josflos](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@Josflos](https://forum.kirupa.com/u/Josflos)\
**Post date:** [November 11, 2010, 10:01pm UTC](https://forum.kirupa.com/t/small-negative-x-y-coordinates-gliding-and-creeping/316081/1 "2010-11-11T22:01:38Z")

</div>

[SIZE=1][SIZE=2]I noticed this when testing a (physics) project where particles are moved across the screen by adding their velocity to their x/y coordinates.  
Here’s a small test to illustrate this strange issue (you can easily see it for yourself: name an mc on the stage “square”)[/SIZE]

```php
import flash.events.Event;

var vx:Number = -1;  
var vy:Number = -0.2;
var prevX:Number;
var prevY:Number;

addEventListener(Event.ENTER_FRAME, loop);
function loop(e:Event):void
{
    square.x += vx;
    square.y += vy;
    vx *= 0.99;
    vy *= 0.99;
    trace(vx);
    trace(square.x - prevX);
    trace(vy);
    trace(square.y - prevY);
    trace();
    prevX = square.x;
    prevY = square.y;
}

```

[SIZE=2]The velocities are being nicely reduced ([FONT=Courier New]v\_ \*= 0.99[/FONT]) as shows from the traces  
(from “1” trough “0.99”, “-0.109582…”, to “-0.00002483878…” to even “-5.562036804314994e-7”) as would be expected.

The problem is that the sprite gets moved with steps of approx one [twip](http://www.kirupa.com/forum/showthread.php?t=343841) (0.05 pixel) even at ridiculously low values of vx/vy like “-6.027709330546002e-10”. This only happens when the amounts that get added to the x/y coordinates (vx/vy in this case) are negative. No problem with positive numbers. The creeping stops when the square hits a stage edge.

What the?

Thanks in advance for any input on this matter.  
-Tomas  
[/SIZE][/SIZE]
