Jump to content

Search the Community

Showing results for tags 'gravity tile 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. Hello, everyone. I'm new here and started to work with Phaser just a couple of weeks ago. I have an "already known" issue that some of you should want to kick me in the nuts for opening a topic about it. So, first of all: sorry for asking this question! I've searched (A LOT) about the issue of using Arcade physics with a big gravity value, what causes a random lack of collision between sprites and tiles, but I couldn't find any answer with a solution that maintains the game (and the sprite's fall off) speed and also eliminates the "tile breaking" issue. So, please (pretty please!), does someone have a solution for this, or at least knows another topic or URL that could help me to achieve both? Just as a matter of information, my code is like this: function create() { game.physics.startSystem(Phaser.Physics.ARCADE); game.physics.arcade.gravity.y = 2000; background = game.add.tileSprite(0, 0, 1280, 720, 'background'); map = game.add.tilemap('tilemap'); // Preloaded tilemap map.addTilesetImage('ground'); // Preloaded tileset layer = map.createLayer('tile'); layer.resizeWorld(); map.setCollision([1]); //it's the ONLY tile! player = game.add.sprite(30, 410, 'player'); game.physics.enable(player, Phaser.Physics.ARCADE); player.enableBody = true; player.body.collideWorldBounds = true; player.animations.add('ready', [0,1,2,1], 7, true); player.animations.add('jump', [2,3,4,5,6], 7, false); player.body.setSize(72, 175, 52, 25);function update() { game.physics.arcade.collide(player, layer); if (buttonDown && player.body.onFloor()) { buttonDown = false player.body.velocity.y = -1020; } else if(buttonDown && !player.body.onFloor() && !doubleJump) { player.play('jump'); buttonDown = false; doubleJump = true; player.body.velocity.y = -920; }The error only happens when "double jump" is triggered. I've already set the gravity down to 1200 (and also correcting the jump's Y negative velocity as well) and the error still happens from time to time (and this speed simply destroyed the dynamic of my game). Thank you for your attention and patience!
×
×
  • Create New...