Search the Community

Showing results for tags 'event'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 81 results

  1. Hi all, So, this question stems from this question: Problems with a certain M4A file in iOS with Phaser. So, I have an intro song that I want to play on my game right when the game starts. Obviously, this works fine on desktop and other systems, but not on iOS since iOS needs a touch event before it plays any sound. Unfortunately, I don't want my user to have to click / touch the game first before the intro song starts. What I'm hoping to be able to do is to trigger the touch event so that it registers with iOS. I've tried setting `game.sound.touchLocked` to false, but to no avail: this.game.sound.touchLocked = false;this.myGame.audio.titleMusic.fadeIn(INTRO_MUSIC_FADE_DURATION);Does anyone know how to register a touch event on iOS with Phaser?
  2. I have an button in my game where I am popping a Facebook share window using Facebook SDK for JavaScript. When I interact with the popup and close it, the entire game show's a hand cursor and behaves as if it is the button. Anywhere I click on the screen will launch the popup again. I found that I can stop this behavior by adding the code at the bottom of this function, but then I have to click on the game to regain its focus before I can click on another button. Anyone have any ideas on how to deal with this? shareThis.inputEnabled = true;shareThis.input.useHandCursor = true;shareThis.events.onInputDown.add(function () { share(shareTitles[level - 1], shareMessages[level - 1], shareImgPath + 'icon_level' + level + '.jpg'); // I can stop the whole game acting like a button thing by doing this... shareThis.inputEnabled = false; shareThis.inputEnabled = true; shareThis.input.useHandCursor = true; // ...but then I have to click on the game once to regain its focus before I can interact with it again});
  3. Now I managed to get moving with mouse working. Now I am creating jumping, which is made by pressing left mouse button. How can I make my sprite to jump only ONCE, when left mouse button is clicked? I explain this kind of procedure: When you press left button of your mouse ONCE. I mean once when you press left mouse button with your index finger and then release it. LIke you clicked the link of this thread. When you click, sprite jumps ONCE and then falls back to floor. Not jump twice, not begin to flow on air. Just jumps once. Please, read this post once again before replying to this, so you fully understand my problem. Because I have seen too many threads on these forums where have been asked help i.e. for p2 physics, and somebody has answered with arcade physics code.
  4. How to know what is clicked on the child-rect? http://codepen.io/anon/pen/LpRxdj
  5. And again new day new problem. http://codepen.io/anon/pen/rOMJJP?editors=001 On the mousemove event is subscribed circle. Why react the whole stage?
  6. Do you remember onGameStart conference? That was one of the best Html5 gamedev event out there, with four editions in Warsaw and one in New York. Due to huge work overload, the organizer Michal Budzynski was having a bit of problem to pull this year's edition and he decided to look for help - and so in 2015 onGameStart is coming back as a part of the biggest gamedev event in Central Europe - the Game Industry Conference (GiC). What's going to change? It'll be in Poznan, October 16th - 18th 2015There'll be one onGameStart track about html5 games and 4 other tracks about different game creation aspects (there should be around 100 talks)Last year there was 3,000 attendees from Poland, Germany, Denmark, Czech and FranceThere're going to be special business Pitch&Match meetings (you would be able to schedule those before the event if you would have the business ticket)GiC would takebe in the same place where huge expo PGA is happening (60k visitors last year). What's going to stay the same: Great talks by interesting peopleCool party (even two for those who would have a fancier ticket)Great opportunity to meet publishers and fellow developers.Some links: General GiC page : http://gic.gd If you would like to submit your Html5 talk (there are still few days to do that) http://gic.gd/call-for-speakers/ If you would like to buy tickets for the event: http://gic.gd/tickets/
  7. coter

    pixi and events?

    In Google I find the themes in which they say that no more events. But then I find a more recent topic in which they say that the events exist. In pixi there are events or all of them removed? There is an analog ADDED_TO_STAGE?
  8. Everywhere is written that for interactive events you need to set the flag sprite.interactive = true; but docs have no such Sprite properties. How did a "make" events?
  9. With the first days of July! Please tell me the answers to a couple of things: 1. How to make so that when you double-click on any player object transferred from one stage to the stage 2? In other words - how to do that at an event on the gaming facility dblclick a change of scene. 2. How to do that when you click the player's character was directed to the object (the gate) and in their achievement of a change of scene (location).
  10. Hello all, I am having trouble with a problem that would seem very simple but I haven't been able to find an answer to in the forums and there is not a close example I've been able to find on the Phaser.io site. Explanation: I have a quiz game that asks questions like multiple choice. At the bottom of the game there is a row of circles with numbers inside to show how many questions. When the user answers a question, the circle changes color (red = incorrect, green = correct). Then the row slides to the left. Problem : I use a click event and in the callback function I change the graphics fillColor property ex : rectangle.graphicsData[0].fillColor = 0xFF0000; I put this in the update state, and every frame, the update state looks into an array objects that track the question, the answer chosen and whether or not it was correct. It looks something like this. var tracker = [{question : 1, // Question numberchosen : 'A', // Choice chosenstatus : 0 // 0 for wrong, 1 for right}]So the idea is, that update looks to the question number the game is currently on, subtracts that value by one (the previous question), looks into the array, finds the question number and uses the status to determine whether the circle with the same number should be red or green. rectangle.graphicsData[0].fillColor = tracker[this.quest].status ? 0x00FF00 : 0xFF0000; I use a console.log to check the fillColor Property and it's changed to the correct color, but on screen, the rectangle never changes color. Bandaid : The only way I can change the color of the circle is by refiring the create state and using the same logic to redraw the circles based on my tracker array. I have put together a little snippet to recreate, basically the same functionality (change color of graphic on a event) ;(function($){ $.fn.graphics = function(){ var self = this; var Graphics = {} var game = new Phaser.Game( $(self).width(), $(self).height(), Phaser.AUTO, $(self).attr('id') ); var Objects = { rec : null, color: 0xFF0000 } var state = function(game){} state.prototype = { init : function(){ game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; }, preload : function(){}, create : function(){ Objects.rec = game.add.graphics(0,0); Objects.rec.beginFill(0xFF0000, 1); Objects.rec.drawRect(50,50,50,50); Objects.rec.endFill(); Objects.rec.inputEnabled = true; Objects.rec.events.onInputUp.add(function(){ console.log('fire'); Objects.color = 0x00FF00; }); }, refresh : function(){ }, update : function(){ Objects.rec.graphicsData[0].fillColor = Objects.color; console.log(Objects.color); }, } game.state.add('state', state); game.state.start('state'); }})(jQuery);Sorry for all the tab spacing, this editor seems to magnify all my tabs. here's a screen of my console log that shows the property changes
  11. Any good tutorials on how to bind and handle events in Pixi? The documentation of each event handlers reads "interactionData" as parameter, but I don't really understand what that's supposed to be? Thanks.
  12. Hi, how do you handle events and/or callbacks? How do you handle interactions like mouse events, events bubbling, listeners etc? And what do you think are the best libraries or native functions to handle all this? Personally I am an event guy but I am open to other options too, if necessary, just let me know what is best for you and what you use.
  13. I'm developing a game framework and I've just migrated to Pixi.js V3. After some bumps on the road - undocumented loader & interaction management changes - I've managed to put it in the working state. However, one problem is pestering me: every time I press a mouse button on the sprite or container, or release it, two events are registered instead of one - two on the 'mousedown' and two on the 'mouseup'. This happens with left as well as with right mouse button. Now, I did not change anything in my code and everything was working fine with Pixi.js V2. Does someone know what is going on here? Thank you in advance! UPDATE: I've just realized that two events are produced because I have manually instantiated InteractionManager with new PIXI.interaction.InteractionManager(renderer);Apparantly, pixi automatically creates an interaction manager. However, I do not know how to find the reference to that manager. I need to read out container mouse position in every tick... UPDATE: I've just opened a new topic here, because this issue is resolved initself, but my problem of reading a mouse position in every frame in pixi V3 isn't.
  14. Hi, I'm momentarily experiencing really strange behavior of the function window.addEventListener('keydown', onKeyDown, false);now, first I had this integrated into my index.html by just writing: <script>window.addEventListener('resize', onResize, false);window.addEventListener('keydown', onKeyDown, false);</script>after the referencing of my "main.js" in which the functions 'onResize' and 'onKeyDown' are described. Now this works perfectly fine if you visit the original ■URL■ which is hosted on a free web-storage host called "bplaced.net" but it won't work if you visit the forwarded ■URL■ that I pay for. The forwarding is done by a Frame-Redirect, and so the page uses a frameset to display the content. Could this cause the problem and is there a way to fix it? Thanks in advance. ~Dinkelborg
  15. Hi guys! One question... the onInputDown event from a button can ignore the transparent color? Thanks in advance, Nicholls
  16. Hi, i have basic timed event that won't call provided method, not even once... It's so basic that i don't know what can be the cause. EnemiesManager.prototype.singleEnemySpawnUpdate = function () { if(this.timer.events.length===0){ this.timer.add( Phaser.Timer.SECOND * this.game.rnd.integerInRange(1,2), this.addRandomEnemy, this); this.timer.start(0); }};//never called methodEnemiesManager.prototype.addRandomEnemy = function(){ this.getRandomGroup().addObject(this.game.rnd.integerInRange(100,700),this.game.camera.y+100); this.timer.stop(true);};
  17. I am having issues trying to attach input events to a tile sprite. TileSprites extend Phaser Sprites, yet the inputEnabled property of Sprites is undefined on the TileSprite, and therefore does not run the input.start function to create the events when I set it to true. var corner = new Phaser.Sprite(game, 0, 0, 'corner');//corner.events contains null properties for the input events.corner.inputEnabled = true;//corner.events contains Phaser.Signals for the input events.corner.events.onInputDown.add(this.selectNextGem, this);//This worked, all good, carry on.var gemBox = game.add.tileSprite(0, 0, 128, 128, 'board');//gemBox.events contains null properties for the input events.gemBox.inputEnabled = true;//gemBox.events still contains null properties for the input events.gemBox.events.onInputDown.add(this.selectNextGem, this);//Exception thrown as onInputDown is null.Are TileSprites just not meant to have input love? EDIT: I guess not, because when I called input.start manually on the TileSprites input object and managed to get the input going, I was only able to fire off events by clicking in a region the size of the original sprite.
  18. I am trying to implement some random events happening in my game. For example I want to drop an item on every 5 to 10 seconds. In phaser there is an easy way to create loop events, but they all loop at a certain time. What I am doing so far to achieve this is to add a delay on the event in the timer callback. Is there a smart way to create create events looping in some time range? // Initialize drop timervar cooldown = this.game.rnd.realInRange(this.coolMin, this.coolMax);this.dropTimer = this.game.time.create(false);this.dropEvent = this.dropTimer.loop(Phaser.Timer.SECOND * cooldown, this.dropItem, this);this.dropTimer.start();// dropItem function Grabbable.prototype.dropItem= function() { // Do something // Reset timer var cooldown = this.game.rnd.realInRange(this.coolMin, this.coolMax); this.dropEvent.delay = Phaser.Timer.SECOND * cooldown;};
  19. I feel like I'm just bad at Javascript to have to ask this question so please keep the disparaging remarks to a minimum. I have some game handling taking place on a server and being sent back to the game via JSON like this: Strategy.Game.prototype = { create: function() { this.greenGroup = this.add.group(); this.greenGroup.create(100,100, 'greenParticle'); this.getPath(); }, getPath: function() { $.getJSON("http://mysite.com/strategy/ajax/play.ashx", function (data) { console.log(JSON.stringify(data)); data.forEach(function(step)) { // need access to "game.greenGroup" here to create group entities and move existing ones. } }); }} There is more to the game obviously but hopefully you get the idea. I need to access game entities as I would normally have done with "this.greenGroup" but within the event handler the context has changed. I've tried pulling up the javascript console and seeing if I could track down how to reference the game object but I haven't found it. I can reference the class but it's not the actual working game object. Strangely the ways I've found to reference the game class the greenGroup is always undefined. Any idea where I've lost it?
  20. Hi, I was looking at the chained tweens example and I tryed to add an onCompete event at the end of the tween but it's look like the event is dispatched after the end of the first tween. var tween = this.game.add.tween(this.phaser).to({ alpha: 1 }, 1000, Phaser.Easing.Sinusoidal.InOut, true).to({ alpha: 0 }, 1000, Phaser.Easing.Sinusoidal.InOut, false, 1000).onComplete.add(this.onAnimationDone, this);I found this solution on the forum wich is not ellegant, but at least functional: var tween = this.game.add.tween(this.phaser).to({ alpha: 1 }, 1000, Phaser.Easing.Sinusoidal.InOut).to({ alpha: 0 }, 1000, Phaser.Easing.Sinusoidal.InOut, false, 1000).start(); tween._lastChild.onComplete.add(this.onAnimationDone, this);I would like to know if it is the expected behavior or if there is a better way to do that ? Thank you.
  21. Hello Phaser community! I've had a look around for a possible solution and I can't find one. So now I am here to pick your brains for some ideas on how to do it. Basically in my game when my player walks in front of a window, I have the window fade out. When the player is no longer overlapping with the window, I want the window to fade back in. I have it fading out no problem. I am unsure of the best way to fade back in without using a timer. Any ideas? Thanks in advance!
  22. I am writing a game ui for phaser(https://github.com/drawapp8/gameui-for-phaser-js), here are some demos: http://phaserjs.sinaapp.com/demo1/ http://phaserjs.sinaapp.com/demo2 http://phaserjs.sinaapp.com/demo3 I don't know how to handle mouse move/touch move event, could anyone give me some tips? Thanks in advance.
  23. Greetings everyone, I am using pixi.js for a game development project, and I'm importing animations created with Spine. In order to correctly animate certain characters, I need to respond to Spine animation events. However, I can't find any way to add a listener for them. Are they supported in pixi? Edit: For example: when the character stops, I want the walking animation to also stop, but only once the character finishes the current step (i.e. not freeze instantly). The walking loop consists of two steps, and if this little "hack" isn't put into place, sometimes the walk animation keeps playing for a little bit (until completion) after the character has stopped, which looks quite bad.
  24. Here are my animations baddie.animations.add('fly',[0,1],5,true);baddie.animations.add('hit',[2,0,2],10,false);baddie.animations.play('fly');When the baddie is hit: baddie.animations.play('hit');It plays the hit animation once, then stays on the last frame. Is there a way I can get it to fire an event, or process a function after the animation is done? I can see there is a killOnComplete option, but no onComplete function option. The only real way I can see this working is having a timer or counter, then going back to the fly animation, but that's a bit sloppy and could get annoying with multiple baddies.
  25. Hi All, Is there any built-in method to register swipe(right,left) event for sprite in PIXI.js. There is no such method listed in PIXI.js documentation (http://www.goodboydigital.com/pixijs/docs/classes/Sprite.html) or am i missing something? if there is no built-in method to register swipe event, Can i use "Sprite.touchend" event and write some logic to find swipe left and swipe write event. I have tried this approach by using "mouseData.getLocalPosition(mySprite)" but could not figure out how to find swipe( left and right). I am a newbie in Javascript any code snippet will be really helpful. Thanks