Bobcp

Members
  • Content count

    19
  • Joined

  • Last visited

About Bobcp

  • Rank
    Member

Profile Information

  • Gender
    Not Telling
  1. Hi, i have a error with sound in iOS 9, i find this is fixed in dev. How i can build Phaser 2.4.4. ? In dev branch in folder "build" there is phaser 2.4.3 Thank you!
  2. Thank you. Yes, it's becouse use this. Sometime this defind like a object game, but another way, this defined like a function. I put console.log(this) before this.jimAliveTimer function (jim, snowball){ snowball.hasOverlap =true; life=life-1; waterScore=waterScore-10; if(waterScore<0){waterScore=0}; jim.body.en…this.game.physics.arcade.collide(jim, snowballGroup, this.lostLife);snowball is a child of the group called snowballGroup this.snowballCreate = function() { this.snowball = snowballGroup.create(1500*ratioScale,this.game.world.height-100*ratioScale-heightGround*ratioScale, 'snowball'); this.snowball.scale.setTo(ratioScale, ratioScale); this.snowball.body.gravity.y = 2000; this.snowball.body.bounce.y = 0.1; this.snowball.body.mass = 10; this.snowball.anchor.setTo(0.5, 0.5) this.snowball.hasScored=false; this.snowball.hasOverlap=false; }Why this defined like a function, not like an object?
  3. Hi, i create script, and have error, don't understand why it happens, can you help me? this.lostLife = function (jim, snowball){ snowball.hasOverlap =true; life=life-1; waterScore=waterScore-10; if(waterScore<0){waterScore=0}; jim.body.enable = false; this.jimAliveTimer = this.game.time.events.add(Phaser.Timer.SECOND, jimAlive, this); // Error this line code console.log('LifeLost');}
  4. Lost life if collide, not correct work

    Thank you! Very much, i'm nevbie in phaser, i try to do some stuff, and i think game.physics.arcade.collide(jim, snowballGroup, lostLife); not identify what exactly child will be apply function. Sorry for stupid question
  5. Hi, i'm new to phaser, try to create first game, i have some problems with colision. In case, if character collide with object, he loses one life. It work, but if i jump on object, some times character loses 2 life, help me please, why it happen? game.physics.arcade.collide(jim, snowballGroup, lostLife); lostLife = function (){ snowballGroup.forEachAlive(function(snowball) { if(!snowball.hasOverlap){ snowball.hasOverlap =true; life=life-1; jim.body.enable = false; jimAliveTimer = game.time.events.add(Phaser.Timer.SECOND *2, jimAlive, this); console.log('LifeLost'); } }) } snowballCreate = function() { snowball = snowballGroup.create(1500,game.world.height-100-heightGround, 'snowball'); snowball.body.gravity.y = 2000; snowball.body.bounce.y = 0.1; snowball.body.mass = 10; snowball.anchor.setTo(0.5, 0.5) snowball.hasScored=false; snowball.hasOverlap=false; }
  6. How to set round body size

    Thank you, when i change mode to P2, everything like throw to right, why this happen?
  7. How to set round body size

    Hello, i have a ball and method create, set square size of body snowball = snowballGroup.create(1000,game.world.height-100-heightGround, 'snowball');How i can set a round size of body? Thank you
  8. How to check all item in group, not only last

    I solved the problem with this code snowballGroup.forEachAlive(function(snowball) { if(snowball.x<-200){ snowball.destroy(); console.log('KILL'); } else{ snowball.body.velocity.x=-500; snowball.angle -= 3; }});forEachAlive find all children and check it. Thank you, all
  9. How to check all item in group, not only last

    I try this this.snowballGroup.forEach(function(snowball) { if(this.snowball.x<-200){ this.snowball.destroy(); this.snowballGroup.remove(this.snowball); console.log('KILL'); } else{ this.snowball.body.velocity.x=-500; this.snowball.angle -= 3; }},this);but when i create a new child, check from snowball.x begins with new child, and stops with previous
  10. How to check all item in group, not only last

    I have a code where i create a group, and start events loop. this.snowballGroup = this.game.add.group();this.snowballGroup.enableBody = true;this.snowballGenerator = this.game.time.events.loop(Phaser.Timer.SECOND * 3, snowballCreate, this); function snowballCreate() { this.snowball = this.snowballGroup.create(1000,this.game.world.height-100-heightGround, '/snowball.png'); this.snowball.body.gravity.y = 2000; this.snowball.body.bounce.y = 0.1; this.snowball.anchor.setTo(0.5, 0.5); } I need a script where the children are destroy if they go over the screen. if(snowball.x<-200){ snowball.destroy(); console.log('KILL');}else{ snowball.body.velocity.x=-500; snowball.angle -= 3;}My script does not work, it only removes the first children.
  11. Hi, i try to create script which destroy all item in group, who leaves of screen if (snowball.x<-200){ snowball.destroy(); console.log('KILL'); } else{ snowball.body.velocity.x=-500; snowball.angle -= 3; }It work, but when i create another snowball in group, x position check only in last item snowball = snowballGroup.create(1000,this.game.world.height-100-heightGround, '/snowball.png');How to check position of all item in group? Thank you
  12. Swipe not working

    Great! It's work, thank you!
  13. Swipe not working

    thank you, it work, but i have this error Uncaught TypeError: Cannot read property 'centerX' of undefined
  14. Swipe not working

    I replace code from mt.helper.js to code from mt.helper2.js, and i have a same error Uncaught TypeError: Cannot read property 'key' of undefined (mt.helper.js:12)