Search the Community
Showing results for tags 'rows'.
-
Hi I am new to Phaser and building my first game with Phaser CE. I am trying to build rows and column of images that will dragged and drop. I am having hard time understanding various ways to build tiles and can't find any resources of exactly what I am doing. So I build squares in row but don't know how can I lay it in multiple rows like tiling and then how to put the images inside the thumbnailBg.Can someone please advice. var thumbnails; var thumbnailBg; var thumbnailsHolder = this.game.add.group(); thumbnailsHolder.x = 400; thumbnailsHolder.y = 100 for(var i=0; i<imageName.length; i++){ this.createThumb(thumbnailBg, i); // thumbnailBg.x = 100*i; if(imageName[i].indexOf('_mask') < 0 && imageName[i] !== 'bw_1'){ thumbnails = this.add.sprite(100*i, 0, imageName[i], null, thumbnailsHolder); } } function createThumb (thumbnailBg, i){ console.log('thumbCreator'); thumbnailBg = this.game.add.graphics(100*i, 0); thumbnailBg.lineStyle(2, 0x276998, 0.6); thumbnailBg.beginFill(0xFFFFFF); thumbnailBg.drawRoundedRect(330, 50, 100, 100, 10); // draw a rounded rect mask thumbnailBg.endFill(); }
-
Hi, i'm facing a issue animating a char with spritesheet. I'm trying to animate a character with up/left/down/right animation. I'm using this one : https://opengameart.org/content/cowboy-platform-and-isometric-sprite-sheet Here's my code : https://pastebin.com/2EF6CEk5 Left and right moves work well, the error appears when using "up" moves, the character does not start animating with the good frame (i want it to start with first column 6 rows), instead it starts with 7 cols 6 rows ). Maybe i dont understand how case numbers work xith multiples rows spritesheets. By the way, i'm very new to Phaser, i'm up to hear advices if there's a better way to do this. Here's the first frame of up move. Thanks
- 2 replies
-
- rows
- spritesheet
-
(and 1 more)
Tagged with: