Jump to content


  • Content Count

  • Joined

  • Last visited

About issey

  • Rank

Contact Methods

  • Twitter
  1. Hey everyone! Thought I'd share the first game I made. Made this for fun to share with friends, but since a bunch of you guys helped me out with questions in the forum, I thought I'd share it here too and spread some cheer (special thanks to the Phaser community!) It is still a work in progress as I update it by the day, with plenty of bugs here and there. But I thought I'd launch it anyway. I wanted to make an advent calendar type game counting down to Christmas, with fun facts revealed every day. I ended up turning it into a tour of Santa's Factory, to eavesdrop on little elves
  2. Hi everyone! I'm looking to have sprites generated randomly within another sprite's bounds. I've seen examples of bounds used within sprites, like so for example (from this Phaser example): // Our sprite that will act as the drag bounds bounds = game.add.sprite(game.world.centerX, game.world.centerY, 'pic'); // And the sprite we'll drag sprite = game.add.sprite(300, 300, 'atari'); sprite.inputEnabled = true; sprite.input.enableDrag(); sprite.input.boundsSprite = bounds; However, I haven't seen this applied on a group of random sprites? And when I tr
  3. So after some time, I ended up finding the solution... First off, I removed all this.scrollingMap and changed them to scrollingMap to remove any confusion. Ended up still working perfectly. scrollingMap = game.add.image(0, 0, "map"); scrollingMap.anchor.set(0.05,0.5); scrollingMap.inputEnabled = true; [etc...] Next, Groups in Phaser don't seem to be able to have input working on elements together, only one at a time. So changing to something like wouldn't work: scrollingMap = game.add.group(); map = game.add.image(0, 0, "map"); scrollingMap.add(map); // The following
  4. Hey thanks! That's exactly what the issue was. I didn't think of the global variable issue... Works perfectly now!
  5. Hi there! I'm having a little issue with updating my game's score correctly. I set the score to += 10 on each click, but it gets stuck at 10. I also have my score displaying " score: [object Object]10 " instead of "score: 10". It probably has to do with how I added the score to the collectStar function? Here's my code: var game = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.AUTO, '', { preload: preload, create: create, update: update }); function preload() { game.load.image('star', 'assets/images/star.png'); } function create() { //Score var sco
  6. issey

    Destroy on Timer?

    Thanks samme! Works like a charm. And thanks for taking the time to explain, I understand the issue better now. I ended up using game.time.events.add(2000, star.destroy, star); Cheers!
  7. Hi everyone! I need a little help with understanding how to properly set timer functions. I'm new to javascript so I often run into syntax issues. I have a group ("starGroup") containing 10 "star" objects. When a user clicks on one of the group's "star" object, I'm hoping to have it tween before being destroyed. Everything seems to work properly up to the end of the tween, however I am having issues setting star.destroy until after the tween. I read in another post that we could use Phaser's timer for this instance, however my timer functions don't seem to be working. I get a retur
  8. Hi, Yeah, sure. Here's what I have so far: var game = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.AUTO, '', { preload: preload, create: create, update: update }); function preload() { game.load.image('map', 'assets/images/baseMap.png'); game.load.image('star', 'assets/images/star.png'); } function create() { // Creating the group world = game.add.group(); world.create(0, 0, 'map'); // Adding random sprites to it for (var i = 0; i < 10; i++) { world.create(game.world.randomX, game.world.randomY, 'star');} //This gro
  9. Hi everyone! I'm new to Phaser (and HTML5 game development in general) I found this great tutorial on creating draggable maps with inertia: http://www.emanueleferonato.com/2016/01/18/how-to-create-a-html-draggable-and-scrollable-map-with-inertia-using-phaser-framework/ I am trying to apply the dragging effect to a group of sprites (a world map and a bunch of interactive sprites on top) -- so you'd be able to drag around the map and find things to collect. The tutorial has the dragging effect applied on just an image. I managed to create a group with the map and the sprites on t
  • Create New...