• Content Count

  • Joined

  • Last visited

Reputation Activity

  1. Like
    KungFuFlames got a reaction from plicatibu in GameConfig   
    Game Config is pretty need, it really helps you to organize your code.
    Back in Phaser 2 when you instantiate Phaser you write something like this:
    let game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render }); First time I saw this I wasn't sure what are these parameters for. And these are just basic parameters that Phaser constructor can accept...Which is not really good quality good overall.
    Now Phaser 3 simplifies this by adding a object, called gameObject. It looks like this:
    let GameConfig = { type: Phaser.CANVAS, width: 800, height: 600, scene: [Boot, Game], backgroundColor: "#dbcf8b", }; The order doesn't matter, some parameters are optional so you don't have to write them all. After setting up everything, just pass the object to contructor
    let game = new Phaser(GameConfig); So back to your question. Just make the object yourself.
  2. Like
    KungFuFlames got a reaction from MVMVasconcelos in Is there ScaleManager in Phaser 3   
    That's an alternative too. But I don't think CSS should handle entiry scaling of the game. For example your code won't make canvas to 'fit' into page body. Which is not a problem but most of the mobile games probably will try to cover the fullscreen of the divice. Although, this is easy to fix just by adding couple lines into CSS, from my experience so far I found that Sprites are losing quality with CSS methods. So JS is fine right now, but not really sure if this is good performance wise.
    this.events.on('resize', resize, this); function resize (width, height) { if (width === undefined) { width = this.sys.game.config.width; } if (height === undefined) { height = this.sys.game.config.height; } this.cameras.resize(width, height); this.bg.setSize(width, height); this.logo.setPosition(width / 2, height / 2); } Basicly the event will trigger on resize, then going to calculate 'things' based on new canvas size and will setup new size and position(or whatever) for Spirte.
    This whole process doesn't look very efficient for me.
    If you have any ideas how I can optimize it, I will be glad to hear your suggestions.
  3. Thanks
    KungFuFlames reacted to Antriel in HexSweep.io   
    Multiplayer online hexagonal minesweeper.
    Fight against other players, claim your area and steal theirs in a massive world.
    Reach the top of the leaderboard by having big score. Claim as much of the world as you can for yourself in this puzzle iogame.
    Play the game here: http://hexsweep.io

    Developed entirely in Haxe, using pixi.js for rendering, nodeJS with uws for server.
    Feel free to ask me anything
  4. Like
    KungFuFlames reacted to Antriel in ScaleManager.SHOW_ALL   
    I'm using code from that example (game and cameras resize) + some basic css.
    It could be part of Phaser, but honestly that's all I will ever need. If you want proper responsive game, you have to implement it yourself anyway.

    This is my custom ScaleManager's initialize method that I call after I create the Game instance (Haxe code).
    public static function initialize(game:Dynamic):Void { function resize() { var w = js.Browser.window.innerWidth; var h = js.Browser.window.innerHeight; var scale = Math.min(w / Config.DEFAULT_WIDTH, h / Config.DEFAULT_HEIGHT); game.canvas.setAttribute('style', ' -ms-transform: scale(' + scale + '); -webkit-transform: scale3d(' + scale + ', 1);' + ' -moz-transform: scale(' + scale + '); -o-transform: scale(' + scale + '); transform: scale(' + scale + ');' + ' transform-origin: top left;' ); width = w / scale; height = h / scale; game.resize(width, height); game.scene.scenes.forEach(function (scene) { scene.cameras.main.setViewport(0, 0, width, height); }); } js.Browser.window.addEventListener('resize', resize); if(game.isBooted) resize(); else game.events.once('boot', resize); }  
  5. Like
    KungFuFlames reacted to Antriel in Tap Tap Plane   
    Test your tapping and timing skills in this fun game.
    Traditional flappy gameplay, tap to stay afloat! Avoid obstacles and get as far as you can.
    Unlock five different secrets, each funnier than the previous one.
    Can you unlock them all?

    Play the game here: http://nextrealmgames.com/games/tap-tap-plane/
    Developed in Haxe, using phaser v3
    You can put the game on your portal using this url. The game is also available for licensing.
  6. Thanks
    KungFuFlames reacted to Raicuparta in Phaser games on Steam   
    I am making a guide to help people get their Phaser (or any HTML5 game, really) game on Steam:
    Getting a Phaser Game on Steam 1 - Greenlight Getting a Phaser Game on Steam 2 - Making it Look and Feel Like a PC Game Getting a Phaser Game on Steam 3 - Making an Executable Getting A Phaser Game on Steam 4 - Steamworks Original:
    My game Curvatron is now on Steam Greenlight (link here). I looked it up but couldn't find any other Phaser games on Steam, doe you guys know of any?
  7. Like
    KungFuFlames reacted to rich in What would you recomend to replace Signals?   
    I just found it amusing that the original post was asking what to use instead of Signals in v3 (the answer is, of course, Events), and then gave an example of something a Signal couldn't ever do anyway.
    The biggest issue is that web devs lead almost exclusively asynchronous development lives. The overwhelming majority of your code and practices are honed around this, and there are so many libs out there to help with it. Which makes perfect sense, it's how the web itself works after all. Look at Promises, created specifically as a proxy to an as-yet-unknown value. A very common occurrence in web apps.
    In a game, this is almost never the case though. Very rarely do you ever have to wait for the value, it is nearly always calculated instantly (or should be) or available elsewhere in memory. So introducing an artificial async jump into this value fetch is a really backward step. It's the same with data streams too. Unless you are genuinely fetching remote data all you've actually managed to do is add overhead to a situation that didn't need it.
    The absolute shortest possible path for your data is the best. Retrieved in the fewest jumps possible, with minimal or no branching, invocations or creation of un-necessary objects (which includes anonymous functions, those wonderful little bundles of gc bait). This goes against everything that is standard for a web app. But you're not building a web app.
  8. Thanks
    KungFuFlames reacted to theNeedle in How to detect click on element in Array without looping?   
    Great. Using Node(Express) as MVC? It looks like a lot of work. keep it up. 👍