Search the Community

Showing results for tags 'collideWorldBounds'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Platform
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 4 results

  1. Hi, I'm learning to make games Phaser, watching a tutorial to create the Pong. For starters, I have to draw all elements in screen, which are ball and two rackets. Failure to draw the ball, the ball is only draws and no draws snowshoes. The code is as follows <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html xmlns=""> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Pong</title> </head> <body> <div id="ejemplo"></div> <script src="phaser.min.js"></script> <script> window.onload = function(){ var game = new Phaser.Game(640, 480, Phaser.CANVAS, 'ejemplo', { preload: preload, create: create, update: update }); var playerBet; var computerBet; var ball; var computerBetSpeed = 190; var ballSpeed = 300; function preload() { game.load.image('bet', 'assets/rocket.png'); game.load.image('ball', 'assets/ball.png'); game.load.image('background', 'assets/backg.png'); } function create() { game.add.tileSprite(0, 0, 640, 480, 'background'); ball = game.add.sprite(,, 'ball'); ball.anchor.setTo(0.5, 0.5); ball.body.collideWorldBounds = true; ball.body.bounce.setTo(1, 1); computerBet = createBet(620,; playerBet = createBet(20,; computerBet.body.collideWorldBounds = true; computerBet.body.bounce.setTo(1, 1); computerBet.body.immovable = true; } function update () { } //Funciones function createBet(x, y) { var bet = game.add.sprite(x, y, 'bet'); bet.anchor.setTo(0.5, 0.5); bet.body.collideWorldBounds = true; bet.body.bounce.setTo(1, 1); bet.body.immovable = true; return bet; } }; </script> </body> </html> and failure I get is: Uncaught TypeError: Can not set property 'collideWorldBounds' of null In line 39, that is: ball.body.collideWorldBounds = true; Help me please!!
  2. Hi all, I can't seem to find any documented way of initialising a sprite with a negative axis value, whilst having collideWorldBounds enabled. It appears to be resetting my negative axis values to 0 upon rendering, which makes it appear really clunky. = function() { var germId = germs[Math.floor(Math.random()*germs.length)], germ = spawnGroup.create( this.rnd.integerInRange(0,, -50, germId ); this.physics.arcade.enable(germ); germ.body.gravity.y = this.rnd.integerInRange(200, 500); germ.body.collideWorldBounds = true; germ.inputEnabled = true;, this); }; Any suggestions on how to get around this?
  3. I'm using Phaser 2.4.2 with P2 physics. I have a sort of jar shaped body containing some circular bodies (balls). I want to move the jar offscreen but the balls are colliding with the world bounds. I tried setting collideWorldBounds on the balls but this stops them colliding with the jar which I want. You can see a demo here: Click the red button to make the jar move. Uncomment `collideWorldBounds=false` in the 'balls' section to see my problem. Why is this happening and how can I make the balls collide with the jar body but not the world bounds when the jar is moved offscreen?
  4. I wondered if I could enable collideWorldBounds = true only for bottom, left and right parts of the world bounds (and keep the "up" part to false)? Thanks!