newBie here

Members
  • Content Count

    3
  • Joined

  • Last visited

  1. Ah okay, stupid mistake I have no errors now. Its hard to me to understand how this work, and i dont know what am i doing lol So i have this code var type = "WebGL" if (!PIXI.utils.isWebGLSupported()) { type = "canvas" } const app=new PIXI.Application(1000,800,{ transparent:false, backgroundColor:'0x000000' }); document.body.appendChild(app.view); //var layer = new PIXI.display.Layer(); //stage.addChild(layer); var container = new PIXI.Container(); app.stage.addChild(container); /*var enemiesGroup = new PIXI.display.Group(0, true); enemiesGroup.on('sort', function(sprite) { sprite.zOrder = 1; });*/ var playersGroup = new PIXI.display.Group(1, function(sprite) { sprite.zOrder = 3; }); var enemiesGroup = new PIXI.display.Group(1, function(sprite) { sprite.zOrder = 2; }); app.stage = new PIXI.display.Stage(); app.stage.group.enableSort = true; //layers app.stage.addChild(new PIXI.display.Layer(enemiesGroup)); app.stage.addChild(new PIXI.display.Layer(playersGroup)); var enemyArr = []; var enemyController = function() { this.enemy = null; this.id = 0; this.init = function (cords, id) { this.enemy = new PIXI.Sprite(texture_zombie); this.enemy.anchor.set(0.5); this.enemy.x = cords.x; this.enemy.y = cords.y; this.enemy.visible = true; this.enemy.parentGroup = enemiesGroup; //group this.id = id; container.addChild(this.enemy); }; } Is it enough? I think not because now my sprites disappeared
  2. http://fx-team.fulara.com/team/adam/zombie apocalypse.rar As you can see in my game when zombie is killed i am changing its texture to blood and its cover others sprites. Can you look at my code and do code review? Should i change something? Its my first multiplayer game so every tip will be appreciated
  3. Hello i have some problems with pixi-layers.js. I want to move some sprites to top. I use pixi.v4 with this script: https://github.com/pixijs/pixi-layers/blob/layers/dist/pixi-layers.js Error message i get: pixi-layers.js:705 Uncaught TypeError: Cannot read property 'prototype' of undefined at pixi-layers.js:705 at pixi-layers.js:744 I add pixi layers in index.html this way: <script src="/socket.io/socket.io.js"></script> <script src="https://pixijs.download/v4.4.2/pixi.min.js"></script> <script src="src/pixi-layers.js"></script> <script src="src/keyboard.js"></script> <script src="src/client.js"></script> What did i do wrong? Thank you for your time.