kestorr

Members
  • Content Count

    20
  • Joined

  • Last visited

About kestorr

  • Rank
    Member

Recent Profile Visitors

753 profile views
  1. So anyone knows what happens here?
  2. Hey there. I have noticed that some of the sounds will not play or play partially (like part of the sounds plays and then stops) on internet explorer browser. It works just fine on Firefox. It isnt a sound file problem since i use both .m4a and .ogg So some m4a's work, some dont, in internet explorer. I think there a loading issue since i get this error in IE: "Unable to set property 'loaded' of undefined or null reference" On firefox theres no problem at all. This is how i load the sounds: game.load.audio('Sound', ['Folder/Sound.ogg', 'Folder/Sound.m4a'], true); Is there a way to fix this? I mention that i use phaser v2.0.7
  3. Did you manage to fix this? I have the same problem.
  4. kestorr

    p2 addPolygon

    Hey there. I have managed to fix this issue. The vertices were not applied correctly as you pointed out. Thanks for the reply.
  5. kestorr

    p2 addPolygon

    Hello there. Im trying to use the addPolygon on the body of a sprite but it seems that after i do that, the body will not collide with others. game.physics.p2.enable(objecttr100x86Sprite); objecttr100x86Sprite.body.clearShapes(); objecttr100x86Sprite.body.addPolygon( {} , -1, -41 , 47, 42 , -47, 42 , -47, 43 ); objecttr100x86Sprite.body.velocity.y=10; So now this body is not colliding with others for some reason.
  6. kestorr

    Slice Engine.

    Hello there. I would be interested in a slice engine that works with phaser. Is there such a thing? Or is it possible?
  7. Ok i got it to work: This is the correct way: var game=new Phaser.Game( 640, 480, Phaser.AUTO, 'gameContainer');var state = function(game) { };state.prototype = { preload:function() {}, create:function() {}, update:function() {}}game.state.add('state', state);game.state.start('state');
  8. To narrow it down: var game=new Phaser.Game( 640, 480, Phaser.AUTO, 'gameContainer');var state = function(game) { };game.state.add('state', state);game.state.start('state');state.prototype = { preload:function() {}, create:function() {}, update:function() {}}This gives me the same error ("Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render"), thats all there is inside the game.js But not sure why because the required functions are there.
  9. There are all the 3 functions in the GameState. I also deleted the entire GameState and any reference to it, only Boot remaining and i still get that same error. The problem is in Boot i think.
  10. Thanks for the instructions. Added like this: var BasicGame = {};BasicGame.Boot=function () {}BasicGame.GameState=function(){}game.state.add('Boot', BasicGame.Boot);game.state.add('GameState', BasicGame.GameState);game.state.start('Boot');BasicGame.Boot.prototype = { preload: function () { // Here we load the assets required for our preloader (in this case a background and a loading bar) game.load.image('preloaderBackground', 'GameFiles/background1.png'); game.load.image('preloaderBar', 'GameFiles/loading2.png'); }, create: function () { // Unless you specifically know your game needs to support multi-touch I would recommend setting this to 1 game.input.maxPointers = 1; // Phaser will automatically pause if the browser tab the game is in loses focus. You can disable that here: game.stage.disableVisibilityChange = true; if (game.game.device.desktop) { // If you have any desktop specific settings, they can go in here game.scale.pageAlignHorizontally = true; } else { // Same goes for mobile settings. // In this case we're saying "scale the game, no lower than 480x260 and no higher than 1024x768" game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; game.scale.minWidth = 480; game.scale.minHeight = 260; game.scale.maxWidth = 1024; game.scale.maxHeight = 768; game.scale.forceLandscape = true; game.scale.pageAlignHorizontally = true; game.scale.setScreenSize(true); } // By this point the preloader assets have loaded to the cache, we've set the game settings // So now let's start the real preloader going game.state.start('GameState'); }};// all the varsBasicGame.GameState.prototype = { //etc}But i get this error: "Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render"
  11. I got like this: var game=new Phaser.Game( 640, 480, Phaser.AUTO, '');var BasicGame = {};game.state.start('Boot');BasicGame.Boot=function () {};BasicGame.Boot.prototype = { preload: function () { // Here we load the assets required for our preloader (in this case a background and a loading bar) game.load.image('preloaderBackground', 'GameFiles/background1.png'); game.load.image('preloaderBar', 'GameFiles/loading2.png'); }, create: function () { // Unless you specifically know your game needs to support multi-touch I would recommend setting this to 1 game.input.maxPointers = 1; // Phaser will automatically pause if the browser tab the game is in loses focus. You can disable that here: game.stage.disableVisibilityChange = true; if (game.game.device.desktop) { // If you have any desktop specific settings, they can go in here this.scale.pageAlignHorizontally = true; } else { // Same goes for mobile settings. // In this case we're saying "scale the game, no lower than 480x260 and no higher than 1024x768" game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; game.scale.minWidth = 480; game.scale.minHeight = 260; game.scale.maxWidth = 1024; game.scale.maxHeight = 768; game.scale.forceLandscape = true; game.scale.pageAlignHorizontally = true; game.scale.setScreenSize(true); } // By this point the preloader assets have loaded to the cache, we've set the game settings // So now let's start the real preloader going game.state.start('GameState'); }};//then i got all my varsBasicGame.GameState=function(){}BasicGame.GameState.prototype = { preload: function(){ game.background = this.add.sprite(0, 0, 'preloaderBackground'); game.preloadBar = this.add.sprite(300, 400, 'preloaderBar'); game.load.setPreloadSprite(game.preloadBar); //etc}//and so on with other functionsBut it doesnt work. I get "Phaser.StateManager - No state found with the key: Boot"
  12. Hello there. Is there a way to add a loading bar/screen, other than the way shown in the resources/Project Templates/basic folder? I constructed my game inside one js file (and ofc the index.html) so inside that js file i have preload, create and update functions. And the "var game=new Phaser.Game(...)" is inside there too. I saw in the example there that i need to divide those functions into separate files. So any other way to do this? I tried to just make a boot.js file like in that example but with no success.
  13. kestorr

    Sound Problem.

    Upon a closer look i realised that i was calling the create function when i went back to menu from level. And it is there where i was using game.add.audio (backgroundSound). So thats why i guess it didnt pause, cause it was creating another instance. Now it works.
  14. kestorr

    Sound Problem.

    Hello there. So i have a problem with sound, more exactly with music. For some reason it doesnt want to pause or stop. // these 2 IFs handle the resuming/pausing or stop/playif(soundChanged==true || musicChanged==true){ if(soundState==true && musicState==true) { backgroundSound.resume(); }}if(soundState==false || musicState==false) // so this is the IF that doesnt pause my sound{ console.log('pause');//i also put a log here like so, the log answers to my call but the music does not pause. backgroundSound.pause();}//below is strictly for animations but also the 'Changed' vars become false so the above IFs wont repeat.if(musicChanged==true){ if(musicState==false) { buttonMusicSprite.animations.play('off', 32, true); } if(musicState==true) { buttonMusicSprite.animations.play('on', 32, true); } musicChanged=false;}if(soundChanged==true){ if(soundState==false) { buttonSoundSprite.animations.play('off', 32, true); } if(soundState==true) { buttonSoundSprite.animations.play('on', 32, true); } soundChanged=false;}This happens in update. So its like this, inside the music and sound buttons functions, i set the music and sound changed variables to true (soundChanged=true, musicChanged=true) while i also say soundstate=!soundState and musicState=!musicState. The strange problem is that it works just fine while in menu, but as soon as i go to the game and then back to menu for example, then the music doesnt stop or pause (i tried with stop and play aswell). If i come back to menu from level with music stoped, it resumes when i click, but if i come with music playing it doesnt pause if i click that buttons. Same goes for level screen, not only in menu. Theres no boolean or somethihng liek that to impair from pausing. That code i shown happens in the clean update().