• Content Count

  • Joined

  • Last visited

About KevinnFtw

  • Rank
    Advanced Member

Recent Profile Visitors

747 profile views
  1. KevinnFtw

    Sprite.tint semi transparent color?

    Edit: Nevermind, was being stupid... because it already multiplies the color I should just use more transparent color codes.
  2. KevinnFtw

    CocoonJS Javascript Exception (Tag: 'load')

    As far as I know my game itself is not using any xml, but I will look into it. Thanks!
  3. 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?
  4. KevinnFtw

    Short way to removeAll() from state before switch?

    So you do like: sprite.destroy(); player.destroy(); enemy.destroy(); Do you destroy every element seperately?
  5. KevinnFtw

    Short way to removeAll() from state before switch?

    Wait, isn't that what is supposed to do? Doesn't that function destroy every element of the stage world?
  6. KevinnFtw

    Short way to removeAll() from state before switch?

    Thanks for your reply Loopeex :-) I've tried: shutdown: function() {;}But that doesn't make any difference unfortunately
  7. 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 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
  8. KevinnFtw

    Phaser Functions with parameters in state issue

    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 :-)
  9. KevinnFtw

    Phaser Functions with parameters in state issue

    I've uploaded the Game.js here: The problem is occuring at the createBullet() and createPlayer() functions.
  10. KevinnFtw

    Phaser Functions with parameters in state issue

    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);});
  11. KevinnFtw

    Phaser Functions with parameters in state issue

    Yeah I know that, but most of my functions need one or more parameters. How should I handle them?
  12. 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
  13. KevinnFtw

    Phaser one-sided overlap detection?

    That's a great solution as only one of them is moving at a time. Thanks!
  14. KevinnFtw

    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
  15. KevinnFtw

    Bringing text to front

    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.