
KevinnFtw
Members-
Content Count
52 -
Joined
-
Last visited
About KevinnFtw
-
Rank
Advanced Member
Recent Profile Visitors
1086 profile views
-
-
-
-
-
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?
-
So you do like: sprite.destroy(); player.destroy(); enemy.destroy(); Do you destroy every element seperately?
-
Wait, isn't that what this.world.removeAll() is supposed to do? Doesn't that function destroy every element of the stage world?
-
Thanks for your reply Loopeex :-) I've tried: shutdown: function() { this.world.removeAll(true);}But that doesn't make any difference unfortunately
-
-
-
Hey guys, I'm having some issues switching between states. In the first run it all works fine, but then when I come back to a state I've already been at, like MainMenu, the design is all messed up. I think it is because not all sprites and stuff are removed when I switch states, that's why I added a this.world.removeAll() in my shutdown function. However that doesn't seem to do anything. Is there another short way to delete everything (except cache) from a state before switching to another state, or does it have to be done manually? I've attached 2 images, one of my MainMenu first time, and one of the MainMenu when I switch back to it (after the Game). Excuse me if it is a silly question, I've just recently started using states.. Thanks, Kevin
-
-
-
Ahh, i was thinking about the 'this' reference, but didn't know what to replace it with. Edit: Awesome, it is working now! Thanks alot Rich and Lewster32 :-)
-
I've uploaded the Game.js here: http://jsbin.com/senarewe/1 The problem is occuring at the createBullet() and createPlayer() functions.
-
I get that, but some of my functions need to have a couple of variables to work. Normally, when I want to execute a certain function with parameters I would just call: function(a); I know that at states you have to use this.function if the function is inside of the game. So then I would call this.function(a) However when I do that I get the error Uncaught typeError: undefined is not a function The function(a) does exist. Edit:It might be that the context I'm using the function in is wrong, and not the function itself. I'm using it within a socket.on like: socket.on('newBullet', function(data) { this.function(data);});
-
Yeah I know that, but most of my functions need one or more parameters. How should I handle them?
-
Hi guys, Maybe a silly question, but I recently started using States in my game and now I am converting my functions to work with states. The functions without parameters work fine, but the ones with parameters don't. For example, when I call: this.createBullet(x, y); I get the error: Uncaught typeError: undefined is not a function. The function createBullet(x, y) does exist, it is created like this: createBullet: function(x, y) { // blablabla content of function } p.s. these functions are in my Game.js state Can anyone tell me what I'm doing wrong? It has to be a silly mistake but I don't know how to fix it Thanks, Kevin
-
-
-
-
KevinnFtw started following Phaser one-sided overlap detection?
-
Hi guys, At the moment I'm having some issues detecting which sprite is overlapping another sprite. The overlap function works fine, but I would like to know which of the 2 sprites goes over the other sprite. I only want to execute a certain function if sprite A walks over sprite B, and not if sprite B walks over sprite A. Is there any way I could check this inside of the overlap function? Thanks, Kevin
-
Hey Rich, I'm using Phaser 2.0.5, but there's no such option to bring text to the front/top. I also couldn't find it in the latest docs. Do I have to put all the text elements in a group and bring that to top or is there any other way? Thanks.