abdul

Members
  • Content Count

    19
  • Joined

  • Last visited

  1. I make my whole map in tiled, and it has 2 layers. Now when I move my car, it only covers few distance and then stop, I don't know why it is not covering full map. I am attaching files test game.zip I don't know what is missing or wrong in it.. and second thing is that, in first layer I have road and in second layer I have footpath, I want that car drives on road and collide with footpath. but what should I do for that ? I set collision of my car with both layers, should I make my second layer object layer ? or there is any other way to handle this.
  2. yp, I want to add more to the map programmatically, but according to you if it is difficult for new one and its better to create full track in tiled, then I will make whole map in tiled map editor..
  3. I know about that example I want to use it in another way, but my main problem is my first question...
  4. I am testing a racing car game. For that I make my road in tiled map editor and using its json file in phaser. It is 50 tiles in height. Now I want to extend my map. I have two options , extend it through phaser or make whole extended map in tiled map editor. Which one is better and how can I extend it through phaser ? I have no idea about this. I also want to add an object layer on my background layer, so that my car collides with other objects which will be on my background layer. I have already searched object layer problem in this forum, but not satisfied. I am also attaching files , may be I am not clearing my question... plz help me out..test game.zip
  5. abdul

    Tilemap not rendering

    try this function create() { // configure the mapmap = game.add.tilemap('map', 32, 32);map.addTilesetImage('tiles','tiles');// first arg is the name of your image file which is in directory with .png extension, and second arg is the name you assigned to that image while loading....layer = map.createLayer(0);layer.resizeWorld();map.setCollision(2);map.setCollision(4);map.setCollision(5);layer.debug = true; }
  6. abdul

    Problem in Restarting the game

    game.input.onTap.addOnce(function() { game.state.restart();}, this);It is not working.. same problem.. it resets all things, but the text "Congrajulations You Won Click to restart" remains there and player doesn't come.
  7. abdul

    Problem in Restarting the game

    Hi I have a game restart function. i.e function restart () { game.state.restart();}I am calling it two times, one time when player all lives kill, then I am calling it from update function, and it is working well. i.e if(player.position.y>game.world.height){ live = lives.getFirstAlive(); if (live) live.kill(); player.reset(120, game.world.height - 70); if (lives.countLiving() < 1){ player.kill(); stateText.text=" GAME OVER \n Click to restart"; stateText.visible = true; //the "click to restart" handler game.input.onTap.addOnce(restart,this); } }second time I am calling it when player wins the game, and wish to restart it, but this it doesn't restart the game ... i.e if(diamondScore>=2 && starScore>=2) { player.kill(); stateText.text=" Congrajulations\nYou Won \n Click to restart"; stateText.visible = true; game.input.onTap.addOnce(restart,this); }anyone has any idea regards this,,,
  8. abdul

    free falling objects

    When i enable debug.body functions in render, nothing happens to stars, but when I enable stars.forEachAlive(function(s) { game.debug.body(s); }, this);then stars have a visible rectangular body but no collision.......
  9. abdul

    free falling objects

    everything is working fine, but stars do not collide with woods, plane and cloud.... even the function and properties of stars are same as the diamonds are and diamonds perform everything. In create function stars = game.add.group(); stars.enableBody = true; stars.physicsBodyType= Phaser.Physics.ARCADE; stars.createMultiple(30, 'star'); stars.setAll('outOfBoundsKill', true); stars.setAll('checkWorldBounds', true);In update function game.physics.arcade.collide(stars, plane);game.physics.arcade.collide(stars, woods);game.physics.arcade.collide(stars, woods2);but they are not working.. If there is any error then plz help me..
  10. abdul

    free falling objects

    yes sir you are right, sir there was little bit 's' mistake in spelling... It is working but sir after using this a boundry around my objects is showing ,like some one wrap a piece of shaded glass around my objects, how can I remove this?
  11. abdul

    free falling objects

    sir error comes i.e Uncaught TypeError: Cannot read property 'forEachAlive' of undefined
  12. abdul

    free falling objects

    I am trying to collide group vs group . But no collision is going on. Both have velocity in same direction. game.physics.arcade.collide(diamond, wood);Sir, is there any other way to perform this?
  13. abdul

    free falling objects

    I was using old version of phaser now with new version it is working fine thanx sir
  14. abdul

    free falling objects

    thanx alot sir, wrapping slove my problem... but there is another problem which is not solving... I only want to wrap the world on horizontal axis, not the vertical axis.. here I am writing 'false' in the arg of wrap vertical axis, game.world.wrap(mummy,0,false,true,false);but it doesn't work..