Search the Community

Showing results for tags 'error'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 110 results

  1. Hi, I am creating a game I have such a code in the method "create()": game.scale.fullScreenScaleMode = Phaser.ScaleManager.SHOW_ALL;game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;game.scale.refresh();And I have an eventListener in chat window: if(message != '/fullscreen') { var event = { type: "chatMessage", message: $( this ).val(), channel: activeChat, id: 1, cookie: getCookie(cookiename) }; var str = JSON.stringify(event); console.log(str); ws.send(str); } else { if (game.scale.isFullScreen) { game.scale.stopFullScreen(); } else { game.scale.startFullScreen(false); game.scale.refresh(); } }Everything works fine on localhost:8888 port, but when I change the port on localhost:8000/game there is such an error: @ Phaser.ScaleManager: requestFullscreen failed or device does not support the Fullscreen API @
  2. ekeimaja

    Problem with loading CSV tilemap

    So I am trying to import CSV tilemap to my game, using csv collision sample as help. Now it gives this error. Uncaught TypeError: Cannot read property 'width' of undefined which is pointing to this line. Variable map is defined in beginning map = this.game.add.|tilemap('kentta', 20, 20);Preloading is made in external preload.js file, in preload function like this: this.game.load.tilemap('kentta', 'assets/kentta.csv', null, Phaser.Tilemap.CSV);this.game.load.image('tileset', '/assets/tileset.png');
  3. Hi, and nice to meet you all. I am writing because i was triying to build the mightyeditor from source to test in on windows 8,1 64 bits, The installation goes cool and good so on, but when i open the browser and mark "Create New Account" and complete all the fields, always return "Sign in Failed". It can be a possible issue? Or the login and register module is not include at the source? In any case please would be awesome if you clarify me this. Thanks in advance Chevalsky
  4. Hello! I am just starter and my question may be silly (: I installed WAMPserver and cloned phaser-examples to "home" folder (so I can access it on localhost/phaser-examples). As I understood, I need to run localhost/phaser-examples/examples or localhost/phaser-examples/examples/index.html but neither of it works, and I get "500 Internal Server Error". On the other hand, "hellophaser" works perfectly, and also I am able to load part f page by opening examples/index.html directly. Here are some screenshots to illustrate the problem: 1) http://ipic.su/img/img7/fs/500-internal-error.1424334943.png 2) http://ipic.su/img/img7/fs/failed-to-load.1424334962.png I am running Windows 7 64bit, Firefox 35.0.1, WAMP server. Skype is shut down. Thank you in advance!
  5. I've published an APK as alpha test on Google Play. The testers have no trouble with the opt-in screen or following the link to the store page, but when they click on "Install" they always get some kind of error, such as Error code 941 or RPC:S-2;AEC-2 or problems with the signature. I signed it using -sigalg SHA1withRSA -digestalg SHA1 and that version is online now, but the errors persist. Anyone knows what might be wrong? BTW, the game was created using phaser and cocoonjs.
  6. Hi, I have made a game that works fine and am trying to put some states in. I have set all the code up and I keep getting the 'Uncaught ReferenceError: MYFUNCTION is not defined'. Here is a bit of the code so you get the idea. It's the main game state. If I take out the function being called it calls the same error on the next function. I don't understand why the functions aren't being defined? var theGame = function(game){}theGame.prototype = { create: function(){ }, update: function(){ MYFUNCTION(); }, MYFUNCTION: function(player, coin) { some stuff; }}Any help would be great! Thanks
  7. Hi, I have a huge problem with oimo and ground created with CreateGroundFromHeightMap. Please look at this: http://www.babylonjs-playground.com/#W3NZA Maybe I am doing something terribly wrong? Marius
  8. Hi, this is my first post on here. Anyways I need help trying to solve this problem. I am making a 2D rpg game, and for now I am using a 2D array map on Phaser JS as a place holder for an actual map in the future. I need the map to generate randomly every time. I have tried my code on Phaser version 1.12 and it works. However, when I tried it on the latest version (v2.2.0) of Phaser, it did not work. I keep getting an error saying "Uncaught TypeError: Cannot set property 'content' of undefined". Here is my source code: // font sizevar FONT = 22;//Map's Displayvar mapText;//var Height and Width for the Map's COLS and ROWSvar HEIGHT = 550;var WIDTH = 800;//Key variable set upvar cursors;var spaceKey;//offset for map's positionvar MAP_OFFSET = 2.38;//Game's height and widthvar gameHeight = 600, gameWidth = 800;//Style of textvar style = { font: FONT + "px monospace", fill:"#fff"};// map dimensionsvar ROWS = HEIGHT/FONT;var COLS = WIDTH/FONT/0.61;// number of actors per level, including playervar ACTORS = 10;// the structure of the mapvar map;// the ascii display, as a 2d array of charactersvar asciidisplay;// initialize phaser, call create() once donevar game = new Phaser.Game(gameWidth, gameHeight, Phaser.CANVAS, '', { preload: preload, create: create, update: update});function preload() { game.load.spritesheet('dude', 'assets/dude.png', 32, 48);}function create() { game.physics.startSystem(Phaser.Physics.ARCADE); player = game.add.sprite(32, game.world.height - 150, 'dude'); game.physics.arcade.enable(player); player.body.gravity.y = 1500; player.body.collideWorldBounds = true; player.animations.add('left', [0, 1, 2, 3], 10, true); player.animations.add('right', [5, 6, 7, 8], 10, true); //Subject to change: cursors = game.input.keyboard.createCursorKeys(); spaceKey = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); // initialize map initMap(maze(ROWS, COLS)); // initialize ascii display asciidisplay = []; for (var y=0; y<ROWS; y++) { var newRow = []; asciidisplay.push(newRow); for (var x=0;x<COLS;x++) newRow.push(initCell('', x, y + MAP_OFFSET)); } drawMap();}function update() { player.body.velocity.x = 0; if (cursors.left.isDown) { player.body.velocity.x = -150; player.animations.play('left'); } else if (cursors.right.isDown) { player.body.velocity.x = 150; player.animations.play('right'); } else { //Stand Still player.animations.stop(); player.frame = 4; } if (spaceKey.isDown) { player.body.velocity.y = -550; }}function initCell(chr, x, y) { // add a single cell in a given position to the ascii display game.add.text(FONT*0.6*x, FONT*y, chr, style);}//creating the mapfunction initMap(m) { // create a new random map map = []; for (var j= 0; j<m.x*2+1; j++) { var line= []; if (0 == j%2) for (var k=0; k<m.y*4+1; k++) if (0 == k%4) line[k]= '+'; else if (j>0 && m.verti[j/2-1][Math.floor(k/4)]) line[k]= ' '; else line[k]= '-'; else for (var k=0; k<m.y*4+1; k++) if (0 == k%4) if (k>0 && m.horiz[(j-1)/2][k/4-1]) line[k]= ' '; else line[k]= '|'; else line[k]= ' '; if (0 == j) line[1]= line[2]= line[3]= ' '; if (m.x*2-1 == j) line[4*m.y]= ' '; map.push(line.join('')+'\r\n'); } return map.join('');}function drawMap() { for (var y = 0; y < ROWS; y++) for (var x = 0; x < COLS; x++) asciidisplay[y][x].content = map[y][x];}function maze(x,y) { var n=x*y-1; if (n<0) {alert("illegal maze dimensions");return;} var horiz =[]; for (var j= 0; j<x+1; j++) horiz[j]= [], verti =[]; for (var j= 0; j<y+1; j++) verti[j]= [], here = [Math.floor(Math.random()*x), Math.floor(Math.random()*y)], path = [here], unvisited = []; for (var j = 0; j<x+2; j++) { unvisited[j] = []; for (var k= 0; k<y+1; k++) unvisited[j].push(j>0 && j<x+1 && k>0 && (j != here[0]+1 || k != here[1]+1)); } while (0<n) { var potential = [[here[0]+1, here[1]], [here[0],here[1]+1], [here[0]-1, here[1]], [here[0],here[1]-1]]; var neighbors = []; for (var j = 0; j < 4; j++) if (unvisited[potential[j][0]+1][potential[j][1]+1]) neighbors.push(potential[j]); if (neighbors.length) { n = n-1; next= neighbors[Math.floor(Math.random()*neighbors.length)]; unvisited[next[0]+1][next[1]+1]= false; if (next[0] == here[0]) horiz[next[0]][(next[1]+here[1]-1)/2]= true; else verti[(next[0]+here[0]-1)/2][next[1]]= true; path.push(here = next); } else here = path.pop(); } return {x: x, y: y, horiz: horiz, verti: verti};}That is just the Javascript file. Please tell me if you want my HTML code. Thanks! Links I used for tutorials to code this so far: http://gamedevelopment.tutsplus.com/tutorials/how-to-make-your-first-roguelike--gamedev-13677 (got the map) I also used an algorithm to generate the map details online. Please help and thanks in advance!
  9. pranadevil

    error using groups

    hi buddies, got this code : additem:function() { box_ = this.box.getRandom(); if(!box_){ gameText.setText("now: NULLLLLLLLLLLLL"+box_.name); return; } gameText.setText("now: "+box_.name); box_.anchor.setTo(0.5,0.5); box_.reset(20,740); box_.body.velocity.x = -50; } but when running got the error ;Uncaught TypeError: Cannot read property 'velocity' of null ........................................... line 150 (box_.body.velocity.x = -50;) this.box is a group with several sprites, fullfilled with a for loop. gameText is a text variable in which i got the name of each item, but it nevers shows "NULLLLLLLLLLLL" so what im forgetting? why the box_ variable doesnt has the body.velocity.x ??? thanks in advance
  10. Hi, I'm new in babylon.js (and the others 3d frameworks). A moment ago I exported scene from *.obj to *.babylon. Now I'm trying to load it, but im getting error: My simple code: if (BABYLON.Engine.isSupported()) { var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); BABYLON.SceneLoader.Load("", "/~patrol/objects/maps/city/scene.babylon", engine, function (newScene) { // Wait for textures and shaders to be ready newScene.executeWhenReady(function () { // Attach camera to canvas inputs newScene.activeCamera.attachControl(canvas); // Once the scene is loaded, just register a render loop to render it engine.runRenderLoop(function() { newScene.render(); }); }); }, function (progress) { // To do: give progress feedback to user }); }
  11. Hi guys. Im following this tutorial and at some point i need to to this var device = new Phaser.Device();but running the game on console i got -> Uncaught TypeError: object is not a function on that line Any ideas? Thanks for your help
  12. minifussy

    Blender Export Issues

    Hi, I am attempting to export a blender file using the babylon.js exporter. My mesh contains an armature with incomplete and basic rigging, during my attempts to export the following situations occur: 1. processing complete of skeleton: Armature processing begun of mesh: characterWARNING: Maximum # of influencers exceeded for a vertex, extras ignored^repeated many many times 2. num positions : 65535num normals : 65535num uvs : 131070num uvs2 : 0num colors : 0num indices : 65535num skeletonWeights: 262140num skeletonIndices: 262140WARNING: The following mesh has exceeded the maximum # of vertex elements & will be broken into multiple Babylon meshes: character========= An error was encountered ========= File "C:\Program Files\Blender Foundation\Blender\2.72\scripts\addons\io_export_babylon.py", line 247, in execute mesh = Mesh(object, scene, self.multiMaterials, nextStartFace, forcedParent, nameID) File "C:\Program Files\Blender Foundation\Blender\2.72\scripts\addons\io_export_babylon.py", line 491, in __init__ self.name = object.name + nameIDERROR: Can't convert 'int' object to str implicitly========= end of processing ========= These two errors prevent me from exporting my man into babylon. Any advice as to how to proceed would be greatly appreciated, Thanks Joe
  13. As usual, I will begin with my tilemap: As you can see I added three objects that I want to use in my map as triggers. This is the object layer called Triggers in tiled. I did not change my loading code because I assumed that you don't have to load the object layer: constructor(game: Phaser.Game, key: string, manifest: any) { super(game, key); this.addTilesets(manifest.maze); this.wallLayer = this.createLayer(this.WallsLayer); this.backgroundLayer = this.createLayer(this.BackgroundLayer); this.shadowLayer = this.createLayer(this.ShadowsLayer); this.itemLayer = this.createLayer(this.ItemsLayer); this.objectLayer = this.createLayer(this.ObjectsLayer); this.creatureLayer = this.createLayer(this.CreaturesLayer); this.separateCreaturesFromTilemap(); this.separateItemsFromTilemap(); this.backgroundLayer.resizeWorld(); this.setCollisionBetween(1, 2, true, "Walls"); }And this fails at runtime with the exception: Uncaught TypeError: Cannot read property 'length' of undefined phaser.js:64576 Phaser.TilemapParser.parseTiledJSON phaser.js:64576 Phaser.TilemapParser.parse phaser.js:64260 Phaser.Tilemap phaser.js:61637 Tilemap Tilemap.ts:23 InGame.initializeMap InGame.ts:36InGame.create InGame.ts:26 Phaser.StateManager.loadComplete phaser.js:17993 Phaser.StateManager.preUpdate phaser.js:17753 Phaser.Game.update phaser.js:24518 Phaser.RequestAnimationFrame.updateRAF phaser.js:42978 _onLoopFinally, here is the object layer as it is defined in the .json: { "draworder":"topdown", "height":8, "name":"Triggers", "objects":[ { "height":0, "name":"warp", "properties": { "map":"volcano" }, "rotation":0, "type":"", "visible":true, "width":0, "x":60, "y":12 }, { "height":0, "name":"warp", "properties": { "map":"desert" }, "rotation":0, "type":"", "visible":true, "width":0, "x":276, "y":60 }, { "height":0, "name":"spawn_player", "properties": { }, "rotation":0, "type":"", "visible":true, "width":0, "x":60, "y":36 }], "opacity":1, "type":"objectgroup", "visible":true, "width":12, "x":0, "y":0 }
  14. I'm working on a game and need help with an error (Uncaught TypeError: Cannot set property 'frame' of undefined) that appears when I run code inside a function. Here's the full game code, with the error at line 60: function getRandom(min, max) { return Math.floor((Math.random() * (max - (min - 1))) + min);}var game = new Phaser.Game(480, 360, Phaser.AUTO, '', { preload: preload, create: create, update: update });var colorPosition = [0, 1, 2, 3];function preload() { game.stage.disableVisibilityChange = true; game.stage.backgroundColor = '#393837'; game.load.image('collide', 'assets/collide.png'); game.load.spritesheet('bucket-front', 'assets/bucket-front.png', 112, 82, 4); game.load.spritesheet('square', 'assets/square.png', 20, 20, 4); game.load.image('arrow', 'assets/arrow.png'); game.load.spritesheet('bucket', 'assets/bucket.png', 112, 82, 4);}function create() { collide = game.add.sprite(0, 317, 'collide'); game.physics.enable(collide, Phaser.Physics.ARCADE); arrow = game.add.sprite(175, 230, 'arrow'); for (var x = 0; x < 4; x++) { this['bucket' + x] = game.add.sprite((x * 120) + 4, 278, 'bucket', x) } squares = game.add.group(); function addSquare() { square = squares.create((getRandom(0, 3) * 120 + 50), -20, 'square', getRandom(0, 3)); game.physics.enable(square, Phaser.Physics.ARCADE); square.body.velocity.y=100; } for (var x = 0; x < 4; x++) { this['bucketFront' + x] = game.add.sprite((x * 120) + 4, 278, 'bucket-front', x) } game.time.events.loop(Phaser.Timer.SECOND * 1, addSquare, this);}function update() { if ((game.input.x - 120) > 0 && (game.input.x + 120) <= 480) { arrow.x = ((Math.round((game.input.x - 120) / 120)) * 120) + 55; } function removeSquare(collide, square) { //square.kill(); } game.physics.arcade.overlap(collide, squares, removeSquare, null, this); //if (game.input.activePointer.isDown) { game.input.onDown.add(swap(), this) function swap() { //alert(colorPosition) //alert((arrow.x - 55) / 120 + 1) var swap = colorPosition[(arrow.x - 55) / 120] colorPosition[(arrow.x - 55) / 120] = colorPosition[(arrow.x - 55) / 120 + 1] colorPosition[(arrow.x - 55) / 120 + 1] = swap //alert(colorPosition) this['bucket' + (Math.floor(arrow.x - 55) / 120)].frame = colorPosition[(arrow.x - 55) / 120] //Here's the line the error occurs on this['bucket' + (((arrow.x - 55) / 120) + 1)].frame = colorPosition[((arrow.x - 55) / 120) + 1] this['bucketFront' + (Math.floor(arrow.x - 55) / 120)].frame = colorPosition[(arrow.x - 55) / 120] this['bucketFront' + (((arrow.x - 55) / 120) + 1)].frame = colorPosition[((arrow.x - 55) / 120) + 1] //this['bucketFront' + (arrow.x - 55) / 120].frame = parseInt(colorPosition[(arrow.x - 55) / 120]) //alert(this['bucket' + (((arrow.x - 55) / 120) + 1)].frame) //alert(colorPosition[((arrow.x - 55) / 120) + 1]) }}This is my first attempt to do anything with JavaScript, so please try to be patient.
  15. Hello, I've recently acquired some sprites from Oryx and have attempted to load the sample Tiled file contained within. I'm able to load the assets just fine in my Preloader: loadAssets() { this.load.tilemap("oryx_tilemap", "assets/tilemaps/maps/oryx_test.json", null, Phaser.Tilemap.TILED_JSON); this.load.image("oryx_creatures", "assets/tilemaps/tiles/oryx_creatures.png"); this.load.image("oryx_items", "assets/tilemaps/tiles/oryx_items.png"); this.load.image("oryx_tiles", "assets/tilemaps/tiles/oryx_tiles.png"); this.load.image("oryx_world", "assets/tilemaps/tiles/oryx_world.png"); this.load.image("oryx_world2", "assets/tilemaps/tiles/oryx_world2.png"); } However, as soon as I attempt to "do" anything with the map, it crashes: create() { this.game.stage.backgroundColor = "#ffffff"; this.map = this.game.add.tilemap("oryx_tilemap"); // Error here this.map.addTilesetImage("oryx_world", "oryx_world"); this.map.addTilesetImage("oryx_creatures", "oryx_creatures"); this.map.addTilesetImage("oryx_items", "oryx_items"); this.map.addTilesetImage("oryx_world2", "oryx_world2"); this.layer = this.map.createLayer("background"); this.layer.resizeWorld(); } With the following error message: Uncaught TypeError: Cannot read property '2' of undefined Phaser.TilemapParser.parseTiledJSON Phaser.TilemapParser.parse Phaser.Tilemap Phaser.GameObjectFactory.tilemap InGame.create Phaser.StateManager.loadComplete Phaser.StateManager.preUpdate Phaser.Game.update Phaser.RequestAnimationFrame.updateRAF You can find the entire .json in this pastebin snippet. I'm not aware that I'm messing something up, judging from the tilemap example. What could I be doing wrong? Is the tilemap using any properties that are unsupported by Phaser?
  16. Hi, I just upgraded my game to Phaser 2.1.3. (from v2.0.7) but it force some weird errors... - Especially PIXI is undefined. (I fixed that I load pixi.js to header) - biggest problem is that Pathfinder Plugin stopped working... (https://github.com/appsbu-de/phaser_plugin_pathfinding), maybe it is working but is not loaded it's loaded like this: pathfinder = game.plugins.add(Phaser.Plugin.PathFinderPlugin); Please check my screenshot, I need some advice how to fix this to work on latest version of Phaser
  17. hyude

    [Ask] Error Get phaser.Map

    Hello, I am currently learning how to use phaserJS, I am familiar with game development process, and I create HTML5 games before. Upon trying tutorial from Phaser and HelloPhaser, I tried it out on my localhost (with Apache server ON). It works, but on google chrome, the console shows an error "404 File Not Found" while trying to access phaser.map file. Granted, there is no phaser.map file, and only a single minifed phaser file. What confuses me is, why should it ask for phaser.map? Is the error normal (expected), Please enlighten me? Thank you.
  18. super001

    problem using phaser in meteor

    Hi, I wanted to use phaser in meteor following this guide http://www.html5gamedevs.com/topic/4886-how-to-use-phaser-with-meteor/ but I have a problem. when I create a meteor project and then run "meteor add phaserio" I get this: mrt add phaserio✓ phaserio tag: https://github.com/t...aser.git#v0.0.1 Done installing smart packages Stand back while Meteorite does its thing Done installing smart packages Ok, everything's ready. Here comes Meteor! => Errors while scanning packages: While building package `phaserio`:error: File not found: phaser/build/phaser.js /usr/lib/node_modules/meteorite/lib/command.js:41 throw "Command exited with " + code + "/" + signal; ^Command exited with 1/null can anybody help me, please?
  19. I'm trying to spawn a randomly coloured block and to do so I am using math.random and the console says everything is loading but the assets aren't loading. There are no errors in it but can anyone find an error that might be causing the assets not to load? Parts of the code that's relevant is coloured green. Thanks for any help. My Code: var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update,});var x = Math.floor(Math.random () * 800); // ball spawns in a random placevar y = Math.floor(Math.random() * 600);var text; var colour = Math.random() * 3;function preload() {cursors = game.input.keyboard.createCursorKeys(); //allows keyboard inputthis.game.load.image("block","assets/block.png");this.game.load.image("redBlock","assets/red.png");this.game.load.image("greenBlock","assets/green.png");this.game.load.image("blueBlock","assets/blue.png");} function create() {this.game.physics.startSystem(Phaser.Physics.ARCADE);this.game.scale.pageAlignHorizontally = true; //centers canvasthis.game.scale.pageAlignVertically = true;this.game.scale.refresh(); block = this.game.add.sprite(x,y,"colour"); // x and y are randomy coordinates the ball spawns atthis.game.physics.arcade.enable(block);block.body.velocity.setTo(200,200);block.body.collideWorldBounds = true; block.body.bounce.set(1); player = this.game.add.sprite(10,10,"block");this.game.physics.arcade.enable(player);player.scale.setTo(0.2,0.2);player.body.collideWorldBounds = true;} function update() { player.body.velocity.x = 0;player.body.velocity.y = 0; if(colour < 1){colour = "redBlock";} if(colour < 2){colour = "blueBlock";} if(colour < 3){colour = "greenBlock";} if(cursors.left.isDown){player.body.velocity.x += -200; } if(cursors.right.isDown){player.body.velocity.x += 200;} if(cursors.down.isDown){player.body.velocity.y += 200;} if(cursors.up.isDown){player.body.velocity.y += -200;}}
  20. Im following this tutorial but im changing some of the sprites. So, when the game is running, sporadically this error appears %c %c %c Phaser v2.0.7 | Pixi.js v1.6.1 | WebGL | WebAudio %c %c http://phaser.io %c %c ♥%c♥%c♥ (03:01:25:504) at public_html/js/phaser.js:22011Uncaught TypeError: Cannot read property 'x' of undefined (03:02:20:821 | error, javascript) at Phaser.Sprite.setFrame (public_html/js/phaser.js:31278:33) at Phaser.Animation.play (public_html/js/phaser.js:44089:22) at Phaser.AnimationManager.play (public_html/js/phaser.js:43593:45) at Neon.item.spawnEnemy (public_html/js/Game.js:61:26) at Neon.Game.update (public_html/js/Game.js:43:23) at Phaser.StateManager.update (public_html/js/phaser.js:16546:35) at Phaser.Game.update (public_html/js/phaser.js:22122:24) at Phaser.RequestAnimationFrame.updateRAF (public_html/js/phaser.js:38277:19) at _onLoop (public_html/js/phaser.js:38263:30)> This is update update: function() { this._spawnRate += this.time.elapsed; if (this._spawnRate > 1000) { this._spawnRate = 0; Neon.item.spawnEnemy(this); } this._enemyGroup.forEach(function(enemy) { enemy.angle += enemy.rotateMe; }); if (!Neon._lives) { this.add.sprite((Neon.GAME_WIDTH - 594) / 2, (Neon.GAME_HEIGHT - 271) / 2, 'game-over'); this.game.paused = true; } }This is spawnEnemy spawnEnemy: function(game) { var dropPos = Math.floor(Math.random() * Neon.GAME_WIDTH); var dropOffset = [-27, -36, -38, -48]; var enemyType = Math.floor(Math.random() * 5); var enemy = game.add.sprite(dropPos, dropOffset[enemyType], 'enemy'); enemy.animations.add('anim', [enemyType], 10, true); enemy.animations.play('anim', 10, true); game.physics.enable(enemy, Phaser.Physics.ARCADE); enemy.checkWorldBounds = true; enemy.events.onOutOfBounds.add(this.removeEnemy, this); enemy.anchor.setTo(0.5, 0.5); enemy.rotateMe = (Math.random() * 4) - 2; game._enemyGroup.add(enemy); },And on my Preloader.js i declare my spritesheet like this this.load.spritesheet('enemy', 'img/enemy.png', 50, 50);My spritesheet is 200 x 50 and has 4 different sprites The only thing i tried is to comment the error line on spawnEnemy but if i do that in the game only shows the first sprite. Help is appreciated
  21. Hey all, Just a quick heads up to share an odd solution to a problem that had me tearing my head out for a couple of days, thought it may come in handy for anyone else in the same boat. While working on a game where I was using P2 physics to detect a collision event between 2 physics bodies, I found that whenever the target sprite was rotated further than a certain amount all of my collision events would silently fail. I spent AGES trying different collision methods and none of them worked, when trying to implement a hack-ish workaround that I found on the forums (can't remember where) I realised that my collisions were now working fine, even though the method I was using returned something to the effect of "this doesn't work". Long story short - I found that by resetting a physics body's AABB data after every change in rotation made the collision events work again: //attackingThing.body.onBeginContact.add(reportSomething, this);//function rotateThing() { // thing.rotation += 1; // reportSomething fails unless you do this thing.body.data.updateAABB();}If anyone can enlighten me as to what/why/how this works, that'd be awesome. Phase on, dudes! OFM
  22. Hi guys, Today I'm trying to get my game running in CocoonJS, the game does work perfectly in a normal desktop and mobile browsers, but I'm getting some errors in CocoonJS. The error says: Javascript Exception (Tag: 'load'): Error: Phaser.Loader. Invalid XML given at e.Loader.xmlLoadComplete(js/min/phaser.min.js:12:9823) at XMLHttpRequest.i.xmlURL._xhr.onload (js/min/phaser.min.js:12:7414) It's my first time using CocoonJS so I have no idea where the error is coming from, but it is coming from Phaser.js itself. Any ideas?
  23. ChubbRck

    TypeError: type error in Safari 6?

    Hi all, Another weirdo cross-browser problem I am desperate to fix. A tester running Safari 6.03 (not the most current, but not ancient either), keeps having the game freeze with a strange error: "TypeError: type error" -- it traces back to phaser.min.js line 11 but I'm unable to see what in my code is causing the issue. Is this a known thing? Any advice at all would be appreciated - You guys are the best! Nick
  24. Silom

    Sprite loader error

    Hey guys, I just started with panda.js and have some problems using spine. My code causes a loading error, but as far as I know 'game.addAsset' is preloading, right? I would be glad if someone could help me out, maybe I just cant see it... Error: Uncaught Error: Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: spine/papapino_spine.json My code: game.module( 'panda.animation').require( 'engine.core').body(function() { // Load assets game.addAsset('spine/papapino_spine.json'); game.addAsset('spine/papapino_spritesheet.png'); game.addAsset('spine/papapino_spritesheet.json'); Panda = game.Class.extend({ init: function(x, y) { this.sprite = new PIXI.Spine('spine/papapino_spine.json'); // Loading Error here // ... and so on } )}};