Jump to content

modular PixiJS code with NodeJs


TheLoneJedi
 Share

Recommended Posts

The project I am working in is a multiplayer node.js game using socket.io to communicate where the renderer will be node.js. In order to correctly import my dependencies to the browser i am using browserify.

I am trying to use the Entity-Component architecture to design my game and in doin g so wanted to have a "render component" on each game object. The problem is that I cannot use PIXI code on the server side of node.jsimage.png.2488a13c3969a88c2d14da8d87f45569.png

This is something what i wanted my architecture to look like. A GameObject with multiple components (ex: PhysicsComponent, RenderComponent) in order to follow the Entity-Component architecture and design this game well. 

In my eyes the code should be able to run on the server and the client so that way the server can be authoritative in the state of the game.

The problem is that PIXI code cannot be run on the server side of node.js because a window object is not defined. 

So here is the question : How am I intended to write gameObject rendering Code using Pixi.js? Is it supposed to be purely client side, and if so how am I supposed to handle GameObject specific rendering and such?

I have been searching for several days and can find no answers. Any help would be greatly appreciated.

Link to comment
Share on other sites

  • 2 weeks later...

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...