Jump to content

Pixi.js simulation


Powerzaba
 Share

Recommended Posts

Hello everyone! 

I'm working on a website where I need to simulate two entities (a drone and a rover), they communicate with each other trough sockets in the server. I'm displaying these entities using Pixi.js and I have a problem with consecutive animations, for example the drone class has 4 functions (moveRight, moveUp, moveDown, moveLeft) that allows him to move on a grid (tiled sprites and 2D array), all 4 of these functions contain an animation and are called in a function called followPath(), that takes a list of nodes and depending on the coordinates of those nodes plays the appropriate animation! But the code runs way faster than the single animations and followPath ends up playing only the last 'animation', how should I approach a situation where i have multiple animations and I need to wait for them to end before i can do something?  (sending updates to the server, update coordinates and so on). 

Link to comment
Share on other sites

That's an old Flash wisdom. https://greensock.com/

There are different implementations, like TweenLite

But, the ability to integrate it with your gameloop or pixi ticker is up to you.

Client-Server is much more difficult, I studied it for several years and I dont know how to describe all the problems you can encounter in a post. Fnd books about multiplayer games development.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...