Jump to content


  • Content Count

  • Joined

  • Last visited

About 3man7

  • Rank
    Advanced Member

Contact Methods

  • Website URL
  • Twitter

Recent Profile Visitors

2003 profile views
  1. in create(): //add the animation player.animations.add('crouch', Phaser.Animation.generateFrameNames(prefix, start, stop, suffix, zeroPad), fps, loop); //play the animation player.animations.play('crouch'); https://phaser.io/docs/2.6.2/Phaser.Animation.html https://phaser.io/docs/2.6.2/Phaser.Animation.html#.generateFrameNames Reply back with the .json file if you need more help.
  2. Hey, So you have 4 seconds for each of the messages to read; clicking on the screen will skip the current one but also resets the timer back. Take your time looking/understanding the code below and let me know if something doesn't seem to make sense to you. Main.Game = function (game) {}; var myTimer, count = 0; Main.Game.prototype = { create: function () { this.cursor = game.input.keyboard.createCursorKeys(); game.stage.backgroundColor = "#4488AA"; this.player = game.add.sprite(600, 250, 'player'); this.player.anchor.setTo(0.5, 0.5);
  3. @isepulveda Everything in 'update' is going to run 60 times/second. The clicking event should be put in 'create'. game.inputEnabled = true; game.input.onDown.add(function () { count++; if (count <= 1) { this.message.setText("We need your help to save the world"); } }, this); Could you explain a little bit what you are trying to achieve exactly? Any slight changes to the code will return different cases.
  4. 3man7

    6 x 6 grid

    Hi, If you mean like a grid out of a sprite then... //create grid group this.mygridGroup = game.add.group(); this.mygridGroup.enableBody = false; for (i = 0; i <= 5; i++) { for (j = 0; j <= 5; j++) { var mygrid = this.mygridGroup.game.add.sprite(50 * j, 50 * i, 'mySprite'); this.mygridGroup.add(mygrid); } } //later on you can set properties to the grid like so... this.mygridGroup.setAll('anchor.x', 0.5); this.mygridGroup.setAll('anchor.y', 0.5); Good luck!
  5. Hi, There's just a couple of minor problems with your game. Visit the links below to check the errors. index.html = https://www.diffchecker.com/OJDuSSht load.js = https://www.diffchecker.com/vtrZJTg9 menu.js = https://www.diffchecker.com/QKSn5QeI play.js = https://www.diffchecker.com/wCfx8nyS win.js = https://www.diffchecker.com/dmXpemAh I've attached the fixed files in this post. Good luck! index.html load.js menu.js play.js win.js
  6. Hey, I haven't had any problems like that so I'm not entirely sure why that happens. Try adding: game.input.onDown.remove (this.myfunction, this); at the end of the function (this.myfunction) If that doesnt work... then Try adding: game.input.onUp.add (function(){}, this); below game.input.onDown.add (this.myfunction, this);
  7. Hey, Delete the ' ' from the resolution specified. var game = new Phaser.Game(100, 100, Phaser.AUTO .... Delete #1 from update() and add #2 in create() #1 if (game.input.pointer1.isDown) { ball.body.gravity.y = 3000; } #2 game.inputEnabled = true; game.input.onDown.add(function () { ball.body.gravity.y = 3000; }, this);
  8. @Fenopiù - I think the 'update' gives him problems because the sound is playing continuously. @jevisan - This might look complicated but it's pretty easy to understand. I apologize for the long post but I've felt like you may want a different approach of playing the sounds. Methods: sounds will be played like: A-B-A-B etc. sounds will be played in groups like: ( A-B ) -> ( A-B ) -> ( B-A ) -> ( A-B ) -> ( B-A ) etc. sounds will be played randomly like so: A-A-A-A-A-A-A-B-B-B-A-A-A-B etc. Test all 3 and use what you like the most. I recommend the se
  9. Without reading too much.. try adding 'animations' before .frame this.empty.animations.frame += 1;
  10. Hey, I think the problem is merely the code ordering + omitting specifying default proprieties + confusion.. ? Here's how I'd do it: Main.Game = function (game) {}; var pressedOne_bool = false; var pressedTwo_bool = false; var pressedThree_bool = false; var arr; Main.Game.prototype = { preload: function () { this.game.load.image('one', 'phone/phone1.png'); this.game.load.image('two', 'phone/phone2.png'); this.game.load.image('three', 'phone/phone3.png'); this.game.load.image('enter', 'images/enter.png'); }, create: function () {
  11. Happy new year! : ) EDITED: //variables var flip = 0; var gun_distX; //update gun_distX = game.input.x - this.gun.x; /* flip = 0 - mouse is on the right side of the gun flip = 1 - mouse is on the left side of the gun */ switch (flip) { case 0: if (gun_distX < 0) { flip = 1; this.gun.scale.y *= -1; } break; case 1: if (gun_distX >= 0) { flip = 0; this.gun.scale.y *= -1; } break; } You basically subtract x position of mouse and gun to get the distance between the two.
  12. @DanielKlava answer is spot on. I don't see why it wouldn't work for you. Credit goes to him for answer; I'll just provide the code if that's easier to understand. 1. Delete the '1' at the end to make the default frame 0. (aka unslashed/unmuted sprite). (or change it to 0, same thing). this.button = game.add.button(this.posx, this.posy, this.image, this.anim_on_click, this, 0); Frames starts at 0; so you specified the button to go to the next frame (aka slashed/muted sprite) therefore the code skipped the first part. 2. Use a variable instead of checking the cur
  13. Hopefully no one minds but I've already posted my game on 'Game Showcase' section and I've wanted to post it here too as this is my first launch on Google Play! Jelly Haven is an action-arcade HTML5 game in which you control a jellyfish going through the space gathering shiny gems and avoid being hit by dangerous obstacles like meteors and rockets. The game gets really fast paced as you purchase upgrades from the store which helps you survive much longer. * Translated in 9 languages: English, Russian, French, German, Italian, Spanish, Portuguese, Turkish and Romanian. Link t
  14. Quick update: My first game launch on Google Play: 'Jelly Haven'! https://play.google.com/store/apps/details?id=com.thirtyseven.jellyhaven Enjoy!
  15. Ohh I get it. What I would've done instead is this: create a black box with the transparency of 60% and save it as .png. After that just duplicate the .png image with 'for loop', put them in a group and place them over the colored levels (aka unlocked). Then kill() the image specific to the levels unlocked. It won't be grayscale but it's a similar effect. In the end it's up to you
  • Create New...