Claudiovc

Members
  • Content Count

    10
  • Joined

  • Last visited

About Claudiovc

  • Rank
    Member

Profile Information

  • Gender
    Not Telling
  • Location
    Lavras/MG - Brasil

Contact Methods

  • Twitter
    claudiovicar

Recent Profile Visitors

346 profile views
  1. Hi Cutu, have you tried rufflezs' suggestion? Let us know if it works for you: function update() { spaceshipCollide(); // You don't need the 'forEach', since each block has the same 'y' coordinate // Just get the first one...if it passes your test, all the blocks in the group will =) scoreSystem(barrierGroup.getFirstAlive()); } The point is that you don't need the forEach in your update loop, you just need one block.
  2. Hi Sam, you mean, where the body.blocked.left is set to true? If so, you may try to place a breakpoint at: 1 - Phaser.Physics.Arcade.Body.checkWorldBounds: https://github.com/photonstorm/phaser/blob/v2.6.2/src/physics/arcade/Body.js#L795 or at 2 - Phaser.Physics.Arcade.TilemapCollision.processTileSeparationX: https://github.com/photonstorm/phaser/blob/v2.6.2/src/physics/arcade/TilemapCollision.js#L356 These are the only two places I found where blocked.left (or right) are set to something =]
  3. Are you calling it this way "Timer.prototype.turn_chooce()" or are you passing it as a callback, as an argument for a function? Could you share the code where you call the turn_chooce function?
  4. In your fiddle, when you call cercle.hide() , the "this" property is your "cercle" instance. In your broken code, you might be calling "turn_chooce" from another scope, or context. If so, your "this" inside "turn_chooce" is not your Timer object, then you can't access "timer_text" - it doesn't exist. That's why drhayes asked "What's calling turn_chooce?" Could you check drhayes's answer and shows us the result of the "console.log(this)"?
  5. Now I (think I) get it. Yes, you can add any property to Phaser.Group - just like you did with the barrier.scored. If you want, you can also extend Phaser.Group and add the "scored" property so every Barrier you create inherits it. Just remember that you need to check for "p.parent.scored" in your loop, or you won't be checking the Group's property.
  6. Hello, Alamantus. Quoting @rich, from last week chat on Phaser's Slack channel: Hope it helps!
  7. Hi, Cutu. The forEach loops through each block you add to the group. You may want to create one group per row of blocks, instead of one for all the blocks. Then, in the update(), you can check each group, instead of each block. Ps: A tip, avoid naming a variable as "p", it'll make your code easier to understand (for you, as well =D)
  8. By the way, maybe you could extract the Math.sin() from the loop...I don't know the size of you bulletList array, but, since it doesn't depend on the loop variable... this.shoot_update = function(type, phase){ var dx = Math.sin(phase*0.1)*5; for(var i = 0; i < this.bulletList.length; i++){ this.bulletList[i].body.x += dx; }}Maybe it'll be just a little improvement....but the topic is about the performance, so why not =) I think you could use bulletGroup.forEach() for the loop, as well.
  9. Ok, thanks Rich, I'll go with that approach.
  10. Hey there, I've been playing with Phaser since yesterday, it looks great! My first experiment is going to be a simple Match-3 game and I need to know when the user is dragging a sprite over another one. If I register to the following event, my function gets called when I hover though the sprites. However, that doesn't happen when I'm dragging a sprite around. sprite.events.onInputOver(onTileOver, this);Any tips on how i could achieve that? I'd need that to give some feedback to the user - add an effect if the user can't release the tile there, e.g. Thanks in advance! Claudiovc