Jump to content

Search the Community

Showing results for tags 'border bounce'.

  • 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. Hi guys, I want to create a menu screen with flying asteriods, when they leave the screen, they should appear on the opposite side. I thought this should be done automatically when i use Phaser.Physics.ARCADE, but saidly it doesn't work. My menu looks like this: function menu () { var background = game.add.tileSprite(0, 0, viewportWidth, viewportHeight, 'space'); background.autoScroll(5,+10) // random asteroids var asteroids = game.add.group(); asteroids.enableBody = true; asteroids.physicsBodyType = Phaser.Physics.ARCADE; for (var i = 0; i < 15; i++) { var asteroid = asteroids.create(game.world.randomX, game.world.randomY, 'asteroide', 0); var asteroidSize = Math.random() * (1.1 - 0.5) + 0.5; asteroid.scale.set(asteroidSize, asteroidSize); asteroid.body.velocity.x = getRandomArbitrary(-50, 100); asteroid.body.velocity.y = getRandomArbitrary(-50, 100); asteroid.body.angularVelocity = getRandomArbitrary(-50, 50); asteroid.anchor.setTo(0.5, 0.5); //This allows your sprite to collide with the world bounds like they were rigid objects //asteroid.body.collideWorldBounds=true; //asteroid.body.bounce.setTo(1, 1); }}Thx
×
×
  • Create New...