Image randomly moving down when I define x volocity

So I am trying to create a game with phaser and I need an image which moves left to right and bounce against the edges.

image.body.velocity.x=-150;
image.body.velocity.y=0;

Now when I run the code the image moves down slightly as it moves. There isn't any other code in my script which would lower the image.



Read more here: https://stackoverflow.com/questions/67925193/image-randomly-moving-down-when-i-define-x-volocity

Content Attribution

This content was originally published by Isaac at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: