3man7

Members
  • Content count

    24
  • Joined

  • Last visited

About 3man7

  • Rank
    Member

Contact Methods

  • Website URL
    http://www.3man7.net/
  • Twitter
    Mr3man7

Recent Profile Visitors

862 profile views
  1. Sound effects mashed up

    @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 second method as it sounds more naturally.
  2. changing animation frames of sprite in array

    Without reading too much.. try adding 'animations' before .frame this.empty.animations.frame += 1;
  3. buttons: weird behaviour

    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 () { this.one = this.game.add.button(100, 100, 'one', this.pressedOne, this); this.one.tint = 0xFFFFFF; this.two = this.game.add.button(200, 100, 'two', this.pressedTwo, this); this.two.tint = 0xFFFFFF; this.three = this.game.add.button(300, 100, 'three', this.pressedThree, this); this.three.tint = 0xFFFFFF; this.arr = [0, 0, 0]; }, pressedOne: function () { switch (pressedOne_bool) { case false: pressedOne_bool = true; this.one.tint = 0xE6E2F4; this.arr[0] = 1; break; case true: pressedOne_bool = false; this.one.tint = 0xFFFFFF; this.arr[0] = 0; break; } }, pressedTwo: function () { switch (pressedTwo_bool) { case false: pressedTwo_bool = true; this.two.tint = 0xE6E2F4; this.arr[1] = 1; break; case true: pressedTwo_bool = false; this.two.tint = 0xFFFFFF; this.arr[1] = 0; break; } }, pressedThree: function () { switch (pressedThree_bool) { case false: pressedThree_bool = true; this.three.tint = 0xE6E2F4; this.arr[2] = 1; break; case true: pressedThree_bool = false; this.three.tint = 0xFFFFFF; this.arr[2] = 0; break; } }, EnterBtn: function () { console.log(this.arr); }, render: function () { game.debug.text("pressedOne_bool: " + pressedOne_bool, 32, 40); game.debug.text("pressedTwo_bool: " + pressedTwo_bool, 32, 60); game.debug.text("pressedThree_bool: " + pressedThree_bool, 32, 80); game.debug.text("arr: " + this.arr, 32, 120); } } The render function will make you see things better - although it has an impact on fps so be sure to remove it whenever you try to get the best out of your project/game. Good luck!
  4. 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. If the value is positive then the mouse is on the right side of the gun and vice versa; flipping the gun accordingly. ~~~ You might work with these too later on, altough the above is enough. var gun_distX, gun_distY, gun_angle, gun_degree; gun_distX = game.input.x - this.gun.x; gun_distY = game.input.y - this.gun.y; gun_angle = Math.atan2(gun_distX, gun_distY); gun_degree = gun_angle * 180 / Math.PI; Good luck!
  5. button mute sound problem

    @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 current frame of the sprite. var mutedYN = 0; _button_stay.prototype.anim_on_click = function () { switch (mutedYN) { case 0: //mute this.audio_click(); music.pause(); music_ambiance_mute(); this.button.frame = 1; break; case 1: //unmute this.audio_click(); music.resume(); music_ambiance_activate(); this.button.frame = 0; break; } mutedYN = mutedYN ? 0 : 1; };
  6. Game list of phaser games

    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 to game: http://37dev.ga/jelly Quick Gameplay: https://youtu.be/nRIHGlr1X64 Google Play: https://play.google.com/store/apps/details?id=com.thirtyseven.jellyhaven
  7. [Phaser] Jelly Haven

    Quick update: My first game launch on Google Play: 'Jelly Haven'! https://play.google.com/store/apps/details?id=com.thirtyseven.jellyhaven Enjoy!
  8. cannot apply gray filter to sprite

    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
  9. cannot apply gray filter to sprite

    The filter option will definitely have an impact on the performance. I would personally apply the filter to the batch of images in Photoshop using 'Action'. Here's a good tutorial: youtube.com/watch?v=lcZp2h5WXdA Don't forget to backup your original images! This method only applies if your sprites will remain grayscale the entire project. If you want to transition from color to grayscale and back on color then I would advice against this method and instead try to find a fix for the code. Sorry that I cannot help you enough with the filter code as I haven't used them before.
  10. Scrolling background with switching images

    I have a similar 'question': Is (1) supposed to go in update? What if you use a tween in create? Would that be better performance related?
  11. cannot apply gray filter to sprite

    Well, like @samid737 said, the issue is that you are using CANVAS. In the testing I've used Phaser 2.6.2 and Phaser.AUTO. I am not entirely sure if there are filters that can be used with CANVAS as they are meant to work with WEBGL only. Refer to: https://github.com/photonstorm/phaser/issues/2223 http://phaser.io/docs/2.6.2/Phaser.Filter.html
  12. how to debug this error on canvas+ ?

    I'm not sure if the error refers to something else but first thing that came to my mind is the lack of semi-colons at the end of the lines in create function.
  13. cannot apply gray filter to sprite

    I did a quick test and the code works for me. Are there any errors on console from your app?
  14. Problems in Landscape mode

    In boot.js you've set some limits regarding the game scale: game.scale.minWidth = 250; game.scale.minHeight = 170; <-- lower this or delete the line entirely. game.scale.maxWidth = 1000; game.scale.maxHeight = 680;
  15. [Phaser] Jelly Haven

    Hey guys, I just wanted to let you know about my first HTML5 game made with Phaser! It is an action-arcade 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. Link to game: http://37dev.ga/jelly Quick Gameplay: https://youtu.be/nRIHGlr1X64 The game starts off slowly but it gets really fast paced as you purchase upgrades from the store which helps you survive much longer. Endless fun game with great performance. Optimized for mobile devices but fully playable in desktop as well. Audio support for all mobile operating systems. Easily localized as the texts are stored in a .json file. Saving/loading game with cookies system. Translated in 9 languages: English, Russian, French, German, Italian, Spanish, Portuguese, Turkish and Romanian. The game is currently looking for sponsorship and has not yet been published before. Let me know what you guys think! Enjoy!