• Content count

  • Joined

  • Last visited

About UncleAcid

  • Rank
    Advanced Member
  • Birthday 12/14/1990

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Toronto, Ontario

Recent Profile Visitors

237 profile views
  1. Ya, I definitely did some things that are very different from using straight up Phaser, but I'm glad you were able to get going and it seems like it did make a positive difference in the end. If you have any feedback on any improvements to make anything easier to do or understand I'd love to hear it. The link doesn't work, it seems the games are all listed with the games name after /38/, maybe that was a pre-release link or something. What's the name of you game?
  2. That is a good plan as well, you have 2 days to get something done, I'd stick with what I know too. Haha Again, send me links to anything you do with my template, if you do anything with it, I'd love to see it
  3. Awesome, glad I could help! I hope it all goes well for you, definitely send me the link to your game after!
  4. Ah, gotcha. I'm not sure, but you could try generating a texture from your graphics object to create a sprite with, instead of just using the graphics object?
  5. I don't believe that graphics object respect anchors, they only deal with top left, width and height. So it doesn't matter where the parent sprites center is, since the graphics object is looking at the sprites top left. I could be wrong, I didn't confirm that at the moment, but I think I remember reading that at some point.
  6. Is lineStyle what you're looking for? http://phaser.io/docs/2.6.2/Phaser.Graphics.html#lineStyle Calling this before you call drawRect will result in a filled rectangle with an outline.
  7. It's because you are using the same offset for the mushroom as the boxes, you are positioning the first mushrooms center at 100,100, which is the bottom right of the first border box. You need the + 50 so that you are positioning the mushrooms at the center of the border boxes, not the edges.
  8. Not sure, but the issue has been reported in the GitHub repo (https://github.com/photonstorm/phaser-ce/issues/27) you can keep an eye on that issue (or watch/follow it if you use GitHub).
  9. I don't believe you can do it the exact way you're wanting to, your long create function is all happening on the same thread, causing the game to hang while it runs. The reason the load screen can have the progress update is that it's loading assets in other threads (the browser is loading the assets, not javascript or phaser) and reporting progress back to the javascript thread. Javascript is single threaded so you'll have to run your loads over multiple frames. You could fake it by using setTimeout(this.initNext, 0) or similar so that you only initialize one thing per frame (or as many things you can load without hanging too much/makes progress look the way you want). You'd have to keep track of the amount of loading chunks you have and update your progress bar as you load those chunks. Makes sense?
  10. It's because 'this' in the context of preload is not your instance of your demo class; 'this' in the context of preload is the Phaser.Game. You will have the same issue with both create, and update as well... you could get around that by binding your functions when you set them; /// <reference path="scripts/phaser.d.ts" /> class demo { private game: Phaser.Game; constructor() { this.game = new Phaser.Game(500, 500, Phaser.AUTO, "content", { create: this.create.bind(this), preload: this.preload.bind(this), update: this.update.bind(this) }); } private doSomething(): void { } private update(): void { } private preload(): void { this.doSomething(); } private create(): void{ } } window.onload = () => { new demo(); };
  11. Sounds like the recent change in Chrome for Android; Web Audio user gesture requirement on cross origin iframes on Android... ? https://www.chromestatus.com/feature/6406908126691328 https://github.com/photonstorm/phaser/issues/2913
  12. You'll probably run into issues because onTap is not called if you don't release quick enough (not a tap)... honestly, what I would do is use a background and add onInputDown and onInputUp to it to handle the tap and double tap (using time.now and lastClickTime and timers for figuring out if it's one or the other) avoiding the global input.onTap. Then you also don't have to worry about clicking buttons counting as a tap or not as the button is covering the background and therefore the background doesn't get the event...
  13. That's the expected way to do it. If you really want to only use a single tween you could defineProperty anything you need; Object.defineProperty(sprite, 'scaleX', { get: function() { return this.scale.x; }, set: function(value) { this.scale.x = value; } }); Object.defineProperty(sprite, 'scaleY', { get: function() { return this.scale.y; }, set: function(value) { this.scale.y = value; } }); var tween = this.game.add.tween(sprite) .to( { x: prevWidth * 1.5, y : prevHeigth * 1.5, scaleX: scX, scaleY: scY }, 200, "Linear", false) .to( { x: prevWidth, y : prevHeigth, scaleX: orX, scaleY: orY }, 200, "Linear", false ); tween.start();
  14. Ah, all you need to do is change the callAll to use the body as the context; bullets.callAll('body.setSize', 'body', 8, 8, 8, 8);
  15. Something along these lines ? (pseudo/untested code) function onInputUp(button, pointer, isOver) { if (isOver) { if (button.data.lastClickTime === null) { button.data.lastClickTime = this.game.time.now; } else if (this.game.time.now - button.data.lastClickTime < 300) { //300 meaning tapping twice within 300 milliseconds console.log('DOUBLE CLICK!'); } return; } button.data.lastClickTime = null; } jbut = this.add.button(750, 550, 'jumpbut', jump, this); jbut.fixedToCamera = true; jbut.data.lastClickTime = null; jbut.events.onInputup.add(onInputUp, this); EDIT) I feel like I've misunderstood where this is at now... you need to know how to have an anywhere tap events that are not called when you tap a button. What you could do in that case is setup your buttons onInputDown to set a flag saying it was a button then in your onTap check and reset that flag (again, untested...)? var buttonWasPressed = false; function onTap(pointer, doubleTap) { if (buttonWasPressed) { buttonWasPressed = false; return; } .... } function onInputDown(button, pointer, isOver) { if (isOver) { buttonWasPressed = true; } } jbut.events.onInputDown.add(onInputDown, this);