newBie here

Members
  • Content Count

    7
  • Joined

  • Last visited

  1. I dont use pixi-v5 because my game is cut and the app is smaller with the same code for pixi-v4 (you can see it in screenshots) pixi-v5: <script src="https://pixijs.download/v5.1.0/pixi.min.js"></script> pixi-v4: <script src="https://pixijs.download/v4.4.2/pixi.min.js"></script> I init my game with same code i posted in first post. My game just look better in pixi-v4. Do you now what cause that?
  2. Ok i did it with second container, thanks. I have trouble with understanding this because it feels for me incomprehensible why it cant be done with simple sprite.zIndex = 1, sprite.zIndex = 2 like in CSS It is quite complicated for me, but i believe its because canvas limit When i end making this game is it good idea to post link to it here (maybe with source code?) to get some code review, criticism and advice? Thank you for your help
  3. Ok, thank you. I used the fast script from https://github.com/pixijs/pixi-layers/wiki#how-to-not-use-pixi-display. Now players are above enemies, it works great. Next problem is: how can i move only one sprite to bottom? When enemy is killed he leaves a blood stain which cover other enemies which were added later than him. I want to move a single sprite from enemiesArray on their death moment to bottom. Also when i try to add image to my post on this forum i get error: /var/www/html/uploads/monthly_2019_07 could not be created. Please contact us for assistance. So you can see screen shot with my problem here: https://ibb.co/xShxJ1f
  4. Hello I have problem in understanding how pixi layers work. I want to make some layers like top one, mid and bottom. I want to add players to the top layer, enemies to mid and move dead enemies to bottom layer. I tried to do this, but my sprites are invisible now. Can you provide minimum working code for pixiv4 for my problem? I init player this way: this.player = new PIXI.Sprite(texture_hero); this.player.anchor.set(0.5, 0.7); this.player.x = cords.x; this.player.y = cords.y; this.player.visible = true; container.addChild(this.player); This is how i init pixi: 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); My game is quite big and its hard to select code to post it here to explain my problem. If something is unclear i can post more. Thank you for your time
  5. 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
  6. 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
  7. 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.