Jump to content

Search the Community

Showing results for tags '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
  • 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 18 results

  1. Hey community, this is my first post here, I am sharing my scene in which I have used bounce and collision effect of phaser 3 , I have marked comments in order for understanding and reference purposes. The code I have laid down is as follows: window.onload = () => {//creating game window. class MainScene extends Phaser.Scene { preload() {// the following function preloads the image asset required in scene this.load.image("bird", "bird.png"); } create() { this.player = this.add.group();//grouping the sprite in order to load them at diff
  2. I'm trying to create some billiard-like game, and want to be using arcade physics due to the number of objects. When using the (newer) circular objects, bounce does not seem to work like it's intended - at least if one object is very massy or immovable. Please try https://samme.github.io/phaser-examples-mirror/arcade%20physics/bounce%20knock.html and add a knocker.body.setCircle (16); ball.body.setCircle(16); after both bodys are created - a debugger in render() helps also: game.debug.body(knocker); game.debug.body(ball); You will notice a signi
  3. I'm having trouble making enemies bounce back a bit after colliding with the player so that they don't just sit there relentlessly attacking. I had written this messy code: function collideEnemy(player, enemy) { player.immune = true; // Knocks back enemy after colliding enemy.follow = false; if(enemy.body.touching.left) { enemy.body.velocity.x = 256; } else if (enemy.body.touching.right) { enemy.body.velocity.x = -256; } else if (enemy.body.touching.up) { enemy.body.velocity.y = 256; } else if (enemy.body.touching.down) { enemy.body.velocity.y = -256; } // Makes the pl
  4. Hi there, I have a basic game where the player jumps from a building and must fall into different platforms during the falling to avoid crashing directly with the ground. The thing is that those platforms should have some bounce, I mean, when the player falls into those platforms, it should rebound like if they were some kind of elastic stuff... the problem is that as the platform has body.immovable = true it seems that body.bounce is not working at all, and I can´t apply body.bounce to the player because he should rebound only on those platforms, not on every single object.
  5. Hello, I am new to Phaser and I am trying to make the bullet bounce in the y axis in Phaser. Does anyone know how to do it? Thank you.
  6. PIX HOP Hop, Bounce, Fall and Hop again ! Pix hop, simple endless platform game. You control a bouncy white square collecting coins and avoiding lovely colored enemies. [ Available on: GameJolt, itch.io , Newgrounds] Game supports GameJolt API , Don't forget to log in [ press G in Menu] with your Game Jolt account to Submit yourHighscore and achieve trophies [ Guests are allowed to submit scores make sure to change your name [press N in Menu ] Use Left and Right Arrows to Move [ Keyboard ] Use Left-Click Mouse to move [Mouse] Use Left and Right Arro
  7. I'm working on a platform game using a tilemap and the player continously bounces around the level. The player moves around like a kangaroo and only has to press left or right while hopping around to navigate the level. I've tried setting body.bounce(1.0), but then the maximum height is always the same, the player always bounces up to his starting y-position. Which is not what I'm trying to do. So every time the player bounces on top of on a tile he hops up to a certain height. In other words, every bounce has the same height, when measured to the surface the player bounced on. See
  8. hello, i need help with my game. I am trying to mkae the asteroids bounce back when they reach my blockedLayer (in tilemap) but when they reach the border they just stick to it(they still move but along the blockedlayer). here is the code. is it because they have a behavior with angular velocity? var TopDownGame = TopDownGame || {}; var bulletProperties = { speed: 400, interval: 250, lifeSpan: 2000, maxCount: 30, }; var playerProperties = { velocity: 300, timeToReset: 3, blinkDelay: 0.2, }; var asteroidProperties = { startingAs
  9. Bounce To Dodge (Android Game) Bounce To Dodge is my second published game made with the Phaser framework. Game-play is very simple, just tap the screen to speed up the ball and avoid the spikes. The game's features include: Arcade Style Graphics Google Play Services Leaderboard Two types of game mechanics https://play.google.com/store/apps/details?id=com.bouncetododge Hope you enjoy, and be sure to rate 5 stars if you like the game.
  10. Recently I am doing a project, in which I have to set a constant velocity value to a ball. This game is much like PingPong. I am now using P2 physics, but when test it on mobile, there are a big performance problem. On Android, the problem could be a small problem due to different browser, but it still remain somtimes, there is a little bit stutter when I playing. Because I don't have the things like vector, so I can not get or set it's magnetic efficiently, so I have to calculate the angel and value of the velocity and set it to constant values every frame, I think this might be the main prob
  11. When implementing collision with P2, I can't seem to get rid of a small bounce-back effect. Example: http://test.xapient.net/phaser/tilemapexample/index-p2.html In this example, when Mario jumps on the ground, it gets a little bit below the ground and then smoothly moves up quickly to stand on it. This doesn't happen with the Arcade physics and I can't seem to get rid of it with P2. Also every other example I've looked at has this effect and I tried several parameters. Since I only need AABB collisions, another approach I tried is implementing the collision myself in the update() routine. A ve
  12. Hey guys, I'm pretty new to game dev and I am starting with Phaser. I am working on a basic Brickout type game, and am having an issue with getting the ball to bounce off of the paddle. I essentially just turned on "bounce" for the ball and turned on collision between the ball and the paddle. For some reason, when the ball collides with the paddle, it loses a lot of its y velocity. It is moving down toward the paddle, so I expect it to rebound off of the paddle and start moving up at the same velocity. However, after the collision, it is essentially just moving side to side while moving up ver
  13. i have create mini game with collision system on it. the game about the ball bouncing on moveable player's box. all code is working well. the problem is while i move the box and hit the ball it become faster. i want the speed stay as it what ever happen to the ball. here is my code: game.physics.arcade.enable(box);game.physics.arcade.enable(ball); box.body.immovable = true; box.anchor.setTo(0.5, 0.5); ball.anchor.setTo(0.5, 0.5); ball.body.collideWorldBounds = true; ball.body.bounce.setTo(1, 1);ball.body.velocity.setTo(150, -150); this http://phaser.io/examples/v2/arcade-physics/bounce-knock
  14. how to set bounce only collide object top side? and for other object should bounce when collide all sides. how to done this? thanks for your help and sorry for my poor english.
  15. how i can make image bounce in center place? var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render }); function preload() { game.load.image('flyer', 'assets/sprites/phaser-dude.png'); } var image; function create() { game.physics.startSystem(Phaser.Physics.ARCADE); image = game.add.sprite(0, 0, 'flyer'); game.physics.enable(image, Phaser.Physics.ARCADE); image.body.velocity.setTo(200,200); image.body.collideWorldBounds = true; image.body.bounce.set(1); } function update () { } function render
  16. With: player.body.collideWorldBounds = true;player.body.bounce.set(1);I get the nice effect of bouncing off the walls, but I'd like for something (say, a score counter) to be updated every time player collides with the bounds. What is the best way of doing this with Phaser?
  17. Hello Is there anything like bounce in Arcade Physics.... in P2 Physics? I can simply bounce two objects on collision in Aracde, but I cannot generate something like that in P2! I've defined collisions, bodies.... but I cannot generate what I want. I can change velocity to simulate bouncing, but I cannot find collide direction to simulate it correctly! In my sample, I don't want to have any gravity and friction. Thanks a lot.
  18. So we have sprite moving left right and the aim is to make it stop when hit a "invisible" wall. Let's presume that the x coordinate checks are 0px and 300px, so: if(game.input.keyboard.isDown(Phaser.Keyboard.A)) { paddle.body.velocity.x = -paddleSpeed; } else if(game.input.keyboard.isDown(Phaser.Keyboard.D)) { paddle.body.velocity.x = paddleSpeed; }and after checking some Phaser source i came up with this: if(paddle.x < paddle._cache.halfWidth) { paddle.x = paddle._cache.halfWidth; paddle.body.velocity.x *= -pad
×
×
  • Create New...