beakartJs

Members
  • Content Count

    6
  • Joined

  • Last visited

  1. I found, offset: toolsGame.mainElements.player.obj.body.offset.x=8;
  2. I mean something like this: https://pasteboard.co/Iwk1y1n.png Anybody have an idea?
  3. Hi! I'm working on a platform game and I have a question. If I have a map of sprites-objects in the game outside the field of view, should I deactivate these objects and activate them when they are seen? If so, what is the best, optimum way to deactivate sprites outside the drawing area? sprite.alpha = 0; and sprite.animations.stop (); ? Or other idea? I am trying (in the loop forEach for sprite vs player) something like this: // [...] main game loop // loop for sprite example exampleSprites.forEach(function(sprite){ if(player.position.x>sprite.position.x-game.width/1.5 && player.position.x<sprite.position.x+game.width/1.5 && player.position.y>sprite.position.y-game.height/1.5 && player.position.y<sprite.position.y+game.height/1.5) { if(!sprite.alpha) { sprite.alpha=1; sprite.animations.play('run'); } } else { if(sprite.alpha){ sprite.alpha=0; sprite.animations.stop(); } } }, this, true);
  4. I can't find the correct method, so I have one question. If I decrease the width of the sprite for example - from 48u to 32u then collision moves by 16u left - how could I center (align) the collision? (8u to left and 8u to right) this.sprite.body.width = 32;
  5. this.sprite.body.width = 32; I have one question:if I decrease the width of the sprite for example - from 48u to 32u then collision moves by 16u left - how could I center (align) the colission? (8u to left and 8u to right)u - unit
  6. here I found example: https://phaser.io/examples/v2/misc/pause-menu but there sholud use game.input.onDown.add (this is little uncomfortable, there should to plot the field x y buttons positions...), I noticed that it depends on the game.paused - if game.paused=true; these any buttons not warking correctly... If I would like use clissic buttons - game.add.button(positionx, positiony, 'button', function(){ }); I must used other idea to paused? I would like to create a more interactive menu (sliders, hover animations, cursor pointer), it is recommended that other solutions to this prolblem? Or maybe better create this menu in html/css? how to do it correct? Thanks for answer