newBie here

  • Content Count

  • 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(); = 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; = 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 = id; container.addChild(this.enemy); }; } Is it enough? I think not because now my sprites disappeared
  2. 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: 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="/"></script> <script src=""></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.