pctroll

Members
  • Content count

    5
  • Joined

  • Last visited

About pctroll

  • Rank
    Newbie

Contact Methods

  • Website URL
    http://jorge.palacios.co
  • Twitter
    pctroll

Profile Information

  • Gender
    Male
  • Location
    Caracas, Venezuela
  1. Hello everyone, I'm developing an AI-focused book for Phaser similar to this one, but a shorter (more like a Handbook, instead). However, some of the techniques and patterns that Phaser makes me use have given me the idea of probably expanding and improving these ideas and convert them into a Plug-in, or work directly on the Phaser repository in order to have a basic AI module similar to arcade physics in terms of scope (keep things really simple, yet functional and friendly to developers). Would you be interested in supporting this work via IndieGoGo? If so, would you rather have the book, the component, both? I was thinking in working on the Phaser AI module as a stretch goal from the book, so later the whole community can benefit from it. Looking forward to hearing from you.
  2. tween yoyo not working

    The solution is to add the tween receiving the object's reference and then start the tween any time you want // take a look at the autoStart = false parametervar myTween = this.game.add.tween(this.player.scale).to({x : 2.0, y : 2.0},300,Phaser.Easing.Linear.None,false,0,1,true);myTween.start();
  3. Changing game size to fit page

    In case some of the other code doesn't work out as expected, I'm attaching something great and simple for Phaser 2.0.3 (by the time I'm writing this reply) at http://gamemechanicexplorer.com/ which is using Twitter's Bootstrap (what I also want to use). function windowResize() { // some other non-relevant code for our cause (I think) // ... if (game) { game.scale.maxWidth = _EXAMPLEWIDTH; game.scale.maxHeight = _EXAMPLEHEIGHT; game.scale.setShowAll(); game.scale.refresh(); }}
  4. Those numbers are just awesome. As a matter of fact, I'm glad I started playing with Enchant.js last year for a gig. Even when I'm developing games in Unity "9-5", I still work as a freelancer and having adopted html5 game development fast, taking advantage of my web-dev experience, has given me job opportunities some other friends aren't able to take.
  5. Changing game size to fit page

    I've tried my best to work this out but it doesn't seem to work for me. What am I doing wrong? My idea is to integrate it with a flexible-width Twitter's Bootstrap site. This is based on the HelloPhaser example (using Phaser 2.0.3). <!doctype html><html> <head> <meta charset="UTF-8" /> <title>hello phaser!</title> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script src="phaser.min.js"></script> <script type="text/javascript"> window.onload = function() { function resizeGame (game) { if (game == null) return; var width = $(window).width(); var height = $(window).height(); game.width = width; game.height = height; game.stage.bounds.width = width; game.stage.bounds.height = height; game.world.setBounds(0, 0, width, height); game.camera.setSize(width, height); game.camera.setBoundsToWorld(); if (game.renderType === Phaser.WEBGL) { game.renderer.resize(width, height); } } function preload () { game.load.image('logo', 'phaser.png'); } function create () { var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'logo'); logo.anchor.setTo(0.5, 0.5); } var width = $(window).width(); var height = $(window).height(); var game = new Phaser.Game(width, height, Phaser.AUTO, 'phasercanvas', { preload: preload, create: create }); $(window).resize(function () { resizeGame(game); }); }; </script> <style> body { margin: 0; padding: 0; } </style> </head> <body> <div id="phaserwrapper"> <div id="phasercanvas"></div> </div> </body></html>