Jump to content

Tom Atom

Members
  • Content Count

    594
  • Joined

  • Last visited

  • Days Won

    6

Tom Atom last won the day on December 28 2019

Tom Atom had the most liked content!

About Tom Atom

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    https://twitter.com/SBC_Games
  • Twitter
    SBC_Games

Profile Information

  • Gender
    Male

Recent Profile Visitors

5487 profile views
  1. Dots & Boxes is web version of classic pencil and paper game for two players (https://en.wikipedia.org/wiki/Dots_and_Boxes). You can play either against your friend or against computer AI. Rules are simple: connect dots with lines to form boxes. Player closing up box gets extra move. Game was created for Coolmath Games. You can play it here.
  2. setting preserveDrawingBuffer to true works, but it has impact on performance on some devices - see this thread: It looks like flickering is related to specifis GPUs. So, you can make test for GPU in your game and set preserveDrawingBuffer accordingly. This is snippet from one of our games: public static getRenderer(): number { let badGPUList = [ /.*Mali.400.*/i, /.*Mali.450.*/i, /.*Mediatek.MT6582.*/i ]; // from:https://gist.github.com/cvan/042b2448fcecefafbb6a91469484cdf8 let
  3. @farhan selling / publishing is not covered in book. In fact, implementing sponsor APIs is usually very easy (despite the fact, every sponsor has different API). The hard part is to find sponsor interested in publishing your game and it is about writing emails... Also publishing on Google Play or Apple Appstore is easy - I used Cordova for this for some of our games and for ads I used Heyzap mediation (mediation between Heyzap, Chartboost, AdMob, Unity Ads). While sponsor implementation is easy, hard part is to keep single codebase for many different sponsors. I am writing small series ab
  4. In Phaser Newsletter 123 was announced new type of GameObject - DOM Element. Here are some exmaples here: http://labs.phaser.io/index.html?dir=game objects/dom element/ ,but it currently is not working with Phaser 3.12-beta 3 (there is quite fresh remark on GitHub, that "DOM Elements moved behind experimental flag for now"). Before that I tried wild things, like displaying rotating YouTube iframed video inside Phaser Game and it worked 🙂
  5. @Fractal Games look here: There is how to add tinto to BitmapText. If you take some additional work, you can try to replicate Phaser 2 behavior into Phaser 3.
  6. @Ahmed Khalifa Unfortunatelly, I also needed tint for BitmapText. Not beacuse I like it, but because sponsors still want to support old devices and for some of them, running in canvas is only solution. Finally, I wrote article on how to add this functionality to Phaser 3: http://sbcgames.io/phaser-3-adjust-bitmaptext-to-support-tint-in-canvas-rendering-mode/ It works for static BitmapText, but will not for DynamicBitmapText. Whole magic behind tint in Phaser 2 / PIXI is, that it creates small canvas for tinted sprite and renders tinted version into it. It rerenders it when sprite frame changes
  7. @pingu it is ok in this case, because that part of update is called only once. Why not call it in the end of create()? Because there still may be music/sound decoding process ongoing. During update you are regularly checking if audio is ready and then, before you change state to Manu/Play or whatever "real" game state, you start FB too. So, when real game is entered, everything is ready. (Of course, there is possibility to do it in create and set some flag. Then in update check if sounds are ready and FB game started too - this will run in parallel instead one after each other as in my ca
  8. Your solution is OK, but you should generalize it like this: if (player.x - enemy.x > 0) { enemy.scale.x = 1; } else { enemy.scale.x = -1; } ... so you are not dependent on fixed (340) position of enemy.
  9. @pingu - for load progress, see this Phaser 3 example: http://labs.phaser.io/edit.html?src=src/loader/loader%20events/load%20progress.js it is now about events, - regarding FB IG: I am using first this: // ------------------------------------------------------------------------- window.onload = () => { if (App.Global.FBINSTANT) { // check if FB Instant is present if (FBInstant == null) { App.Global.FBINSTANT = false; startGame(); return; } // FB Instant console.log("FB initializeAsync called");
  10. You have to send loading progress to FB from your game - create & use loadUpdate(). Do not set it to 100 in preload(). In preload() you only prepare list of assets for loading - it is not actual loading. Actual loading is started by Phaser when preload() exits. loadUpdate() { if (App.Global.FBINSTANT) { console.log("FB setLoadingProgress called " + this.load.progress); FBInstant.setLoadingProgress(this.load.progress); } }
  11. Try this: if (cursors.up.isDown) { //this.physics.velocityFromRotation(ship.rotation, 600, ship.body.acceleration); ship.setVelocity(Math.cos(ship.rotation) * 600, Math.sin(ship.rotation) * 600); // 1 } else { ship.setAcceleration(0); ship.setVelocity(0,0); // 2 } In physics, you use acceleration to calculate new velocity and velocity to get new position. If you are driving car and accelerating for some time, your velocity increases. When you yake the foot out of the gas, your acceleration is 0, it does not increase velocit
  12. No, there is no such time - your game is running in single thread and you are in risk, that browser will say your game is not responsive. If you do not want to split your long running task into smaller steps, then you have to use Web Workers as @stupot suggested - it will start separate thread. Look at here: https://www.w3schools.com/htmL/html5_webworkers.asp Unfortunatelly, Web Workers are not supported in old browsers (not a big problem), you have to have its task in separate file and you have to take care of communication between your game and Worker - postMessage / onmessage.
  13. I was just solving this recently - AI thinking / computer generating in 2 games. for computer generating I had long time running loop. I changed it, that I record some variables, that allow me to re-enter method and continue where it ended last time. Then in my update() method I am calling it as long as it is generating. Something like bellow. Every frame I do as many steps as time "lastDelta * 0.9" allows me. Making only one step per frame would be bad - if you needed 10000 steps then it would take 166 seconds with 60 FPS: private _computerIsGenerating: boolean;
  14. Hi, you can load assets outside preload method. Look at this example: http://labs.phaser.io/edit.html?src=src\loader\loader%20events\start%20loader%20manually.js
  15. Hi, do you mean this: https://github.com/SBCGames/Spriter-Player-for-Phaser? If yes, I was about to make Phaser 3 version with some changes (like removing support for special binary format, that no one uses). But I decided to wait some time, as there is still lot of changes in engine with every new release.
×
×
  • Create New...