lenten1111

Members
  • Content Count

    13
  • Joined

  • Last visited

About lenten1111

  • Rank
    Member

Contact Methods

  • Twitter
    cua1010

Recent Profile Visitors

499 profile views
  1. Wow thanks for your patch, I added yours in phaser.js and its working now with phonegap api, but still have issue, we still cant play multi sounds at the same time. So i think i will wait for full patched, thank you again for your work.
  2. Yes, i know how to use phonegap media api, its working good. My problem is how to embed phonegap audio code inside phaser play state which have animations, audio for each animation. It like how to get 2 different codes work together, an example like that.
  3. Yes, i read that, but what i mean an example about how to add phonegap media api inside phaser state, i dont know how to do? im newbie
  4. lenten1111

    Game Launched

    awesome one, Could you please give me example of rotate screen request code?
  5. Hello, I have a few games which run good on desktop and not bad on android with geckoview (app size too big because of geckoview). Now i'm trying to bring them to WP8 and maybe reduce android app size with phonegap. But problem about audio, there no audio working (the same with cocoonjs, i tried). I also tried use phonegap media api, its working but i can't figure out how to use phonegap api inside my phaser game state. Could somebody please give me an example how to use phonegap api inside my phaser game state? Thanks
  6. Yes, thanks lewster. I did face a lot issues when use things in frame. I think i have to practise a lot more. Thanks again, very kind of you
  7. Yes, i tried to remove immovable of fire, but like before, the bird collide fires but only from top and bottom push fires go up or down, stil go through fires. There any way i can collide it? because i want bird collide with fire and low the healthy bar, if it go through, game look really weird And: I tried make the bird.y change when it collide with fire, but still go through, it only change when collide from top or bottom EDIT: I just figured it out now with overlap and body.x, just -x when bird overlap fires, then +x when bird flyup. Look better than the way i thought before
  8. Hi lewster32, me again Can you please help me on this, the bird cant collide in front of fires, it can colide from top and bottom but it go through fires, I dont know what's wrong? I tried to dectect body.touching.left and right but it dont work. Here my code: function preload () { game.stage.backgroundColor = '#330066'; game.load.spritesheet('bird', 'bird.png',72, 98); game.load.spritesheet('fire', 'fire.png', 103, 103); } function create() { bird = game.add.sprite(300, 50, 'bird'); game.physics.arcade.enable(bird); bird.body.gravity.setTo(0, 500); bird.body.maxVelocity.setTo(250, 500); bird.body.collideWorldBounds = true; bird.animations.add('fly', [1,2,3], 200, true); fires = game.add.group(); game.time.events.loop(1000, createFires, this); } function createFires () { fire = game.add.sprite(990 + Math.random() * 300, 30 + Math.random() * 440, 'fire'); game.physics.arcade.enable(fire); fire.animations.add('fire'); fire.animations.play('fire', 6, true); fire.outOfBoundsKill = true; fire.body.immovable = true; fires.add(fire); } function update() { game.physics.arcade.collide(bird, fires); game.scrollSpeed = 1; if (game.input.activePointer.isDown) { flyup(); fires.forEach(function(fire) { // move the rock left at 100 pixels per second fire.x -= (200 * (game.time.elapsed / 1000)) * game.scrollSpeed; }, this); } else { bird.animations.stop(); bird.frame = 0; fires.forEach(function(fire) { // move the rock left at 100 pixels per second fire.x -= (100 * (game.time.elapsed / 1000)) * game.scrollSpeed; }, this); } } function flyup() { bird.body.velocity.y = -170; bird.animations.play('fly'); } Thanks so much
  9. Thanks so much lewster32, learned a lot more from your answer and your second method work like charm , still have issue with the sound but i think i have an idea and will figure it out myself soon. Love u
  10. Hi lewster32 and everybody, I'm here again follow question above thats why i don't wanna make another topic, I have problem about speeding up by velocity, here my code: create: function() { bird = game.add.sprite(300, 50, 'bird'); game.physics.arcade.enable(bird); bird.body.gravity.setTo(0, 500); bird.body.maxVelocity.setTo(250, 500); bird.body.collideWorldBounds = true; flys = game.add.audio('flys'); rocks = game.add.group(); rocks.createMultiple(2, 'rock'); game.time.events.loop(1000, this.createRock, this); }, createRock: function() { rock = game.add.sprite(990 + Math.random() * 400, 30 + Math.random() * 580, 'rock'); game.physics.arcade.enable(rock); rock.outOfBoundsKill = true; rock.body.immovable = true; rock.body.velocity.x = -100; // Normally rock will fly to left at 100; rocks.add(rock); }, update: function() { if (game.input.activePointer.isDown) { this.flyup(); } }, flyup: function() { bird.body.velocity.y = -170; rock.body.velocity.x = -200; // My problem when I put this here flys.play(' ',1,1, true); // Another problem about the sound }, The game hang when click screen. I want the bird fly up, its like the bird fly forward faster thats mean the rock will move faster to the left. I dont know how to fix? . And The flap wings sound play like it keep overlap on and on when hold tap on screen, generate a weird sound. I want it play once and loop when hold tap on screen, the sound of bird fly up. Sorry just learned Phaser about a week! Thanks
  11. Thank you so much lewster32, loved you already
  12. Thanks lewster32, If we use it in update function i think we don't need if, but I already tried it, sill not working function create() { game.physics.startSystem(Phaser.Physics.ARCADE); // When all assets are loaded, go to the 'menu' state bird = game.add.sprite(100, 0, 'bird'); game.physics.enable(bird, Phaser.Physics.ARCADE); bird.animations.add('bird'); bird.animations.play('bird', 6, true); bird.body.gravity.y = 100; game.input.addPointer(); // neither add this nor add } function update() { game.input.activePointer.isDown(fly, this); } function fly () { bird.body.velocity.y =-10; } Also use if like you said, stil not working, the bird falling down
  13. Hi everyone, I'm new in Phaser and start make a flying bird game. Ive already searched for my problem everywhere and read examples, still have no clue. My question about onhold on screen, i dont want people keep tapping on screen to get the bird fly. I want the bird fly when people hold finger on screen, and the bird fall when stop hold screen. Here my code: function create() { game.physics.startSystem(Phaser.Physics.ARCADE); // When all assets are loaded, go to the 'menu' state bird = game.add.sprite(100, 0, 'bird'); game.physics.enable(bird, Phaser.Physics.ARCADE); bird.animations.add('bird'); bird.animations.play('bird', 6, true); bird.body.gravity.y = 100; game.inputEnabled = true; game.input.onDown.add(fly, this); // This is Working game.input.onHold.add(fly, this); // This is Not Working } function fly () { bird.body.velocity.y =-10; } Question here http://www.html5gamedevs.com/topic/1574-gameinputondown-question/ close mine, but i don't know how to fix! Thanks everyone!