Jump to content

Search the Community

Showing results for tags 'physics.arcade'.

  • 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 2 results

  1. Example: https://jsbin.com/cakorijiqi/1/edit?js,output Physics.ARCADE collision trouble. Sprite fall through the another sprite if hight velocity. If you change the value from 500 to 100 in the velocity, then the problem does not occur. this.boxGroup.setAll('body.velocity.y', 500); What is the cause of the problem? And I have noticed. If the swap these lines (#2, #3), the box to fall through the floor. function update() {//#1 game.physics.arcade.collide(this.boxGroup); //#2 game.physics.arcade.collide(this.floor, this.boxGroup);//#3 }//#4 Sorry for my English. Thanks.
  2. I have some little squares with text being drawn with bitmapData to a sprite (very scrabble like). I am calling them tiles but they are not Phaser tiles. When dragging them, I want them to bump into each other instead of the dragged square going on top of the other squares. Here is a demo of my problem: http://phaser.io/sandbox/edit/HXZjATTw I am generating 3 draggable tiles in my example (they are stacked ontop of eachother). When you drag them around they only collide with the little Phaser man and not the platforms or the other tiles. Any thoughts on why my tiles wont bump into eachother? In the create() I am running this: var player;var platforms;var cursors;var jumpButton;var canvasZoom = 32;var tileHandGroup;var spriteWidth = 15;var spriteHeight = 15;var tiles = ["h", "j", "k"];function create() { function tiley(i){ game.physics.startSystem(Phaser.Physics.ARCADE); var bmd = game.add.bitmapData(canvasZoom, canvasZoom); // draw to the canvas context bmd.ctx.beginPath(); bmd.ctx.rect(0, 0, canvasZoom, canvasZoom); bmd.ctx.fillStyle = '#efefef'; bmd.ctx.fill(); bmd.ctx.fillStyle = '#234234'; bmd.ctx.font="20px Georgia"; bmd.ctx.fillText(tiles[i], 7,23); var tileSprite = game.make.sprite(32, 32, bmd); game.physics.arcade.enable(tileSprite); tileHandGroup.add(tileSprite); console.log(tileHandGroup); tileSprite.inputEnabled = true; tileSprite.input.enableDrag(true); } tileHandGroup = game.add.physicsGroup(Phaser.Physics.ARCADE); game.physics.enable(tileHandGroup, Phaser.Physics.ARCADE); for (var i = 0; i < tiles.length; i++) { tiley(i); } tileHandGroup.setAll('body.immovable', true); tileHandGroup.setAll('body.moves', false); tileHandGroup.setAll('body.collideWorldBounds', true); /// player = game.add.sprite(100, 200, 'player'); game.physics.arcade.enable(player); player.body.collideWorldBounds = true; player.body.gravity.y = 500; platforms = game.add.physicsGroup(); platforms.create(500, 150, 'platform'); platforms.create(-200, 300, 'platform'); platforms.create(400, 450, 'platform'); platforms.setAll('body.immovable', true); cursors = game.input.keyboard.createCursorKeys(); jumpButton = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);}function update () { game.physics.arcade.collide(tileHandGroup, tileHandGroup); game.physics.arcade.collide(player, platforms); game.physics.arcade.collide(player, tileHandGroup); game.physics.arcade.collide(platforms, tileHandGroup); player.body.velocity.x = 0; if (cursors.left.isDown) { player.body.velocity.x = -250; } else if (cursors.right.isDown) { player.body.velocity.x = 250; } if (jumpButton.isDown && (player.body.onFloor() || player.body.touching.down)) { player.body.velocity.y = -400; }}
×
×
  • Create New...