Lucas

Members
  • Content Count

    20
  • Joined

  • Last visited

About Lucas

  • Rank
    Member

Recent Profile Visitors

566 profile views
  1. Lucas

    Pathfinding

    I am creating a game to test, there is no scenario, obstacles and nothing. My question is that I'm trying to get an object to move to a certain coordinate I want. Example, I want to move a ball to the coordinates of DestX, DestY and DestZ. I've looked a lot for pathfinding, but I can not find anything that solves my problem. I just think moves executed by the keyboard arrows, I need to set the coordinates and this object should get there
  2. Lucas

    Load new sprite

    Yes.. i created this: function preload(){ //....}function create(){ //....}function update(){ //....}function newPlayer(data){ //I want to put here to load a new tileset ... and after you finish loading the tileset, I will create an array with the information of the player.}
  3. Lucas

    Load new sprite

    I am creating an online game .. and every time someone comes in, takes the phaser load a new image of the character .. And after loading the image 100%, need add animations motion. How can I do? For load.spritesheet add a function and it did not work .. I have a function called NewPlayer, which is called every time a new user connects. thx
  4. But how can I get the data to validate whether the next step is a collision or not?
  5. Show me an example of collision using the function of motion: sprite.body.x += 32; not really find anything to help me, and to my knowledge is not as deep phaser ...
  6. Examples of collision? Do not know how the law works phaser (collision between sprites and layers of tiled map)...
  7. but how i can make collision with layers using this method: sprite.body.x += 32; because it does not work, the character goes right where it should not ...
  8. Actually, I'm making a rpg using phaser (html5) + nodejs (in real time), check out the picture below ... but everything I tried did not work .. because that function (sprite.x) does not work collision layers (tiled map). The only problem is the que collisions are not working with sprite.x ... And yes only with sprite.body.velocity.x (example image of my game) I've tested with up to 4 players online, and all corresponded exactly to the movement of the other. I add friends system, negotiate, and now I'm doing a battle system. It's a simple system, I might even release to download ...
  9. how do I move the player every 32 by 32 pixels? using sprite.body.velocity.x Ex: if I push once to the left or right side, it should move and animate every 32 pixels at a time.
  10. How make collision with layer of tiled map? Using this function of movement: this.bird.x
  11. Lucas

    Make collide

    Because when I use the function below, the image loses quality, gets kinda blurry .. player.sprite.body.velocity.x -= 1;
  12. Lucas

    Make collide

    I am using version: v1.1.5 - Built at: Wed Feb 12 2014 15:32:36 if possible can I use version 2.x
  13. Lucas

    Make collide

    I'm doing based on this code, but the bumps are not working ... This map is made with layers and the player is done with sprite. http://haanto.com/phaser-websocket-multiplayer/ I tried to use these two forms: 1- game.physics.collide(player.sprite, layer); 2- game.physics.overlap(player.sprite, layer); but did not work..
  14. Lucas

    Movement pathfind

    Finally, support for the new version: https://github.com/appsbu-de/phaser_plugin_pathfinding thx ######## Now my avatar is teleporting map.How can I make it move following the correct coordinates? function findPathTo(tilex, tiley) { pathfinder.setCallbackFunction(function(path) { path = path || []; for(var i = 0, ilen = path.length; i < ilen; i++) { localPlayer.sprite.x = path[i].x*32; localPlayer.sprite.y = path[i].y*32; } blocked = false; }); pathfinder.preparePathCalculation([0,0], [tilex,tiley]); pathfinder.calculatePath();}The lace (for) is making it run several times, hence teleportation. ###################### II did so: function findPathTo(tilex, tiley) { pathfinder.setCallbackFunction(function(path) { path = path || []; var i = 0; var interval = setInterval(function () { if(i == path.length-1){ clearInterval(interval); blocked = false; } localPlayer.sprite.x = path[i].x*32; localPlayer.sprite.y = path[i].y*32; ++i; }, speed/6); }); pathfinder.preparePathCalculation([0,0], [tilex,tiley]); pathfinder.calculatePath();}And worked! Thx!
  15. Lucas

    Movement pathfind

    But i have this error in console log of chrome: Uncaught TypeError: Object [object Object] has no method 'tileset' my game: game.load.tileset('img1', 'resources/1.png', 32, 32);My phaser version is the latest..