• Content count

  • Joined

  • Last visited

About Xesenix

  • Rank
  • Birthday 12/01/1985

Contact Methods

  • Website URL
  • Twitter

Profile Information

  • Gender
  • Location
  • Interests
    I like programming, drawing and creating pixel art graphics and lately I spend a lot of time on composing music for my games.

Recent Profile Visitors

636 profile views
  1. Weapon with particles...lag, why?

    Am I wrong or are you creating particle emitter on every frame? this.particlex = game.add.emitter(this.x+35,this.y) you should probably create one emitter for all your effects and only call emit on that one emitter. Also, read about object pooling phaser has some build in particle emitters but you can make your own pools for other sprites.
  2. Resizing Issue with setGameSize

    Ad1) I think you search problems where there is none when exactly do you expect your players to resize game while playing?
  3. Touching but not coliding

    Basic idea create areas for nonNewtonian fluid material and in update use ordinary arcade physique overlap instead of collision to check what is overlapping and modify unit s body velocity or acceleration game.physics.arcade.overlap(nonNewtonianAreaGroup, unitsGroup, onCollision) onCollision = function(unit, area) { // modify unit.body.acceleration.y so when unit.body.velocity is large it gets accelerated upwards // or think of something more elaborated for working in any direction }
  4. Touching but not coliding

    What kind of physique are you using, this is platformer are you using tilemap? When i read this i have two contradiction ideas about what you want: 1. you want your terrain on top of which units are moving to influence their properties 2. you want some area to behave like Newtonian fluid, and im not sure if you know what it means in real life (like if object isnt moving it sinks into that material and when its moving it can push itself from it)
  5. Load polygon - Phaser

    From what you showed here i can only deduce 'grassBody' isnt present in json file or is misspelled. Attach assets/img/assets-pack.json content for more help.
  6. The Phaser 3 Wishlist Thread :)

    I dont know if it was asked before but if you try to make large tile map its RAM consumption can get pretty high (like each of tiles keeps own bitmap data or something) maybe you can look into optimizing that?
  7. Blood. Blood everywhere. How best to do it?

    You can turn of physique on objects that don't need to be moved anymore.
  8. Update Score

    var score = null// move score outside of create function create() { ... score = game.add.text(...) } function firstResponse() { ... // on good answer count += 1; score.text = "Score:" + count; } function secondResponse() { ... // on bad answer count -= 1; score.text = "Score:" + count; } You need some global accessible label so you can update its content after clicking anwser
  9. Brick-Bricker

    I start my music samples like this: // that bit is important for RAM consumption you usualy dont need WebAudio if you dont do fancy things window.PhaserGlobal = { disableWebAudio: true }; var game = new Phaser.Game(480, 320, Phaser.AUTO, null, { preload: function() { game.load.audio('Good-Riddance', 'Good-Riddance.mp3'); }, create: function() { var soundtrack = game.sound.play( 'Good-Riddance',//cache key 1,//volume true//loop ); soundtrack.mute = false;// if you want to mute it } }) If something doesnt work check browser console for errors F12 maybe your file is in different place? Or you running script from file path instead of server can be problem sometimes but should be in this case but if it is you can use for example brackets editor that starts small development server for serving your files.
  10. Help With localstorage api

    You probably stored something not numeric in localStorage and now get bad results like NaN? If that is the case try this: init(score) { score = isNaN(score) ? 0 : score; this.highestScore = Number(localStorage.getItem("score")); this.highestScore = isNaN(this.highestScore) ? score : Math.max(score, Number(this.highestScore)); localStorage.setItem('score', this.highestScore); return this.highestScore; }
  11. If you have sprite atlas for this sprite sheet you can check this: https://phaser.io/examples/v2/animation/sprite-sheet sprite.animation.add(name, frames, frameRate, loop, useNumericIndex) You can check this: https://github.com/photonstorm/phaser/blob/v2.6.2/src/animation/AnimationManager.js line 170 for more details how it works.
  12. Handle huge maps

    What is huge map for you? I am currently working on maps up to 400x400 tiles something like this:
  13. Centering text in v2.6.2

    I am centering my text like this: var label = this.game.add.text( positionOfTextCenterX, positionOfTextTopY, 'Some text to display\nMay be multiline', { font: '64px ' + fontNameUsedInGame, fill: '#ffffff', align: 'center' } ); label.fixedToCamera = true; // so it will move with camera label.anchor.setTo(0.5, 0); //titleLabel.anchor.setTo(x, y); // x: // 0.0 = left // 0.5 = center // 1.0 = right // y: // 0.0 = top // 0.5 = center // 1.0 = bottom
  14. Character Selection menu

    you can pass initialization values for state via state.init so you can have state for choosing character and when character is chosen you can run: // choosing character state game.state.start('playState', clearWorldBoolean, clearCacheBoolean, paramsYouWantToPass) // playState init: function(paramsYouWantToPass) { //do whatever you need to do with chosencharacter passed via paramsYouWantToPass }
  15. FPS drop

    Some performance optimization i have found for my game are: do not use webgl - this one can make a large difference in fps do not use webaudio if you dont need it - this one helps on ram consumption you may turn it of before starting phaser with this: window.PhaserGlobal = { disableWebAudio: true } if you use large map toggle sprite visibility of when they are out of camera view sprite.visible = false if you have full background you can set clearBeforeRender = false - didnt see much difference but may help in some cases game.clearBeforeRender = false if you don`t need running in background disableVisibilityChange = false (by default but you may have changed it) game.stage.disableVisibilityChange = false if you are using pixelart set antialias = false game.antialias = false Probably there will be more to come but at this time it enough for me to keep 30fps even on slowest device i have.