Jump to content

Search the Community

Showing results for tags 'collide group'.

  • 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. GROUP VS GROUP Sprite will be generated after 3 seconds with velocity.x randomly, but when the sprite generated with slow velocity.x and another new sprite will generate after 3 seconds. The problem is that I cannot collide with the previous sprite that generated with slow velocity. What is my problem? Can anyone please kindly correct me? I hope that someone helps me . Thanks ! create: function() { groupPlayer = game.add.group(); groupPlayer.enableBody = true; player = groupPlayer.create(game.world.centerX - 115, game.world.centerY, 'bananaBounce'); game.physics.arcade.enable(player); player.body.fixedRotation = true; player.body.gravity.y = 1000; player.body.collideWorldBounds = true; player.body.checkCollision = true; player.body.setSize(100, 50, 8, 10); player.animations.add('play'); player.animations.play('play', 25, true); player.smoothed = true; player.anchor.set(0.5); groupPlayer.add(player); game.time.events.loop(Phaser.Timer.SECOND * 3, this.randomSprite, this);},randomSprite: function() { imgRandomGroup = game.add.group(); imgRandomGroup.enableBody = true; imgRandomGroup.physicsBodyType = Phaser.Physics.ARCADE; var imgType = Math.floor(Math.random()*5); sprites = imgRandomGroup.create(game.world.width, game.rnd.between(40, 300), 'level1'); sprites.animations.add('anim', [imgType], 10, true); sprites.animations.play('anim'); game.physics.arcade.enable(sprites); sprites.events.onOutOfBounds.add(this.removeSprite, this); sprites.body.velocity.x -= 50 + Math.random() * 300; imgRandomGroup.add(sprites); },removeSprite: function(sprite) { sprite.kill(); },killSprite: function(sprite) { sprite.kill();},update: function() { game.physics.arcade.collide(imgRandomGroup, groupPlayer, this.killSprite, null, this);}
×
×
  • Create New...