Jump to content


  • Content Count

  • Joined

  • Last visited

About Kraken

  • Rank
    Advanced Member

Recent Profile Visitors

968 profile views
  1. Turns out this was the way to do it, thanks for the help!
  2. Thanks for the reply I'm not really sure how the function could change the level can you show me an example?
  3. var TowerDefense = TowerDefense || {}; TowerDefense.GameState = { init: function(currentLevel) { this.monstersKilled = 0; this.numLevels = 2; this.currentLevel = currentLevel ? currentLevel : 'level1'; }, hitMonster: function(monster, weapon) { monster.body.velocity.x = 200; monster.body.velocity.y = -300; monster.damage(1); weapon.destroy(); if(!monster.alive){ this.killedEnemies++; if(this.killedEnemies == this.numEnemies) { this.game.state.start('GameState', true, false, this.levelData.nextLevel); }
  4. I'm loading my level data from JSON files and it keeps resetting the counter after you beat each level. Is there a way to keep the counter from resetting?
  5. Thanks, that did the trick!
  6. I'm trying to calculate the number of enemies killed but for some reason it is not updating. I have a monstersKilled = 0 variable in the create section of the GameState. this.monstersKilled = 0; I made an enemy prefab where in the damage prototype I want this.monsterKilled to update as enemy's die but it is not updating. var TowerDefense = TowerDefense || {}; TowerDefense.UnitAI = function (game, x, y, id, health) { Phaser.Sprite.call(this, game, x, y, id); this.customProps = { speed: 100 }; //this.game = game; this.game.physics.arcade.enable(this);
  7. Ah yes I should of put in a world bounds so you cant just skip all the pipes. That is a smart move on your part though.
  8. I did learn quite a bit from this one. I originally had a bird that was flapping its wings but I didn't have a sprite sheet for the fish but I am planning on putting in a sound and a sprite sheet for the player.
  9. Thanks for trying it out! I guess it may a bit hard but I used to play the original Flappy Bird for hours so I thought it was easy when i made this one.
  10. OK so should I put the code of the game inside the IIFE? I'm fairly new to JS and I'm not sure how this would protect the code on the client.
  11. Hey Arcanorum, I guess once the files are on the web they are not really safe anymore. Do you recommend JSCompress?
  12. Thanks JohnCitron, do you recommend I use something like JScrambler to encrypt the game?
  13. I didn't even know about circle physics bodies. Thanks Arcanorum! I contemplated using a timer but I wanted to keep the bubble effect and make the player hit an urchin to shrink back.
  14. Here is my second try at a phaser game. I based it on the flappy bird tutorial. Let me know what you think I could do to improve it. https://kraken18.github.io/flappyboard/
  15. Awesome, I'm gonna have a look around those sites
  • Create New...