• Content count

  • Joined

  • Last visited

About totallybueno

  • Rank
    Advanced Member

Contact Methods

  • Twitter

Profile Information

  • Gender
  • Location
    My world
  1. How to apply an "impulse" to an object

    Awesome, that fixed the problem! What´s the difference between those two calls? Well, I´m gonna check the docs, I guess I´ll find info there Thanks for helping me with this!
  2. How to apply an "impulse" to an object

    Hi there, I´m a bit confused about some core concepts with Arcade Physics... I´ll try to explain it because actually it´s a little bit confusing even to understand what´s going on. The thing is that I have a game where the main character is falling like if he jumps from the top of a building and when I init that sprite, I just apply a gravity to him this.prota.body.gravity.y = 700 Then, on both sides of the game I have some mushrooms and some black-weird-plant-arms and when you hit them, I want the player to receive like an impulse, I mean, I want the player to "be launched like a rocket" and I make this with a callback of a collide() in the update() of the game //in the update() this.physics.arcade.collide(this.prota, this.grupoSetas, null, this.reboteSeta, this) //and the callback reboteSeta:function(prota, seta){ //some code this.prota.body.acceleration.y = 0; this.prota.body.acceleration.x = 0; this.prota.body.velocity.y = -1000; this.prota.body.velocity.x = this.rnd.between(-1000, 1000); //some other code }, The problem I have, is that the first time the player hits the mushroom, he rebounds only a little bit and then the rest of the times he rebounds properly and I´m really confused about this, I don´t know why this is hapenning... Can anyone let me know what and why this is hapenning? You can test it here
  3. Best practice for pause/unpause on canvas focus/blur?

    I don´t have any problem pausing the game, that´s ok, the problem I have (not really related with Phaser) is how to deal with the canvas when it loses/gains focus...
  4. Hi there, everytime I have to make a game that pauses when the canvas loses the focus (jquery blur()) I struggle with lines and lines of stupid lines of javascript and I´m pretty sure there´s something simpler than my way to do that. I have a normal sprite on the game that pauses/unpauses the game, and I would like to do exactly the same when the canvas focus/blur... how do you guys handle this?
  5. Poor performance on iOS devices (60fps Android vs 15 fps iOS)

    I guess if they´re not renderable I´ll have less cpu/ram needed, right? Thanks for the tip @samme
  6. Poor performance on iOS devices (60fps Android vs 15 fps iOS)

    I just uploaded a demo to When I create the game, that tag is Phaser.AUTO, I tried with Phaser.WEBGL too but I have the same result... so fustrating... And it seems with Phaser.CANVAS that performance is really good, thanks for the tip @totor. I´m just curious, if someone can explain here why this happens, would be really nice... anyway, it´s working
  7. Hi there, I have a "more o less basic" game and now that is almost finished, I realized that the performance on iOS is ridiculously bad. Running the game on old Android devices I get easyly 60 fps, everything runs smoothly, but the same game, running on an iPhone 7 (and obviusly on older devices) it´s gettting 15 fps, being and easy game on a much more powerfull device (good one, Apple). The thing is, I read that maybe tilesprites (I´m using one) could "help" to this poor performance, but this is not the case, even without that tilesprite I´m still getting 15 fps... Can anyone point to things to check? Stuff that affects only iOS? I´m not finding how to fix this...
  8. Should these two items circled botton left (they´re in the same group) fire that onOverlap function? They´re not firing it... I don´t know if it´s because of the body size (not the whole sprite as you can see with the render rectangle) of because I can´t check group vs group this way...
  9. Is there a way to determine the actual objects overlapping instead of the group? I mean, in the callback function, I´d like to know which two items are overlapping to destroy one of them as if I thing1.destroy() I destroy de whole group, or do I need to loop inside the callback to check the items overlapping?
  10. Hi there, I have two groups, each one with 50 item placed randomly in the stage. I need to check if any of the items of group1 overlaps with any of the items of group2 (and then, destroy it) but I´m doing something wrong as all the elements of group 2 are being destroyed, it´s like is checking object1 with the whole group2... how can I check items by item? I have this code (not working properly) function checkOverlaps(group1, group2){ group1.forEachAlive(function(obj1){ group2.forEachAlive(function(obj2){ var boundsA = obj1.getBounds(); var boundsB = obj2.getBounds(); if(Phaser.Rectangle.intersects(boundsA, boundsB)){ obj2.destroy(); } }, this) }, this) },
  11. How can I apply arcade.body.bounce to a immovable objetc?

    @samme thanks, that´s what I needed! The bounce is now working properly, even with a bouce.y = 1 I can see a tiny tiny movement, I guess something else is affecting this, but anyway, the platform thing is working and with a player.body.velocity.y =-500 y can make that rebound effect... so, fixed, thanks for your help
  12. How can I apply arcade.body.bounce to a immovable objetc?

    Hahahaha, ok, well, I thought you knew Phaser as this is on the Phaser forum
  13. How can I apply arcade.body.bounce to a immovable objetc?

    With Arcade Physics? I don´t see that on the docs...
  14. Thanks for your help, guys
  15. 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. I have the world with a global gravity and those platforms immovable and with their gravity.y = -that global gravity, is this the best way to to this? Any other way to create purely static objects?