KungFuFlames

Members
  • Content Count

    22
  • Joined

  • Last visited


Reputation Activity

  1. 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.
  2. 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
  3. 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); }  
  4. 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.
  5. Thanks
    KungFuFlames reacted to Raicuparta in Phaser games on Steam   
    Update:
    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?
  6. 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.
  7. 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. 👍