Mike

Members
  • Content Count

    364
  • Joined

  • Last visited

  • Days Won

    3

Reputation Activity

  1. Like
    Mike reacted to ratking in Use FlashDevelop IDE to make Phaser Games with PhaserHaxe   
    Hi, I wrote PhaserHaxe. Just wanted to say that I will make an update (hopefully) as soon as Phaser 1.1.4 is released.
    @Milton: Good idea, will do that soon!
  2. Like
    Mike got a reaction from DWboutin in Get the animation instance from AnimationManager   
    Hmm here what I made...
     
            //_brick.animations.play("brick_die", 10, false, true);  //kill the sprite on animation end         _brick.animations.play("brick_die", 10);  //just play         _brick.events.onAnimationComplete.add(doSomething, this);       function doSomething (sprite) {         //check which animation was finished         console.log(sprite.animations.currentAnim.name);         console.log("Animation " + sprite.animations.currentAnim.name + " ended!");         //sprite.destroy();  //not working         //         sprite.kill(); //working     }  
     
    I'll definitely send you some code for the examples about animation finish callbacks and sprite events since there is such a section in the examples
     
    I'm marking the topic as solved cause it's solved but generally there is still a discussion cause you didn't say what do you think of adding such a feature
     
    sprite.animations.get("animation_name");
     
    and/or a custom callback passed as argument to play();  
  3. Like
    Mike reacted to pato_reilly in Random Maze Generator   
    Hi,
     
    I thought it would be cool to see more maze games so I made an example with Phaser:
     
    http://www.patricko.byethost9.com/testproj/index2.html
     
    It uses the Depth-first search algorithm.  I found numerous examples of its implementation here:
     
    http://rosettacode.org/wiki/Maze_generation#JavaScript
     
    There are several other maze generation algorithms, but 'depth-first' is the most commonly used for games.
     
    I kept the example basic but did implement it with Phaser tiles. I'm pretty sure there is potential to do some cool stuff on top of the maze using the Phaser tiles functionality.
  4. Like
    Mike got a reaction from Heppell08 in [Novice advice] How to create a group outside of the Game prototype?   
    Hey sparksflyupwards I'm happy you found a solution but for the sake of others reading the topic could
    you explain the fix, so instead of deleting this topic it will remain useful for someone else later.
  5. Like
    Mike reacted to CrazySam in Use FlashDevelop IDE to make Phaser Games with PhaserHaxe   
    Just released: https://github.com/ratkingsminion/PhaserHaxe
     
    Haxe allows users to write code in a statically typed language and compile it to other languages (in this case, Javascript). Development with Haxe is very pleasant (especially when using FlashDevelop), and provides auto-completion with type information. PhaserHaxe is a set of typed class bindings for Haxe (similar to typescript definition files).
     
    Checkout source code of a simple demo built with PhaserHaxe: https://github.com/ratkingsminion/PhaserHaxe/blob/master/src/Main.hx
  6. Like
    Mike reacted to XekeDeath in Using a Spritesheet as a texture atlas without a texture atlas data file   
    When you are making particles, you can send an array of frames you want to make the particles from.
    makeParticles = function (keys, frames, quantity, collide, collideWorldBounds) side note: keys can also be an array of loaded images, and a random one will be chosen for each particle.
    //This will give you one emitter with all frames used for particles, so you get a colourful particle explosion or stream...emitter.makeParticles("myparticles", [0,1,2,3]);//This is 4 emitters, each with a different frame, so you can have monochrome explosions...emitter_r.makeParticles("myparticles", [0]);emitter_g.makeParticles("myparticles", [1]);emitter_b.makeParticles("myparticles", [2]);emitter_o.makeParticles("myparticles", [3]); For the group of 4 emitters, you would need to know what frame number each colour is to assign them to the right emitters...
    Alternatively, you could extend the emitter class, give it a few different sprite pools, and when it comes time to shower particles everywhere, pass it a colour and pick sprites from the appropriate pool.
  7. Like
    Mike reacted to Cameron Foale in Spine support   
    Spine support is unchanged in Pixi 1.4.
    However, I've got basic Spine stuff happening in Phaser now.
    CAVEATS:
    - This builds on PIXI's existing support, which is not 100% accurate, and is particularly bad in WebGL.
    - It also spends a bunch of time in the Spine JS calculating bone matrices etc, and then discards them and uses the PIXI transforms per bone
    - It requires you to have access to the PIXI object, so doesn't work with minified Phaser (unless you do a custom minified Phaser)
    - flipX and flipY are broken, but you can scale the PIXI Spine object by -1, -1
    - It's a total hackjob
    Here's how I went about it:
    - Create your own PhaserSpine.js (don't use the Pixi Spine.js)
    - Dump the current Spine JS runtime into it
    - Follow it with the current Pixi-exclusive part. This might need tweaking but I didn't do much, let me know if it doesn't work.
    THEN, add the Phaser special sauce:

    // A Spine atlas that uses Phaser texture atlases.Phaser.SpineAtlas = function(game, key){ this.cache = game.cache; this.key = key; this.regionCache = {};};Phaser.SpineAtlas.prototype = { findRegion: function (name) { if(this.regionCache.hasOwnProperty(name)) { return this.regionCache[name]; } var image = this.cache.getImage(this.key); if(!image) { console.log('No image available for key: ' + this.key); this.regionCache[name] = null; return null; } var page = {width: image.width, height: image.height }; var frame = this.cache.getFrameByName(this.key, name); if(!frame) { console.log('No frame found for name: ' + name + ', with image key: ' + this.key); this.regionCache[name] = null; return null; } // build the kind of region that Spine expects region = this.regionCache[name] = new spine.AtlasRegion(); region.name = frame.name; region.x = frame.x; region.y = frame.y; region.width = frame.width; region.height = frame.height; region.u = region.x / page.width; region.v = region.y / page.height; region.u2 = (region.x + region.width) / page.width; region.v2 = (region.y + region.height) / page.height; region.originalWidth = frame.sourceSizeW; region.originalHeight = frame.sourceSizeH; region.offsetX = frame.spriteSourceSizeX; region.offsetY = frame.spriteSourceSizeY; // add a reference back region.frame = frame; // And the texture. This is used by PIXI.SpineSprite region.texture = PIXI.Texture.fromFrame(frame.uuid); return region; }};Here's how you load and use it:
    // Assuming your texture atlas is already loaded and called 'character'.// and your Spine data is loaded using game.load.text() and called 'character_animation'// A Phaser object to hold the PIXI onethis.character = this.add.sprite(this.game.width / 4, this.game.height - 200, null);this.character.body.setSize(50, 150)// Parse the JSON spine datavar spineKey = 'character_animation';var spineAtlas = new Phaser.SpineAtlas(this.game, 'character');var spineJsonParser = new spine.SkeletonJson(new spine.AtlasAttachmentLoader(spineAtlas));var skeletonData = spineJsonParser.readSkeletonData(JSON.parse(this.cache.getText(spineKey)));// Cheat the loading so it works. Note that this doesn't work with the minified Phaser js, as PIXI isn't exposed.PIXI.AnimCache[spineKey] = skeletonData;var theSpine = new PIXI.Spine(spineKey);theSpine.position.y = this.character.body.height;theSpine.position.x = this.character.body.width / 2;// Start up some animationstheSpine.state.setAnimationByName(0, 'run', true);theSpine.stateData.setMixByName('idle', 'run', 0.1);theSpine.stateData.setMixByName('run', 'idle', 0.1);// Add the spine PIXI object to the Phaser one, so you get physics.this.character.addChild(theSpine);// And store a reference back to the spine object so you can tweak it later.this.character.spine = theSpine;
  8. Like
    Mike reacted to jcs in TileSprite Bug or Noob Mistake?   
    most likely your texture (tilesprite image) needs to be have power-of-two dimensions. this is an artefact of WebGL and the underlying technology that it uses (OpenGL, 3d GPU hardware).
  9. Like
    Mike reacted to jcs in Rotation using starstruck example   
    yes, much clearer, thanks.
     
    to support sloped tiles you'll need to override the tile separation mechanics in ArcadePhysics.js. (in other words, Phaser doesn't currently support sloped tiles). if you search the forum you'll find several discussions about sloped tiles. (keep in mind though that Phaser 1.1.4 is due out "any day now" and the tilemap system is completely re-written, so some of what you read may not apply).
     
    FWIW 45 degree slopes are pretty simple to implement for basic collision/separation, as the x and y values are related 1:1 (e.g. as x goes up/down 1 pixel so does y). other angles (22.5 etc) are equally simple, but arbitrary angles are more complicated (and thus slower to compute). search the web for articles on "separating axis theorem" ("SAT") collision detection for more information.
     
    getting all the physics interactions (bounce, gravity) to work properly with the sloped tiles is also considerably more work. I implemented 45 degree slopes in 1.1.3 without too much trouble, but never bothered to get the bounce and gravity right.
  10. Like
    Mike reacted to NotionGames in How do you create your visuals?   
    I create mine in a pretty tedious manner. 
    I draw everything by hand with pencil and paper. Then I ink over the lines with inking pens.
     

     

     

     
    After that, I scan it and open inside Photoshop and color it up. Once done with the coloring, I edit, resize, and import into Construct (or whatever game engine).
     

     
    Et Voila!
     

  11. Like
    Mike reacted to Arlefreak in player position when world is taller than screen   
    The dev's comment on this forum constantly, but you should add the issue over github any way  
  12. Like
    Mike got a reaction from Arlefreak in player position when world is taller than screen   
    Yep they look, but from experience I know that's cool to make a github issue since they can mark it as fixed later.
  13. Like
    Mike reacted to Mat Groves in Pixi.js v1.4.2 Out and ready to go!   
    Hello html5game dev forum people!
     
    Big news over in the pixi camp! We have just released the latest and greatest version of pixi.js for you to play with and make more cool stuff!
     

     
    Lots more detail can be found on our goodboy blog. But heres the list of new stuff  / tweaks included in the latest version:
     
    New features:
     
    WebGL Filters Added Sprite Tinting (canvas and webGL) Added Sprite blend modes (canvas and webGL) Added webGL context loss handling New webGL renderer Restructured the canvas renderer Added ability to have multiple renderers on one web page Added support for trimmed sprite sheets Add a Contributing Guide Add an Atlas Spritesheet loader (#444, @MKelm) Implement swapChildren (#431, @namuol) Add base64 support to asset loader (#414, @mattdesl) Add totalFrames to PIXI.MovieClip (#315, @MikkoH) Add uniform sprite sheet loader (#311, @alaa-eddine) Make Interactive dom element configurable (#321, @MikkoH) Add AMD export (#267) Implement travis-ci and jshint integration (thanks @drkibitz) webGL renderer is now fully compatible with IE11 Fully compatible with Cocoon.js (@ekelokorpi) Fixed issue where PIXI.TilingSprite required a power of two texture. It now accepts any texture. Added new tint example Added new blendMode example Added cacheAsBitmap to PIXI.Graphics object. Useful for complex graphics objects. Also a great way to guarantee antialiasing on graphics objects in webGL as it renders using canvas Added generateTexture to PIXI.Graphics object. This function returns a PIXI.Texture of the graphics object. Useful if the graphics objects as is used multiple times Added AlphaMaskFilter  
    Bug Fixes
     
    Fix issue where urls have http in the resource (#443, @sirflo) Fix IE11 check (#442, @photonstorm) Fix issues where nested Masking was not working correctly in webGL Fix cursor style for interactive sprites (#347, @lain-dono) Fix issues with texture destroy (#415, @mattdesl) Fix incorrect BitmapText width (#425, @jcd-as) Fix issue with query params on asset loader (#400, @hugeen) Fix transparent background on objects (#286, @mdoch) Fix problems with event emitter (#187, @johnste) Fix handling of black colors (#288) Fix an issue with empty masks (#313) Fix detector code (#358, @mattdesl) Fix issues with IE ajax Fix misc bugs with PIXI.Graphics Fix issue with removing children with filters Fix a bunch of documentation errors Fix setText to be on proper prototype (#330) Redundant code removed from SpineLoader and SpriteSheetLoader (@Nibbler999) Big thanks to everyone who contributed to this pixi release! We all hope you enjoy using pixi.js 1.4
     
    https://github.com/GoodBoyDigital/pixi.js
  14. Like
    Mike got a reaction from Ryuuke in How to dynamically resize the game and sprites depending on the resolution of the mobile device   
    Short answer is, yes.
     
    Long one:
     
    You must use Phaser scale methods, and also: Phaser.Device - see Rich post http://www.html5gamedevs.com/topic/2990-a-framework-approach-to-multi-screen-full-screen-development/?hl=device
     
    And check this topics since there is my answer to the game scaling thing:
     
    http://www.html5gamedevs.com/topic/1941-scale-to-fit-the-screen/?hl=%2Bscale+%2Bdisplay#entry13298
     
    And check the search for adddtiional info cases about: display, game , scale:
     
    http://www.html5gamedevs.com/index.php?app=core&module=search&do=search&fromMainBar=1
  15. Like
    Mike got a reaction from jerome in How to dynamically resize the game and sprites depending on the resolution of the mobile device   
    Short answer is, yes.
     
    Long one:
     
    You must use Phaser scale methods, and also: Phaser.Device - see Rich post http://www.html5gamedevs.com/topic/2990-a-framework-approach-to-multi-screen-full-screen-development/?hl=device
     
    And check this topics since there is my answer to the game scaling thing:
     
    http://www.html5gamedevs.com/topic/1941-scale-to-fit-the-screen/?hl=%2Bscale+%2Bdisplay#entry13298
     
    And check the search for adddtiional info cases about: display, game , scale:
     
    http://www.html5gamedevs.com/index.php?app=core&module=search&do=search&fromMainBar=1
  16. Like
    Mike got a reaction from Arlefreak in [Phaser] I'm making one new html5 game per week   
    Not sure for other places but you can check all of the tutorial site if you write some article about the whole thing with basic explanations what game features are
    implemented in each game (collision, animation, keyboard input, mouse input, rotation and so on).
     
    Also I'm a fan your project and I've added all your games to the Phaser Game List at http://pgl.ilinov.eu/.
  17. Like
    Mike reacted to GreenheartGames in [Paid] Looking for HTML5 game developers, game designers, writers, graphic artists and sound designers!   
    Hello, I'm Patrick from Greenheart Games and we are looking for game developers, game designers, writers, graphic artists and sound designers!
     
    All the info is available on our website (it's a bit long for a forum post):
     
    http://www.greenheartgames.com/jobs
     
    We are the creators of Game Dev Tycoon, a small business simulation game about creating your own game dev studio. The game was published on the Windows Store as well as on Steam and other channels. Many players don't suspect this, but the game is written entirely in HTML5!
     
    If you are interested in working for us then please apply by following the information on the website.
  18. Like
    Mike reacted to Fricken Hamster in Calculate fastest side to rotate   
    function lerp_dir( cur_dir:Number , tar_dir:Number , inc:Number){ if ( Math.abs( tar_dir - cur_dir) <= inc or Math.abs( tar_dir - cur_dir) >= (360 - inc)) { cur_dir = tar_dir; } else { if ( Math.abs( tar_dir - cur_dir) > 180) { if (tar_dir < cur_dir) { tar_dir += 360; } else { tar_dir -= 360; } } if ( tar_dir > cur_dir) { cur_dir += inc; } else { if ( tar_dir < cur_dir) { cur_dir -= inc; } } } return cur_dir;} This was what I used a long time ago. Can't guarantee anything.
  19. Like
    Mike reacted to rich in [Newbiew Question] To what extends I can keep using phaser.min.js?   
    You should include phaser.min.js in your html when you deploy the final, finished version of your game.
     
    Until that point you should use phaser.js (the non-minified version) as you'll get accurate debugging / line numbers from it should something die internally.
     
    You only really need to use the src files if you are:
     
    1) Hacking around the library (which I totally encourage btw!)
    2) Trying to fix a Phaser bug or track-down a Phaser specific error
    3) Wanting to understand how the code works better.
     
    The reason the examples use the raw source files is because we use them as a form of unit test, and are constantly testing new features in the library, and it'd be a pain to have to rebuild the phaser.js file every single time just to do this. So usually we only do that when we release a new version.
  20. Like
    Mike reacted to jerev in Trying to track down a developer   
    A peak in the code reveals the name k0rs4r.
    A quick google on this shows quite some results.
  21. Like
    Mike reacted to rich in Tilemap problems   
    The issue is that the tileset image doesn't evenly divide up. You've given it a width/height of 70x70 (which is of course correct), but the tiles don't align to a 70x70 grid. The following screen grab should help show what I mean:
     

     
    You need to trim the sheet down. Remove the blank column on the right plus the little extra padding, and remove the excess space from the bottom of the sheet too.
     
    In Phaser 1.1.4 (currently in development) there are 2 new tileset values to specify the number of rows and columns to extract, but in the meantime this will resolve it.
  22. Like
    Mike reacted to Monstamash in Game list of phaser games   
    Can you add my just launched game?
     
    http://www.marlins.co.uk/xmas/
     
    Just for fun at Christmas. My first game in HTML5 / Phaser. All comments / feedback welcome.
     
    Big thanks to all who replied to my various questions here on the forum, and even bigger thanks to PhotonStorm for this wonderful framework!
  23. Like
    Mike got a reaction from priling in Chirp 1.2 - Online music composer   
    And here is creation one  
     
    http://chirp.rezoner.net/composer/#open=52ab8149c1480f0605000034,z02dfd7q5ds1nhfrw90n3gpssv97wrk9
     
    I'll have to refine it but at least it's a starting ground
     
    Also I very good feature will be real time recording (quantized at first as I think is easy for implementation) because making melodies with mouse click is tedious
     
    Once again very good work I used all features pan, zoom, copy, clone, mark sections also I like how if section is cloned you can make a change and it's propagated to all clones but if you down want it to propagate just uncheck the bars and then they are all by themselves
  24. Like
    Mike got a reaction from Arlefreak in Game list of phaser games   
    Done.
  25. Like
    Mike got a reaction from Rezoner in Chirp 1.2 - Online music composer   
    And here is creation one  
     
    http://chirp.rezoner.net/composer/#open=52ab8149c1480f0605000034,z02dfd7q5ds1nhfrw90n3gpssv97wrk9
     
    I'll have to refine it but at least it's a starting ground
     
    Also I very good feature will be real time recording (quantized at first as I think is easy for implementation) because making melodies with mouse click is tedious
     
    Once again very good work I used all features pan, zoom, copy, clone, mark sections also I like how if section is cloned you can make a change and it's propagated to all clones but if you down want it to propagate just uncheck the bars and then they are all by themselves