• Content count

  • Joined

  • Last visited

About fitness23

  • Rank
    Advanced Member

Recent Profile Visitors

705 profile views
  1. Phaser Scaling Question

    Sorry your question is a little confusing. What do you mean by padded sprites? Do the grey areas still belong to the games canvas?
  2. Memory usage increases 10x after sound loading

    It's best practice to stage loading files. 23mb is a lot to load right from the outset. Try only loading sounds just before the scene where they are to be used. Then after that scene clear the cache before you load the new ones needed for the next scene.
  3. Make sprite tween along an arc

    Hmm thanks. I'm still confused as to how I'm going to get the co-ordinates of the arc in the first place though. I need to know those before I can submit them off in a tween.
  4. Make sprite tween along an arc

    Thanks but the ease function won't have anything to do with the tween path.
  5. Make sprite tween along an arc

    So I know how to draw an arc = But how can I get a sprite to tween along it? I could make an array of x and y points for the tween, but is there a way I can get all the x and y coordinates of the arc? Hopefully the graphic below will illustrate as to what I'm after:
  6. onComplete not triggering

    So I'm trying to create a tween within my sprite called "walkingTween". enemy.walkingTween ={ x: this.player.x, y: this.player.y }, walkSpeedTime, Phaser.Easing.none).start(); And this successfully makes the tween happen. However when I try to make it do something after the tween, onComplete doesn't trigger off. enemy.walkingTween.onComplete.addOnce(function () { console.log("Tween Complete!"); }, this); Any ideas? If I did a normal tween such as: var enemyWalk ={ x: this.player.x, y: this.player.y }, walkSpeedTime, Phaser.Easing.none).start(); Then the onComplete function DOES work. But for various reasons I have to have this tween assigned under the sprite itself.
  7. States

    So I have my main game state called "Game" and I need to allow the user to go to another state called "Volume". I can make the user go to the "Volume" state all fine, but when I try going back to "Game" state by doing: this.state.start('Game'); all the functions I put in the Create function get re-run and the player has to start from the beginning again. I need the game to remember where the player was standing, where the enemies were etc, without the state restarting. Any ideas?
  8. Gamepad setup

    Sorry I think I've solved it now. Windows 10 doesn't seem to work with an Xbox 360 controller, but it does seem to work with an Xbox One.
  9. Gamepad setup

    I'm a bit confused as to how the Phaser gamepad example works. I have my XBOX 360 controller connected to my Windows 10 laptop. I then visit the example page = But it seems as though the page doesn't recognise that a controller has been connected. Am I missing anything?
  10. Audio + memory usage = headache

    Hi @trpzn I have the code here. I hope @Anderberg doesn't mind since he made it available before: /* Fix for Phaser to properly remove music cache START */ Phaser.Sound.prototype.onEndedHandler = function () { this._sound.onended = null; this.isPlaying = false; this.stop(); if (this.externalNode) { this._sound.disconnect(this.externalNode); } else { this._sound.disconnect(this.gainNode); } }; Phaser.Sound.prototype.stop = function () { if (this.isPlaying && this._sound) { if (this.usingWebAudio) { if (typeof this._sound.stop === 'undefined') { this._sound.noteOff(0); } else { try { this._sound.stop(0); } catch (e) { // Thanks Android 4.4 } } } else if (this.usingAudioTag) { this._sound.pause(); this._sound.currentTime = 0; } } this.pendingPlayback = false; this.isPlaying = false; var prevMarker = this.currentMarker; if (this.currentMarker !== '') { this.onMarkerComplete.dispatch(this.currentMarker, this); } this.currentMarker = ''; if (this.fadeTween !== null) { this.fadeTween.stop(); } if (!this.paused) { this.onStop.dispatch(this, prevMarker); } }; /* Fix for Phaser to properly remove music cache END */ This works fine for my project which is in Phaser version 2.6.2. As far as I know it is still an open issue, I have to assume not many people have run into this issue before but when you are making big games like mine which is over an hour long you need to be able to ditch the audio easily Hope that helps.
  11. Bayou Island now released on Steam [PHASER]

    Hi @Tua, Thanks very much for your lovely comments. You've encouraged me to do a quick write up of my experience so far so I've written a quick article here = Main points were that I used nw.js to make the exe file. There are a few things to be aware of such as the icons going a bit strange and the fullscreen mode but I hope it's helpful Are you making an exe file yourself?
  12. Bayou Island now released on Steam [PHASER]

    Hi @rich, Yes of course. I'm finding it useful to document stuff like this so I remember for next time haha. I'll wait a few more weeks and write back on this post.