Tag Info

Hot answers tagged

2

Phaser has support for two types of sprite sheet: "classic" ones, where every frame is the exact same size, and "texture atlases" which are created with the help of a third party app like Texture Packer, Shoebox or Flash CC and come with an associated json file. You load the "classic" ones with game.load.spritesheet where you must specify the width and ...


1

Your issue comes from the fact that your 'hex' canvas is hidden by your 'ground' canvas, and do not receive the mouse events. But in fact you don't care from which canvas the click event was raised : just have your mouse handling code hook the events of the top-most canvas, and use those coordinates. (I assume here that all canvases have the same size ...


1

Use the overload of the drawImage method of 2DContext that allows you to draw part of an image. MDN calls it slicing: drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) Given an image, this function takes the area of the source image specified by the rectangle whose top-left corner is (sx, sy) and whose width and height are sWidth and ...


1

var sprite = game.add.sprite(x, y, 'spritesheet_name'); sprite.frame = 0; Spritesheets aren't limited to animations, that's just one way to use them. An animation is just a way to display different frames at different times. By manually setting the frame of a sprite, you can display a specific part of the spritesheet.


1

I've been targeting node-webkit for my html5/js game. Most of my code runs browser-side, so the node.js aspects are mostly because its simple enough to have it run a small server and send down the html/js code to the embedded browser. A good demo of a fast-paced game is, "A Wizard's Lizard". They talk about their success on reddit, and they apparently use ...



Only top voted, non community-wiki answers of a minimum length are eligible