Xesenix

Members
  • Content count

    16
  • Joined

  • Last visited

About Xesenix

  • Rank
    Member
  • Birthday 12/01/1985

Contact Methods

  • Website URL
    xesenix.pl
  • Twitter
    xesenix

Profile Information

  • Gender
    Male
  • Location
    Poland
  • 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

294 profile views
  1. 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.
  2. localstorage

    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; }
  3. 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.
  4. What is huge map for you? I am currently working on maps up to 400x400 tiles something like this:
  5. 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
  6. 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 }
  7. 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.
  8. It didn`t I checked source code it has condition if HEADLESS and cant instantiate canvas throw error it doesn't have any checks condition for webgl so I have used it instead and it worked for testing so i left it that way.
  9. I am writing games in Phaser using webpack for building deployment versions and running hot reload server for development and i am using karma for testing. I am new to most of those technologies so i am open to critique but if someone looks for starting point for connecting Phaser with those technologies i have made git repo that maybe is good starting point to start building your own projects: https://github.com/Xesenix/game-webpack-react-phaser-scaffold If you are more advanced at using such an environment for developing phaser games I would appreciate advices what i can fix with it
  10. Look out for sever cancerness of my project: http://gamejolt.com/games/ld37-elephant-in-the-room/217013 I have tested spine2d in this project so if you are interested how to implement that you can check source code: https://github.com/Xesenix/ludumdare-37
  11. Thank you i wonder what i have made wrong before i thought i have tested this combination.
  12. var Colorize = function (game) { Phaser.Filter.call(this, game); this.uniforms.uColor= { type: '3f', value: { r: 0.5, g: 0.5, b: 0.5} }; this.fragmentSrc = [ "precision mediump float;", "uniform float uColor;", "void main(void) {", "gl_FragColor.r = uColor.r;", "gl_FragColor.g = uColor.g;", "gl_FragColor.b = uColor.b;", "gl_FragColor.a = 1.0;", "}" ]; }; It works if i pass each color channel as separate value but i can find combination of type and data structure that would do the same in single object
  13. Biggest problem i have with phaser move around scalling it seams like it design flaw for example why world coordinates of sprite change when i scale camera and then arcade physique stops working debug layer shows everything all right but sprites start fall thru tiles.
  14. Hi everyone, this is my first entry on this forum. Im getting a lot of help from threads around here so i thought i will share effects of my adventure with html5. I have created "Ancient Maze of Epla" as part od ludumdare 36 comp it took me 36h. I have used phaser connected with nodejs and grunt browserify. You can check source code here if you find that im doing something horrible wrong i would appreciate feedback. Im working on cleaning up that code so i can use it as base for games prototypes. Ancient Maze of Epla is short puzzle game with sokoban like mechanic with difference that everything moves when you give one of commands (up/down/left/right). You can check it either on Kongregate or Gamejolt. And if also took part in ludumdare and wish to comment here is link to ludumdare 36 entry. Also i have upgraded Kongregate version with their api implementation and added lead boards for number of steps required to finish each level to give it some replay ability. I would appreciate any feedback as this is only my second webgl game in phaser (earlier was only ludumdare warmup) and i want to make more projects with that game engine.