• Content Count

  • Joined

  • Last visited

About woratana

  • Rank
    Advanced Member

Contact Methods

  • Twitter

Recent Profile Visitors

871 profile views
  1. I have read from this topic about history on pointer. http://www.html5gamedevs.com/topic/2777-dragged-sprite-physics/ However, when I tried with this code: startDrag: function(sprite) { this.currentInput = this.input.activePointer; this.currentInput.recordPointerHistory = true;},stopDrag: function(sprite) { console.log( this.currentInput );}The _history array is empty in console. Please let me know how to make the pointer record history.
  2. Thank you d13 !! I tried your formula and it worked pretty good I will neglect the gravity stuff for now. You can see it in action here http://codepen.io/designil/pen/tEwog/
  3. I know this could be quite stupid question, but I couldn't figure out how So at the moment I have this ball bouncing around in the screen: http://codepen.io/designil/pen/tEwog/ How can I make the ball rotate naturally when they are bouncing around? Any hint would help
  4. I have been fighting with Physics system in Phaser and finally finished this flappy style game. Hope Phaser 1.2 will come out soon You can try it here: http://flappynil-html5.bitballoon.com/ I am welcome for any advice I am still a beginner in this area.
  5. Wow! This is the best news for me in this month! I will be looking forward to 1.2
  6. Hello, I was stuck with this problem since yesterday. When I create tile sprite, it worked fine: this.ground = this.game.add.tileSprite(0, 750, 640, 206, 'ground');the position is X: 0, Y: 750. But when I tried to setRectangle to make it able to collide with other sprite, I added this code: this.ground = this.game.add.tileSprite(0, 750, 640, 206, 'ground');this.ground.body.immovable = true;this.ground.body.setRectangle(640, 206, 0, 0);The tile sprite somehow changed its position to the top of the screen. I have attach the image here. Please let me know if there is anything I need to know about positioning and making tile sprite collidable.
  7. Hello, I am using Phaser 1.1.4 and this is the code I used: Game.prototype = { create: function () { var x = this.game.width / 2 , y = this.game.height / 2; // this.player = this.add.sprite(x, y, 'player'); // this.player.anchor.setTo(0.5, 0.5); // this.input.onDown.add(this.onInputDown, this); this.game.stage.backgroundColor = '#d0f4f7'; this.game.physics.gravity.y = 250; this.game.physics.setBoundsToWorld(); grass = this.game.add.tileSprite(0, this.game.height-600, 1024, 512, 'grassland'); ground = this.game.add.tileSprite(0, this.game.height-200, 640, 206, 'ground'); grass.body.allowGravity = false; ground.body.allowGravity = false; ground.body.immovable = true; player = this.game.add.sprite(150, 200, 'player'); player.scale.setTo(3, 3); player.animations.add('walk', [0,1,2,1]); player.animations.play('walk', 8, true); player.body.minVelocity.y = 5; player.body.collideWorldBounds = true; }, update: function () { this.game.physics.collide(player, ground); ground.tilePosition.x -= 1.4; grass.tilePosition.x -= 1; // var x, y, cx, cy, dx, dy, angle, scale; // x = this.input.position.x; // y = this.input.position.y; // cx = this.world.centerX; // cy = this.world.centerY; // angle = Math.atan2(y - cy, x - cx) * (180 / Math.PI); // this.player.angle = angle; // dx = x - cx; // dy = y - cy; // scale = Math.sqrt(dx * dx + dy * dy) / 100; // this.player.scale.x = scale * 0.6; // this.player.scale.y = scale * 0.6; }, onInputDown: function () { //this.game.state.start('menu'); } };The sprite doesn't collide with the ground and it falls to bottom of the screen instead. I used tileSprite as ground, and player as sprite. Please advice me if I did something wrong.
  8. Thank you for your hard work!
  9. Thanks for sharing! I have been using Julien's generator-phaser with Yeoman: https://github.com/julien/generator-phaser This one can pack your game into 'dist' folder (development is 'src' folder) which is very easy However, the packed game is not working in Facebook App iframe, but the unpacked game does.
  10. Thank you zeterain! I should have searched through the forum carefully
  11. Hello, Thank you for sharing! This is a little off-topic. But do you find it hard to get the game shows correctly in cocoonjs? I tried using the cocoonjs app to load my game, but the game seems to be a lot off-screen happened. :/
  12. Hello, I would like to know how hard is it to make an accurate timer count down. For example, count down for 1 minute. I would also need to tell player the time left every second. I have heard that setTimeout may not be accurate. What is the best way to do this?
  13. Thank you Rich! Pressing Z slower your movement, and you can see exactly the collision box that you will die if the bullet touch you. This will keep you focus on dodging the bullet easier (if the bullet is slow). This is the feature stealing from very famous bullet hell style game called Touhou. However, bullet in the game I made is quite fast so this feature is almost useless >_<