FakeWizard

Members
  • Content count

    56
  • Joined

  • Last visited

About FakeWizard

  • Rank
    Advanced Member
  • Birthday 04/07/1985

Profile Information

  • Gender
    Male
  • Location
    Slovakia
  1. Babylonjs Really Laggy.

    hah,this had me chuckle. Like seriously, none of this would cause this , except for the browser. .. But even that shouldn't be the case. Have you checked the playground with different browser? Is it also lagging? If so ,which browser( including version) have you tried? Try checking the processes (Crtl + Alt + Del ) , open Task Manager and see what's consuming the most CPU, RAM .. In case it's your browser then : Disable all the active extensions try to capture the page load using the Dev Tools in the Performance section (Chrome).. once done it should provide you with similar output: as you can see below If possible, share the result with us.
  2. How to encrypt code?

    Your code will always be accessible to the client, neither obsfucating nor uglifying prevents users from altering/tampering with your code. The uglifying in fact, only slows down the process of understanding your code. Therefore instead of spending too much time on encrypting the code on client side, you should work on the backend code to ensure the data form client are accurate.
  3. Problem with loading image

    what can yoiu see in your console? any errors?
  4. Strange Flicker with Mobile Canvas

    same here
  5. disabling multi-select or muti-touch

    have you tried defining this.input.maxPointers = 1; in your game boot state? Ahh never mind..just realised it's not related to Phaser...sigh
  6. Fullscreen is not working in Chrome v56 (Android).

    same here, unable to switch to fullscreen on my Huawei Honor 8, Android version 7.0, Chrome v.57.0.2987.132.
  7. sprite locations and functions

    the js file where you have the function B defined has to be loaded before the other file where you;re using it. /// fileA.js function A (){ game.add.sprite = sprite1(some.x, some.y) B(); } /// fileB.js function B (){ game.add.sprite= sprite2(sprite1.x, sprite1.y); } So in your index.html file you just do <script src="fileB.js"> </script> <srcipt src="fileA.js"> </script>
  8. Shipwrecked

    it's very easy to cheat in this game..you put too much trust on client-side ;] .. Sorry for trolling the players (or AI ).. was able to shoot like 100 bullets at once :] But apart from that it's really nice game, works pretty well :]
  9. create() can't access other class variables?

    It's because you're passing the methods in an object, in such cases these methods will always refer to it's parent object. Which in this case is Phaser.Game. And this.MyColor variable doesn't exist there. let preload = function(){ console.log( this ) //// points to Phaser.Game } var game = new Phaser.Game(1200, 600, Phaser.AUTO, 'content', { preload: preload }) I'd recommend using ES6 way of extending Phaser classes , it's less confusing IMHO. class BootState extends Phaser.State { init(){ this.myColor = Phaser.Color.createColor(255,255,0); } preload(){ this.game.load.image("platform", "star.png"); } create() { console.log(this.myColor); } } class SimpleGame extends Phaser.Game { constructor() { super(1200, 600, Phaser.AUTO, 'content' ); } init(){ this.state.add("boot", BootState ); this.state.start('boot'); } } window.onload = () => { var game = new SimpleGame().init(); };
  10. I know that there is a separate method Sprite.resetFrame() which resets the texture's frame to default. But I just though it may be easier if it was all done implicitly while calling the Sprite.reset() method. So I'd just add another optional parameter to the reset method, and then based on this parameter call or not call the resetFrame method. reset( x: number, y: number, health?: number, resetFrame: boolean ): Phaser.Sprite;
  11. Help with background image

    the code seems ok, can you see any errors in your browser's console? Are you testing this purely in your browser or from a http server?
  12. splitting Game.js into many files

    you have to define the functions (create, update, reload ..) inside thier appropriate js file and load them before the game.js... No need to define the functions in game.js otherwise you'll overwritte them.
  13. Collision box always starting on top-left corner when using classes

    It's pure guess, but I think, it could be cause you're adding an existing instance of object which is currently being initialized. Perhaps changing the order a little bit may help here. class Player extends Phaser.Sprite { constructor(game, x, y) { super(game); this.playerBody = this.addChild( game.add.sprite( x, y, 'atlas1', 'dot' ) ); this.playerBody.anchor.set(0.5); this.inputEnabled = true; this.input.enableDrag(); this.enableBody = true; this.game.physics.enable(this, Phaser.Physics.ARCADE); game.world.add( this ); } } Also not really sure what are you trying to do here.. is the little box your hit box? Also are you sure you want to position this box on the same position as Player? Cause now Player will be placed at 0,0 position and the 'dot' will be spawned at the x,y (pre-defined) coordinates.
  14. Dancing TextField with right align

    I don't see anything dancing there, can you be more specific? Although I've simplified your animation loop by a little bit. https://jsfiddle.net/7dv61c63/3/
  15. Snake, HTML5 snake game with pixi.js

    not sure why but the snake blips every time I press a cursor key. Apart form that game looks good