TheLoneJedi Posted February 2, 2018 Share Posted February 2, 2018 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.js 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. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 2, 2018 Share Posted February 2, 2018 https://github.com/Prozi/pixi-shim Quote Link to comment Share on other sites More sharing options...
TheLoneJedi Posted February 2, 2018 Author Share Posted February 2, 2018 Is this just a fork of Pixi for the backend? If so what version of PIXI does it use? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 2, 2018 Share Posted February 2, 2018 yep, 1 kilobyte "fork" https://github.com/Prozi/pixi-shim/blob/master/index.js You can just copy&paste code and deps in packagejson. Quote Link to comment Share on other sites More sharing options...
TheLoneJedi Posted February 2, 2018 Author Share Posted February 2, 2018 oh I see, well thanks a lot was really useful! Quote Link to comment Share on other sites More sharing options...
Prozi Posted February 12, 2018 Share Posted February 12, 2018 It will always use latest pixi. have fun with it. https://github.com/Prozi/pixi-shim/blob/master/package.json Regards, Jacek Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.