Sebastien

Members
  • Content Count

    6
  • Joined

  • Last visited

About Sebastien

  • Rank
    Newbie
  • Birthday 11/16/1993

Profile Information

  • Gender
    Male
  • Location
    France

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Well, it seems that adding this button.forceOut = true; solved this problem
  2. I did what you said, and it lauched the onInputOut event, however a problem persists. When I click on a construction site to build a tower, I see my 4 buttons, and when the cursor is over one of these buttons, the border of the button gets brighter. When I click on one of these button, a tower is getting build and the 4 buttons disappear. But if after that I click on another construction site in the map, the button corresponding of the type of tower I builded earlier still is visually in his "over" state, judging by his border which is brighter.
  3. Sebastien

    Problem with playing sounds at the same time

    My game is a Tower Defense, and I need to have several sounds played simultaneously But it does not work for me either, in my preload file I have this code : this.load.audiosprite('sounds', [ 'assets/audio/sounds.ogg', 'assets/audio/sounds.m4a', 'assets/audio/sounds.ac3', 'assets/audio/sounds.mp3' ], 'assets/audio/sounds.json' ); In my game file I have this code in the create function (TD is my game object) TD.sounds = this.add.audioSprite('sounds'); TD.sounds.allowMultiple = true; and somewhere in my code in a function called by the update function I generate an random number to play a different musket sound to get a bit of variety : if(rnd < 0.2){ TD.sounds.play('musketSound1'); }else if(rnd < 0.4){ TD.sounds.play('musketSound2'); }else if(rnd < 0.6){ TD.sounds.play('musketSound3'); }else if(rnd < 0.8){ TD.sounds.play('musketSound4'); }else{ TD.sounds.play('musketSound5'); } My game is a Tower Defense so this code is called by every tower which contains musketeers at the moment they shot. What happen is, if I have several musketeer (let's say 5) and if 3 of them got a random number between 0 and 0.2, then I will have the 1st musketeer who will shot and the musketSound1 will play, but if the 2nd musketeer shot a little bit later (lets say 0.2 second later and the musketSound1 has a duration of 0.4s), it will restart the musketSound1 instead of creating a new instance of it. So what can I do to avoid such a behaviour ?
  4. Hi, I have several buttons in my game and I want them to disappear when I click on it. But it seems that the event "onInputOut" is not fired when I set the property button.visible = false in the callback function of the button. Is this a normal behaviour ? Because this causes some problems in my game logic. Is there a way to force the event "onInputOut" to be launched ? I tried button.onInputOut.dispatch() but it does not work. Thanks
  5. Thank you for these responses. Samid 737: I thought to do something in this style but I did not know how to code it so thank you I will try to succeed with your code to help me
  6. Hi, I am currently developping a Tower Defense style game and I want a nice effect when the mouse hovers a sprite. So I was wondering if it was possible to achieve something similar to this image without the necessity of making another image. I'm talking about the yellow shape when the cursor is on the sprite. I need to have this effect even during an animation, which is why I think it would be complicated to manage if I had to switch between two types of images. And also collision detection with the cursor needs to be relatively precise. When the cursor is OUT : When the cursor is OVER : Thanks