Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

Animation Trouble

$
0
0
var deltaX = ship.x - object_sprite.position.x;
							var deltaY = ship.y - object_sprite.position.y;
							var radians = Math.atan2(deltaY, deltaX); // In radians
							
							// Set postion exactly to server
							object_sprite.position.x += deltaX * delta;
							object_sprite.position.y += deltaY * delta;
							object_sprite.rotation.z = ship.direction_rad; 

Hi all, I'm trying to create an animation for a spaceship. This is the code above.

ship.x and ship.y are updated from the server every 1 second. I want to move the object_sprite to the new position.

It totally works but it "eases". I need it to animate evenly.

I am not using TweenJS. 

Any thoughts?


Viewing all articles
Browse latest Browse all 3978

Trending Articles