faboon

Members
  • Content Count

    17
  • Joined

  • Last visited

Posts posted by faboon


  1. I'm using this to stop keys controlling the scrolling of the browser but it's not working:

    this.game.input.keyboard.addKeyCapture([
        Phaser.Keyboard.UP,
        Phaser.Keyboard.DOWN,
        Phaser.Keyboard.LEFT,
        Phaser.Keyboard.RIGHT,
        Phaser.Keyboard.SPACEBAR,
    ]);

    I'm using this input like this if it makes a difference:

    if (this.game.input.keyboard.isDown(Phaser.Keyboard.UP)) { direction = Swipe.UP; } else
    if (this.game.input.keyboard.isDown(Phaser.Keyboard.DOWN)) { direction = Swipe.DOWN; } else
    if (this.game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) { direction = Swipe.LEFT; } else
    if (this.game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) { direction = Swipe.RIGHT; }

    What am I doing wrong?


  2. 4 hours ago, rich said:

    Node Webkit or Electron will get your game onto Windows, OS X and Linux with minimal effort. Cordova will get it into a native app for iOS / Android. Anything else (i.e. console) would be out of reach anyway, even if it was C#.

    I need to educate myself more. I thought you could just compile C++/C# to any console. And I thought C# would run faster.

    Cheers for the info.


  3. I know this isn't to do with html5 development but I'm not sure where to start this topic.

    Has anyone tried to port Phaser to C# so they can make desktop games?

    I saw a post about Retyped but that looks like it's designed to compile back to javascript.

    It would be interesting to see if there is a port already as I'm not having much luck with MonoGame on Linux and I'm so comftable with Phaser.

    Are there any reasons why it would not be a good idea. Obviously it would need to use different libraries.


  4. This is how I'm getting an object (Ball) from a tile map and finding a reference of it:

    // Game's create
    map.createFromObjects("objects", 3, "ball", 0, true, false, undefined, Ball);
    
    this.game.world.forEach(element => {
        if(element instanceof Ball) {
            this.ball = element;
        }
    });
    
    // Ball's contructor
    this.game.add.existing(this);

    I've saw the examples and they are getting objects from adding them to a group.

    I only have one Ball and that will be the player so I thought putting it in a group was a bad idea?

    This way I have a class that directly controls the Ball.

    Is there a better way than doing this?


  5. On 22/01/2018 at 3:49 PM, gregmax17 said:

    Nintendo hasn't announced support for HTML5 games, yet.

    In the meantime you could continue developing your game in HTML5, porting it to the Switch sometime later down the road, or just dev it in Unity... :(

    But can't NW.js compile to a desktop app? Nintendo doesn't need to support HTML5 if the game is doing it itself.