Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


adamyall last won the day on April 7 2014

adamyall had the most liked content!

About adamyall

  • Rank
    Advanced Member

Profile Information

  • Gender
    Not Telling

Contact Methods

  • Twitter
  1. New blog is up: More AMD Modularization and Finite State Machines in Phaser - Cleared up some issues with AMD modules from the last blog. Used the TypeState library to show how to easily use Finite State Machines in Phaser! Has example code and a demo! Shows how to use Finite State Machines for cleaner, extendable, and reusable code for Phaser in TypeScript. Demo
  2. Hey guys, Over the past few weeks I have been learning more about Phaser and TypeScript and I have started a blog to share what I have learned and post code that I think will help people better use Phaser with TypeScript. I was waiting to post anything about them here until I had a post with actual code in it and a GitHub repo. (Though I saw today a link to one of the posts was on the front page, thanks Rich!) I use OSX and WebStorm, but you should be able to use the code and examples in pretty much any TypeScript environment. But keep in mind these tutorials use more advanced TypeScript f
  3. adamyall

    mummy exmple

    You can flip a sprite horizontally by setting it's x scale to be negative. For instance, change this: mummy.scale.setTo(2, 2); To: mummy.scale.setTo(-2,2);
  4. ".call" is used in JavaScript to call a function with a different scope than the scope in which it is called. In other words, Phaser.Sprite.call(this,game,x,y,v[0]) is equivalent to Phaser.Sprite(game,x,y,v[0]).
  5. Similar question:http://www.html5gamedevs.com/topic/5351-call-a-function-with-arguments-when-oninputdown/
  6. Glad I was able to steer you in the right direction! I'm really liking typescript with Phaser, it forces you to write cleaner code. I'm glad that Phaser is so versatile, but I'd like to see more people using TypeScript, because seeing the completion and inheritances will clarify the structure of Phaser immensely. So kudos for going that route. Btw, my next few blog posts at adam-holden.com are going to be related to TypeScript with Phaser. /self promotion
  7. It's hard to tell without seeing your whole file, but if that jump function is in the class definition, try removing the "function" keyword. What I think is happening is that you are making that jump function a member variable of the type function (In JavaScript Syntax, not TypeScript syntax btw). Therefore when you call the function, "this" is referring to the function itself, not to the class that you have added it to.
  8. http://jsfiddle.net/adamholdenyall/G68ee/7/ Made a fiddle to figure this out myself. Probably the best way to handle gestures is to just include Hammer.js as gesture support in Phaser itself is limited as far as I can tell. The example shows both pinch to zoom and scroll to zoom. Works for me on Chrome for Android and Firefox.
  9. You're welcome, I hope more people see it.
  10. Pull request added. (Here's a link for anyone interested) https://github.com/photonstorm/phaser/pull/706
  11. Have you tried setting the outOfBoundsKill flag on the sprite to true? I think that will do it for you.
  12. I figured out how to do it, but you have to touch a lot of private members. I'm going to take a crack at implementing it in 2.0.3 dev, but not going to make it a parameter to play.
  13. Something like that is definitely a fallback
  14. I have a jump animation and a midair movement animation. The jump animation is 5 frames long, and I want it to play all the way through when the player jumps from a grounded state. However if the user jumps starting from the ground, then starts to move left or right, it plays the midair movement animation. Now, when the user stops moving, I want to transition back to jumping, but starting at frame 4 or 5 of the jumping animation. sprite.play(name);sprite.animations.frameName = frameId;I've also tried using animations.frame = number, but no luck with that either. I just need to know if there's
  • Create New...