Jump to content

Search the Community

Showing results for tags 'circluar collision'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. First of all I'm not sure this is the best way to group element for collision detection but I'm crating CHARACTER elements that contain various sprites that I want to act as one element. I want the different circles(made up of a few sprites) to bounce off of each other. In order to keep all the elements together and since I can't set 'body.setCircle' on a group I'm using the 'circle' sprite for physics and just updating the positions of the other elements to match the x/y of the 'circle' in the bubble.update = function(){}. Is there a better way to do this? My other question is, as I add more CHARACTER's I'd like to add the corresponding 'bubble' sprite to a: game.physics.arcade.collide() so that the 'bubble's bounce off each other. ie game.physics.arcade.collide(bubble1, bubble2, etc) is there a way to do this? CHARACTER _ctor: function() { var character_g = this.game.add.group(); var s1 = imageLoader.sprite(0, 0, 'Idle.png'); var s2 = imageLoader.sprite(0, 0, 'state1.png'); s2.visible = false; var bubble= imageLoader.sprite(0, 0, circle.png'); game.physics.arcade.enable([bubble]); bubble.body.setCircle(160); bubble.body.collideWorldBounds = true; bubble.body.bounce.set(1); bubble.body.gravity.y = 0; bubble.body.velocity.set(150); character_g.add(s1); character_g.add(s2); character_g.add(over); bubble.update = function(){ s1 .x = bubble.x; s1 .y = bubble.y; s2 .x = bubble.x; s2 .y = bubble.y; } s1.inputEnabled=true; s1.events.onInputDown.add(this.itemClick,this); }
×
×
  • Create New...