Ashish

Members
  • Content Count

    29
  • Joined

  • Last visited

About Ashish

  • Rank
    Member

Recent Profile Visitors

663 profile views
  1. Ashish

    Spritesheet Problem

    Hey, @samme thank you for your quick reply. Actually, I am loading two spritesheet game.load.spritesheet('button1', '../tileMap/location1.png', 50, 35); game.load.spritesheet('player','../tileMap/bot2.png',50,35); If I am loading only bot2.png(if locaton1.png is commented) It is working fine but after loading location1.png its giving warning.What can be the possible problem here?
  2. Ashish

    Spritesheet Problem

    Same warning I am getting in my code What is the solution for this? And should I ask the new question on the forum?d
  3. And one more thing @samme, In your example map is loading according to pixel size and that only we can zoom in and out. But I want to load the full map in same 800*600 or less (600*400) area.How can I implement this?
  4. Hey @samme I saw the example you have given. I have some problem with that How can I increase and decrease the scale using mouse click or some like that. I don't want to use new Gui.
  5. Thank you man @samme, This will help me for sure.
  6. Thank you @mickeyren, I am using tilemap, so loading json file and image . How can I consider that as Sprite.
  7. Hey @samme , can you explain how I will use it?
  8. I have created tilemap using Tiled software of pixel size 1200x1000. While rendering it using phaser I have set width equal to 500 and height equal to 400.After this only map of 500x400 area is loading and remaining part is missing. How can I show the full map in 500x400 area on my webpage?
  9. I am developing a game where I need to zoom in entire map also I can be able zoom out. I have created a tilemap using tiled software and rendered it using phaser.js. How can I add this function to my game?
  10. I am developing a game where my player has to look to see forward when I am pressing right arrow key. But how can I make it look reverse after pressing left arrow? I can create a sprite of reverse look but how can load that while pressing left and at the same time forward player should be destroyed?
  11. I want to fill the color in specific tile. The method available in phaser is putTile(), But I want to fill any color I want. In canvas there is method called fillrect(). Please suggest me some solution.
  12. I have created a sample map using tiled software. Then tried to load the same u on webpage using phaser.js. But I am not getting the proper result. Is there any mistake in my code or something wrong with library. <!DOCTYPE html> <html> <head> <title>Basic Platformer game</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width"> <script src="js/phaser.min.js"></script> <script src="js/phaser.js"></script> </head> <body> <div id="phaser-game"></div> <script type="text/javascript"> (function() { var game = new Phaser.Game( 800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render }); function preload() { game.load.tilemap('map', 'background.json', null, Phaser.Tilemap.TILED_JSON); game.load.image('tile2', 'floor2.png'); game.load.image('player','bot2.png'); } var map; var layer; var marker; var player; var currentTile; var cursors; var curser; function create() { game.stage.backgroundColor = '#787878'; game.physics.startSystem(Phaser.Physics.P2JS); map = game.add.tilemap('map'); map.addTilesetImage('floor2','tile2'); currentTile = map.getTile(0, 0); layer = map.createLayer('Tile Layer 1'); player = game.add.sprite(20, 20, 'player'); game.physics.p2.enable(player); player.body.fixedRotation = true; layer.resizeWorld(); marker = game.add.graphics(); marker.lineStyle(2, 0x000000, 1); marker.drawRect(0, 0, 20, 20); cursors = game.input.keyboard.createCursorKeys(); game.camera.follow(player, Phaser.Camera.FOLLOW_LOCKON, 0.1, 0.1); game.physics.arcade.enable(player); </script> </body> </html>
  13. Hello, I am working on a game using tilemap and phaser framework. I want select the multiple coordinates on tilemap using phaser (cursor) and then can be able to store into an array. Is this possible using phaser? suggest me some solution for this.
  14. Hey, @hicotech I have again question if you don't mind to answer it, can we select multiple coordinates like this using cursor or something and store that coordinates into an array.
  15. Thank you @hicotech again, Its really working now. Thank you so much!!!