Jump to content

rickydamta

Members
  • Content Count

    14
  • Joined

  • Last visited

  1. Hello, I have a sprite player = game.add.sprite(50, 550, 'player');When i try to load some animations player.animations.add('left', [4, 5, 6, 7], 10, true);player.animations.add('right', [8, 9, 10, 11], 10, true);player.animations.add('up', [12, 13, 14, 15], 10, true);player.animations.add('down', [0, 1, 2, 3], 10, true);I get this error TypeError: Cannot read property 'index' of undefinedThis is my full code var menu = function(game){ console.log("%cStarting my awesome game", "color:white; background:red");}menu.prototype = { preload: function() { game.load.tilemap('level_json', '/maps/
  2. Hello, I'm trying to load 4 tilesets image with this code mainmap.addTilesetImage('basictiles', 'tiles');mainmap.addTilesetImage('Decor0', 'decor');mainmap.addTilesetImage('Ground0', 'ground');mainmap.addTilesetImage('overworld', 'overworld');This is my full file var play = function(game){ console.log("%cStarting rpg-dev game", "color:white; background:red");}play.prototype = { preload: function() { game.load.spritesheet('player', 'res/playerpg.png', 34, 46); game.physics.startSystem(Phaser.Physics.ARCADE); game.load.tilemap('mainmap_json', '/maps/mainmap.json', null, Phaser.Tilemap.TIL
  3. I have checked the console,and is empty,there is no errors
  4. Hello, I´m trying to load my own map(made with Tiled Editor) This is my code var menu = function(game){ console.log("%cStarting my awesome game", "color:white; background:red");};menu.prototype = { preload: function(){ game.load.tilemap('level1_json', 'maps/level1.json', null, Phaser.Tilemap.TILED_JSON); game.load.image('tiles', 'res/tiles_level1.png');}, create: function(){ map = game.add.tilemap('level1_json'); map.addTilesetImage('tiles_level1', 'tiles'); }, update: function(){ }This is the json fileThis is the json file { "backgroundcolor":"#56ab49", "height":38, "layers":[
  5. No I want to reset the position of all the sprites,i tried with player.resetPosition();but it does not work
  6. Hi everyone Do you know a code that can restart completely the game? Thanks
  7. Ok thanks,i will try that! But I'm searching for a line of code to do that
  8. Hi! I am making a tower defense game. I need to check if a the "enemy" sprite is on the stage,how do I do that? Thanks
  9. Hi everyone. I am a newbie in phaser and in english I am making a tower defense game,and i need to make 2 different layers. One for the background and one for the sprites. How do I make that? Thanks
  10. Hi! I am new to phaser. I have a sprite called Ground in the group called Platforms var platforms = game.add.group();platforms.enableBody = true;var ground = platforms.create(0, game.world.height - 30, 'ledge');The ground sprite has to be white,I use this line of code for that ground.tint = 0xffffff;I don't know why but it does not work with the color white,it works with any other color but not with white. Thanks for help
×
×
  • Create New...