• Content Count

  • Joined

  • Last visited

About killer_manatee

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. You were totally right about the first solution. The problem was that I forgot to change var bootState = require('./boot'); to import bootState from './boot'; Thanks!
  2. Hi, I tried that but I'm still getting the same exact error
  3. Hello. I'm trying to refactor my code into multiple files and create various stages. Here's how I do it: // game.js var bootState = require('./boot'); var loadState = require('./load'); var mygame = new Phaser.Game(800, 600, Phaser.AUTO); mygame.state.add('boot', bootState); mygame.state.start('boot'); export {mygame}; //boot.js import { mygame } from './game.js'; var bootState = { create() { mygame.physics.startSystem(Phaser.Physics.ARCADE); } }; export {bootState}; I've also tried changing boot.js to import { mygame } from './game.js'; var bootState = { create: function() { mygame.physics.startSystem(Phaser.Physics.ARCADE); mygame.state.start('load'); } }; export {bootState}; but that doesn't work either. I'm getting 'Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render'. Thanks
  4. Hi all, Brand new to phaser. When I do: katamari = game.add.sprite(32, - 150, 'katamari'); it works great, but when I refactor to make my code prettier/more object oriented: function Unit(game, x, y, spriteName) {, game, x, y, 'units', spriteName); // base unit stuff goes here } Unit.prototype = Object.create(Phaser.Sprite.prototype); Unit.prototype.constructor = Unit; ... katamari = new Unit(game, 32, - 150, 'katamari'); game.add.existing(katamari); The sprite image fails to load. I am preloading the image correctly because it works in the first case. I have no idea why this is happening. Thanks Edit: Realized issue in constructor, would delete if forum allowed
  5. Hi all, Brand new to Phaser. I'm making a katamari fan game, and so far i have the character and the ball, but I want the prince character to be on the left side of the ball when moving right and on the right side while moving left. Is there a way to tell a sprite group to be a mirror image of itself only when moving to the right? Thanks