aaronhampton

Members
  • Content Count

    11
  • Joined

  • Last visited

  1. Okay, I think I fixed the bug. Please give it a shot if you get a chance.
  2. Ugh, found a bug. If you hit the target and the ball bounces off, that isn't supposed to happen. Fixing it now.
  3. My game can be played here: https://s3.amazonaws.com/games.aaronhampto.com/circolor/index.html I've been making this game while learning Phaser. Shoot each moving target 3 times to proceed to the next level. Right now there are 12 levels in total. Have a touch screen? Hold your finger on the screen and slide it left or right to move the ball. Release the screen to shoot. Otherwise, move the ball with your mouse or with your arrow keys. Shoot with the spacebar or left-click. I have a long list of things I plan on improving and changing, but would love any feedback you can provide.
  4. Thanks! Both of those responses really helped me figure it out. My tween looks like this: var speed = 1500;var multi = 3.5;var rad = sprite.body.data.shapes[0].radius;game.add.tween(sprite.scale).to( {y: multi, x: multi}, speed, Phaser.Easing.Linear.None, true).repeat(Number.MAX_VALUE).yoyo(true);game.add.tween(sprite.body.data.shapes[0]).to( {radius: rad * multi}, speed, Phaser.Easing.Linear.None, true).repeat(Number.MAX_VALUE).yoyo(true);Then, in update I run the following to see the body update during debug: sprite.body.debugBody.draw();Thanks again for all the help!
  5. I am using a tween to scale a sprite from small to large, then yoyo-ing back to small. When the sprite scales, the body does not. I used setCircle to set a circle shaped body, if that makes a difference. I am also using P2 physics. Will I have to keep calling setCircle throughout the tween to make sure the body is the right size? Is there a way to scale the body through tweening or when the sprite is scaled?
  6. I've updated the jsfiddle to use the radius of the circles I'm drawing here: http://jsfiddle.net/ogo5d4ax/ That seems to work better, but I'm still confused as to why the body shown is smaller than the circles drawn and why those bodies are colliding without actually touching.
  7. I've tried reducing the size used when calling setCircle significantly, but the collisions still occur before the bodies touch. Debug is enabled on both bodies in the jsfiddle and you can see their sizes are the same as the circles that have been drawn. I'm sure I'm missing something, but I just don't know what it would be.
  8. I forgot to add. To shoot the blob at the bottom toward the circle, press the spacebar.
  9. I'm creating 2 circles using graphics and adding them to sprites. I'm trying to make the sprites contact each other, but the function added on onBeginContact is called before the objects touch. I have a jsfiddle here: http://jsfiddle.net/vL6gkeue/ Can anyone please let me know why there is space between the two bodies yet they appear to have made contact?