Jump to content

Search the Community

Showing results for tags 'TiledMap'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 10 results

  1. tl;dr game.physics.startSystem(Phaser.Physics.ARCADE); GameMap = game.add.tilemap('GameMap'); GameMap.addTilesetImage('TileSet', 'TileSet'); under = GameMap.createLayer('Underground'); layer = GameMap.createLayer('TileMap'); trees = GameMap.createLayer('Collideables'); GameMap.setCollision(7,true, "TileMap" ); // Deep water 1 GameMap.setCollision(17,true, "TileMap" ); // Deep water 2 GameMap.setCollision(27, true, 'Underground'); // Darkness GameMap.setCollision(37, true, 'Collideables'); // Trees game console.logs an error " No such layer name: TileMap" So player doesn't collide with water in the begining of the game. If I switch to layer "underground" with: Player begins collision with water as if everything is okay. I also don't receive any errors about layers like "Collideables" and "Underground". I've rechecked the names in the TiledMap multiple times but can't seem to pinpoint the source of this problem. What is that all about?
  2. Phaser CE v2.10.3 So I have 2 tile layers in my Tiled map that use the same tileset. One for terrain, second is for trees over the existing map and other stuff that needs alpha channels. Preload game.load.tilemap('GameMap', 'TestMap.json', null, Phaser.Tilemap.TILED_JSON); game.load.image('TileSet', 'img/TileSet.png'); Create game.physics.startSystem(Phaser.Physics.ARCADE); GameMap = game.add.tilemap('GameMap'); GameMap.addTilesetImage('TileSet', 'TileSet'); layer = GameMap.createLayer('TileMap'); trees = GameMap.createLayer('Collideables'); GameMap.setCollision(7); // Deep water 1 GameMap.setCollision(17); // Deep water 2 GameMap.setCollision(27); // Dark GameMap.setCollision(37); // Trees layer.resizeWorld(); player = game.add.sprite(spawnX, spawnY, 'player'); game.physics.arcade.enable(player); game.camera.follow(player); player.body.collideWorldBounds = true; player.anchor.x = 0.5; player.anchor.y = 0.5; Update player.body.velocity.x = player.body.velocity.y = 0; game.physics.arcade.collide(player, layer); game.physics.arcade.collide(player, trees); The RESULT: Map terrain with sand, dirt and water draws correctly. (They are variable "layer") Trees also are being drawn in the right locations (They are variable "trees") Everything works, except for collisions. Player "collides" with water that is in the "layer" layer. But even though trees are being drawn they player doesn't collide with them. I basically did the same thing to "trees" creating a layer from it, which instantly adds it's graphics btw, and setup the collisions the way I did to layers. I've no idea why the player collides with deep water but not the trees. I'm at a loss. Why would player collide with deep water but not the trees?
  3. Hello there, I'm making a plaformer, and I use the tiledmap plugin (https://github.com/englercj/phaser-tiled) to have best performance on mobile(and it works). But, does anybody here knows how can I resize my layer like the original function : "layer.resize(x,y);" ? I wish I could fill my canvas full height with my tilemap with any device. In addition, How can I scale my objects layer for my collision ? Any ideas ?
  4. Hello guys, I have a problem related with material swapping and asynchronous texture loading. I have a tiled map, and when zooming in the visible tiles swap to a material with a higher resolution image texture. The thing is, the tiled map I have is pretty huge, it has lots of tiles and the images are heavy. What I did until now is just initializing all the materials and textures during the loading screen, loading both the low and the high resolution tile images. Then, the tile swapping works really smooth and is practically unnoticeable. The problem is, for big scenes it takes just too much time loading all these images at the start. So lurking around the babylon.js source code, I've found the flag useDelayedTextureLoading in the Scene class. I use scene.useDelayedTextureLoading = true, and still initialize the textures at the beginning (which is really fast now, of course), but the images are actually loaded when they are really needed (when swapping the tiles), which is cool. The thing is, the swapping is not that smooth now, the tile material "disappears" for a fraction of second and then appears with a new, higher resolution. Having multiple tiles disappearing almost at the same time is very noticeable. I've set up a demo here. It's a very simplified version of what I have, but you should see the tiles disappearing for a moment when zooming in the camera for the first time: http://www.babylonjs-playground.com/#1XBLWB#116 So I tried to solve this in this way: Create a "buffer" mesh, hidden somewhere under the map and when it's time to switch a tile with a higher resolution image I apply the material on the buffer mesh first, so the "special effect" of the disappearing material takes place there. Then, once the texture is fully loaded, I would use the texture.onLoad() method and apply the loaded texture on the right tile. But... it looks like when scene.useDelayedTextureLoading flag is set to true, the Texture constructor callbacks onLoad and onError are ignored?.. So.. I thought it was time to ask you for advice . Maybe you have an idea of how can I fix my solution, or you can come up with a different solution, anything would help. Maybe I'm just complicating the whole thing too much. Thanks!!
  5. Hello guys, I'm new to PhaserJS and I'm trying to make a simple battle-city type of game. I used tiledmap for creating a sample level and sets the 'walls' layer as a solid layers of tiles. But somehow the sprite player can be go over a wall tile and sometimes it can't get through or it can't touch a tile, that looks like there is something invisible in between them, please see the attached image. And here is my code: var create, down, floor, game, left, player, preload, right, up, update, wall;up = null;left = null;down = null;right = null;player = null;wall = null;floor = null;preload = function() { game.load.tilemap('level0', 'game_assets/level0.json', null, Phaser.Tilemap.TILED_JSON); game.load.image('tiles', 'game_assets/assets.png'); game.load.spritesheet('player', 'game_assets/player.png');};create = function() { var map; game.physics.startSystem(Phaser.Physics.ARCADE); game.stage.backgroundColor = '#FFFFFF'; map = game.add.tilemap('level0'); map.addTilesetImage('assets', 'tiles'); floor = map.createLayer('floor'); wall = map.createLayer('walls'); game.physics.arcade.enable(wall); map.setCollisionBetween(1, 1000, true, 'walls'); wall.resizeWorld(); game.physics.arcade.enable(map); game.physics.setBoundsToWorld(); player = game.add.sprite(50, 50, 'player'); player.pivot.x = player.width * .5; player.pivot.y = player.height * .5; game.physics.arcade.enable(player); up = game.input.keyboard.addKey(Phaser.Keyboard.UP); left = game.input.keyboard.addKey(Phaser.Keyboard.LEFT); down = game.input.keyboard.addKey(Phaser.Keyboard.DOWN); right = game.input.keyboard.addKey(Phaser.Keyboard.RIGHT); game.input.keyboard.addKeyCapture([Phaser.Keyboard.UP, Phaser.Keyboard.LEFT, Phaser.Keyboard.DOWN, Phaser.Keyboard.RIGHT]); game.camera.follow(player);};update = function() { player.body.velocity.y = 0; player.body.velocity.x = 0; game.physics.arcade.collide(player, wall); if (up.isDown) { player.body.velocity.y = -86; player.angle = 0; } else if (down.isDown) { player.body.velocity.y = 86; player.angle = 180; } else if (left.isDown) { player.body.velocity.x = -86; player.angle = -90; } else if (right.isDown) { player.body.velocity.x = 86; player.angle = 90; }};game = new Phaser.Game(756, 700, Phaser.WEBGL, 'game', { preload: preload, create: create, update: update});
  6. Hi everyone, I'm creating a little platform, and I use Tiled to create levels. I tried to use a camera in order to follow the player, but that was the result. (Samus is only a placeholder, I'm a Metroid fan ) I'm not using Phaser physics, I've implemented all the collision myself. After the creation of the map, I setup the camera: currentMap = this.game.add.tilemap(mapName);// ... here I create Layers ...groundLayer.resizeWorld();this.game.camera.follow(player);What could that be? Thank you in advance!
  7. Hi! First of all sry for my terrible english. I done a perfect method for me to move platforms with tween and i read the platforms's properties from the tiledmap json. The problem is coz i tween the sprite.x it is a repositioning and not a moving. But i wont tween the velocity coz this work pixel perfectly and i would use the quadratic easing I tryed this code but i not finished yet and it is not perfect. Somebody have a idea for better solution? My idea: make a invisible point tween this object and use acceleratetoobject method. I not tryed yet this.platform5group = this.game.add.group();this.platform5group.enableBody = true;this.platform5group.physicsBodyType = Phaser.Physics.ARCADE;this.game.map.createFromObjects('objects', 786, 'platform5', null, true, false, this.platform5group);this.platform5group.forEachExists(function(platform){if (typeof platform.xmove === 'undefined') { platform.xmove = 0; }if (typeof platform.ymove === 'undefined') { platform.ymove = 0; }if (typeof platform.blink === 'undefined') { platform.blink = false; }if (typeof platform.b_delay === 'undefined') { platform.b_delay = 0; }if (typeof platform.b_vis === 'undefined') { platform.b_vis = 1500; }if (typeof platform.b_hid === 'undefined') { platform.b_hid = 1500; }if (typeof platform.dest === 'undefined') { platform.dest = false; }if (typeof platform.d_out === 'undefined') { platform.d_out = 2000; }if (typeof platform.d_in === 'undefined') { platform.d_in = 2000; }if (typeof platform.allface === 'undefined') { platform.allface = false; }if (typeof platform.wait === 'undefined') { platform.wait = 0; }if (typeof platform.speed === 'undefined') { platform.speed = 1; }platform.tween_blink_out = null;platform.tween_blink_in = null;platform.body.immovable = true;if (platform.allface == false) {platform.body.checkCollision.right = false;platform.body.checkCollision.down = false;platform.body.checkCollision.left = false;}if (platform.xmove != 0 || platform.ymove != 0){this.game.add.tween(platform).to({x:platform.x+(platform.xmove*24), y:platform.y+(platform.ymove*24)}, Math.abs(platform.xmove+platform.ymove)*50/platform.speed, Phaser.Easing.Quadratic.InOut, true, platform.wait, Number.MAX_VALUE, true);}if (platform.blink) {platform.tween_blink_out = this.game.add.tween(platform);platform.tween_blink_out.to({alpha: 0}, 400, Phaser.Easing.Quadratic.Out, false, platform.b_vis, false).onComplete.add(function(){platform.tween_blink_in.start();platform.body.enable = false;},this);platform.tween_blink_in = this.game.add.tween(platform);platform.tween_blink_in.to({alpha: 1}, 400, Phaser.Easing.Quadratic.Out, false, platform.b_hid, false).onComplete.add(function(){platform.tween_blink_out.start();platform.body.enable = true;},this);platform.tween_blink_in.start();};},this);}, //end of createupdate: function () {this.game.physics.arcade.collide(this.game.player.sprite, this.platform3group);this.game.physics.arcade.collide(this.game.player.coinGroup, this.platform3group);this.game.physics.arcade.collide(this.game.player.sprite, this.platform5group, function(player, platform){player.x += platform.x - this.contactPoint;this.contactPoint = platform.x;}, null, this);this.game.physics.arcade.collide(this.game.player.coinGroup, this.platform5group);}, //end of update
  8. helo! pls someone can send me an example for createFromObjects method i couldnt recognize what is the gid thx for any advance
  9. Greetings Ladies and Gents, My name is Spider. This is my first post. I've just started using pixi.js, and moved over to Phaser because of the added functionality of being able to more easily create a tiled world (in a map editor) and then import that map into Phaser. Unfortunately, I have no idea where to start, and would appreciate some advice. I see in the phaser download package there is an example of using both sprite sheets and tile maps in /examples/tilemaps/mario/mario1.php. Unfortunately, there is no indication of what format / specifications / standards the tile maps and sprite sheets use, so I'm not 100% on how to create these sprite sheets and 2D worlds without doing them manually. Has anyone created a tutorial on how to do these. I have a copy of Code 'n Web TexturePacker.app and MapEditor.org's Tiled.app - not sure if any of these are used or if there are better online ones that you can recommend. Looking forward to it! Spider
  10. Hello, I'm encountering a weird bug when I try to render a tiledmap (exported from Tiled) using Phaser : I've just modified the Phaser test suites and included my files to make sure that it wasn't a problem from my code and I still get the same problem. I've tested with the 095, 097, and 1.0TS083 test suites. This is what the map should look like : You can find the files causing problems here : http://www.webeled.com/debug/weirdmap.zip Thanks
×
×
  • Create New...