• Content count

  • Joined

  • Last visited

About dandorf

  • Rank
    Advanced Member

Contact Methods

  • Twitter

Recent Profile Visitors

485 profile views
  1. Spanish: ¡Buenas! He colaborado con un usuario de Youtube para crear un curso básico de iniciación en Phaser. Con estos tutoriales podrás ir adentrándote en la programación de videojuegos con el framework Phaser (que nos ofrece muchas facilidades). Espero que les sea de ayuda. English: Hey! I've collaborated with a YouTube user to create a basic introductory course in Phaser. With these tutorials you'll go adentrándote in game programming framework with Phaser (which offers many facilities). I hope it will help.
  2. I'm working with different states. Where I have all code of gameplay called "ingame" Ok, I'll use it when calling the game.time.events.add function receives the following parameters: game.time.events.add (1000, this.myFunction, this, arguments); Use this follow: add(delay, callback, callbackContext, arguments) So far so good. The problem comes when wanting to use this function from an extended sprite update (created by me). When I call the function from there "this" refers to the sprite, so you can not put "this" in the third parameter of the function. The context when I use this is SpriteExtended.prototype.update = function() { ... } , so, the "callbackContext" parameter which is now? What should I put? Thank you !!
  3. hasTile always return true?

    I'm trying to make something happen when hasTile return false, but never this occurs. I want that when my character has a null tile in front of them, something happens.
  4. invincible for a while when you hit

    That's what I was missing !! Your system works perfectly. Thank you!
  5. invincible for a while when you hit

    I will use this method to do it, but I have a problem. Each enemy has their own health, created a local variable on your sprite. So when I call the function toggleInvincible have to pass as parameter that enemy ... I do not know how. I have the following: HitOn : function(bullet, enemy){ if (enemy.invincible == false) { enemy.health -= 1; bullet.kill(); if (enemy.health == 0) { enemy.killed = true; //a variable create with me enemy.kill(); } else { enemy.invincible = true; //and then we add a timer to restore the player to a vulnerable state game.time.events.add(2000, this.toggleInvincible(enemy), this); } } }, toggleInvincible: function(enemy) { enemy.invincible = false; //Take error... }, Obtain this error: Uncaught TypeError: Cannot read property 'apply' of undefined phaser.js:40112b.Timer.update phaser.js:40112b.Time.update me.forceSetTimeOut._onLoop phaser.js:35456
  6. like do to when you hit the enemy, this is around for a while invincible? invincible maybe 2 seconds (blinking, for example), and then he can hit again. I have to use some kind of timmer, the game.now ...?
  7. Add variables and functions to group phaser

    I think I finally have to make the extended class Sprite. What I can do in my game code itself, or I have to do it in the file "phaser.js"? If I can do in my own game code ... How I can do? Thank you very much for the help.
  8. I created a group with the enemies on the screen. Now I would like to have each enemy hit points (some 2 others 3 others 4, etc ...). Then I thought that if there is way to make a kind of stretched groups phaser (and that he extended class could add a variable to the health points of each enemy ..?) Or do inthe Sprite class phaser .... I do not know how I should approach this. Any help or ideas? Thanks.
  9. AI enemies do things from time to time, etc ... It is time in my game, I have to create enemies. I do not know how to deal with the issue, I would like you to tell me some options there. How to make the enemy walk to the left and to the right, jump from time to time, etc .... that sort of thing. Thanks!!
  10. destroy animation when finished

    Just what I needed! Thank you very much.
  11. destroy animation when finished

    I want to make an animation when you take a coin, and when the animation is complete, this animation is destroyed, not consuming resources. I've done that take the currency disappears, then appears the animation, but not destroyed after running animation ... I have the following code: var anim = game.add.sprite(coin.x, coin.y, 'coin'); anim .animations.add('walk'); anim .animations.play('walk', 20, false);
  12. bounding box at all sprite group

    Thank you soooo much!!!
  13. bounding box at all sprite group

    can´t do something?
  14. bounding box at all sprite group

    there is any instruction to set the bounding box to an entire group of sprites? I have the following: n_bullets = game.add.group(); n_bullets.enableBody = true; n_bullets.physicsBodyType = Phaser.Physics.ARCADE; n_bullets.createMultiple(10, 'n_bullet'); n_bullets.setAll('anchor.x', 0.5); n_bullets.setAll('anchor.y', 1); n_bullets.setAll('outOfBoundsKill', true); n_bullets.setAll('checkWorldBounds', true);I think setsize method don´t exist for group .
  15. I´m working with ARCADE physicssystem. Thanks!!