Jump to content

Search the Community

Showing results for tags 'tilemaps'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





  1. I’m trying to make a game that has a map editor, and I would like to save layers locally to the file system. Can somebody help me to add this feature? And I also don’t have anything because I don’t know where to start, so I don’t have any code to show.
  2. A collider collides only with set tiles on a tilemap. However, if you are using an overlap with a tilemap, it always callbacks. If you log the index of the Tile, it's 0. So "no set tile". Is that intended behavior?
  3. Till version 3.12 everything was fine on using tilemaps. Now, by using a camera that moves, tiles blinking on their edges because the frameContainer isn't as fast as the camera. Is there already an issue, or is somebody aware of this? 3.14 fixes a lot of camera stuff for me, but it makes it unusable since it breaks literally tilemaps..
  4. Hi There, I am having this issue with phaser(2.9.4) where collision with a tilemap only work with the base layer. In my example I have the collide-able world and then I wanted to add a background underneath that was part of the tilemap. Here is my code(excluding boot and preload) Game.preload = function () { game.stage.backgroundColor = "000000"; }; Game.create = function () { Game.scale = 5; game.physics.startSystem(Phaser.Physics.ARCADE); game.physics.arcade.gravity.y = 850; Game.cursors = game.input.keyboard.createCursorKey
  5. Hi guys, I'm new to the framework but I googled around abit and couldn't find an answer to this: I’m making a tile mapped game where the player needs to make their way through a tiled level by moving upwards. To achieve this the camera follows the player around a rectangular world My question is about creating 2 background TileSprites that scroll with the camera BUT not at the same speed as the camera to achieve the effect of having a background with TileSprite 1 in the distance and TileSprite 2 in the far distance Maybe something like an event handler that works l
  6. HI , i am trying to make a simple rpg stye game. i have created a map in tiled editor and exporting it to json. i can load and display the map in game but the colisons between my sprite and collision layer is not working. i have followed example from here . i also do not see any error in console. it just dosent work. here is my code. i am alsso attaching my level fileslevel2 <!doctype html> <html lang="en"> <head> <style> canvas {cursor: url('/assets/sprites/cursors/Black.png'), default;} </style> <meta charset="UTF-8" /> <
  7. Hello everyone, I am beginner with phaser, i am French and my english is not very nice. I need your help, i am blocked on a collide function. I want my character to collide with my second layer (tree, montain, statue..). (i use tiled map editor and export in json). my code : function preload: game.load.tilemap('map', 'assets/tilemaps/maps/map.json', null, Phaser.Tilemap.TILED_JSON); game.load.image('tiles', 'assets/tiles/tiles.png'); game.load.spritesheet('perso', 'assets/sprite/spritetest.png', 32, 47); function create : game.physics.startSyste
  8. /** * Takes the collision data defined in the collision editor of Tiled and applies it to * and exisiting tilemap for use with P2 physics bodies. * * Tilemap json data MUST be loaded in the Preload state/function using game.load.json() before this function is called * map must only have ONE tileset * each tile can only have ONE polyline set for it's collision * the polyline MUST be a complete shape (the last point is indentical to the first) * * @param {Phaser.Tilemap} map - this is the map which you want polylines added to * @param {string} ke
  9. Hello. I've been trying to create some levels for my game and I found that the only way for it to work, given my tilesets, would be to create multilayered tilemaps. The problem is I don't know how to load them using Phaser functions and I've been unable to find any existing examples of this in action. Any help would be greatly appreciated. Best regards! Mariusz
  10. Hi I'm playing a bit with this example. http://phaser.io/examples/v2/tilemaps/tile-properties In this example there is a function which is responsible for displaying properties for the given tile: function getTileProperties() { var x = layer.getTileX(game.input.activePointer.worldX); var y = layer.getTileY(game.input.activePointer.worldY); var tile = map.getTile(x, y, layer); // Note: JSON.stringify will convert the object tile properties to a string currentDataString = JSON.stringify( tile.properties ); tile.properties.wibble = true; }
  11. I m building a little platformer-type game and am having this problem: When the player is moving really fast, (basically when he falls a large distance) he no longer collides with stuff, and falls right through the floor. This problem comes up when I switch from making regular sprites in a group for floors and platforms, to loading in a tilemap from Tiled. I also notice a change, which is my only hint that something is working differently with the physics - the sprite's body.touching property no longer reads, and instead body.blocked now reads. So for example, if I let the player j
  12. Hi, I'm trying to build a top-down 2d game. You can find the code for it here: https://github.com/JimTheMan/Room-Walkers Here is a screenshot of the game using "this.scale.scaleMode = Phaser.ScaleManager.NO_SCALE ;" The game works, but there are a few issues I'm having: 1) The "viewport" always shows an area of 10 x 10 tiles. As the player moves the camera follows him and he appears to be moving around the map. However, the viewport is always 10 x x10. Is there a way to change this, for example, to where the viewport always showed an area of 20x20 tiles? 2) When I use "NO_S
  13. Hi! A couple of days ago I started with PhaserJS. Wonderful engine! And easily enough, specially when you come from a just-canvas environment. After reading a little about the platform, I started to code my homepage, made originally in EaselJS, in PhaserJS (http://ludobermejo.es/). I created a Tilemap with multiple layers, I exported it and I loaded it into PhaserJS. And I have some problems: everything's cool if I don't move the background, but when I move it, FPS drops to 20 or even 15. I'm pretty sure this is because the rendering of the tilemap. If I use a background PNG image with th
  14. Hey guys i've got a weird problem with tilemaps. In the create function i've got this: this.collisionLayer = this.map.createLayer('CollisionLayer'); this.ladderLayer = this.map.createLayer('LadderLayer'); this.collisionLayer.resizeWorld(); this.map.setCollisionByExclusion([0 ]); and in the update function: this.game.physics.arcade.collide(this.player, this.collisionLayer); this works just fine, and the player collides with the collisionLayer and so on. However if i do this: this.game.physics.arcade.collide(this.player, this.ladderLayer); Noth
  15. I'm trying to stitch together random tilemaps to randomly generate a level. I'm attempting to do this by changing the [x, y] position of a tilemap layer, however changing those values don't result in anything. I found this post and am wondering if it has been address in 2.6.2:
  16. I'm having a bit of trouble with tilemap collisions. I'm using P2 and a json tiled tilemap. Strangely, it seems to work with small, simple tilemaps but as soon as I boost the complexity it seems to stop working. I've got a simple car being driven by physics that turns one way when you touch and the other when you don't. Help? Here's the create code: create: function(){ game.physics.startSystem(Phaser.Physics.P2JS); //!THIS STUFF WORKS WITH TEST MAP this.map = this.add.tilemap('city'); this.map.addTilesetImage('roguecity'); this.decorationLayer = this.map.createL
  17. Jerkoco

    How Camera works ?

    Hello ! I'm currently making a custom engine in JavaScript (canvas). I already did sprites, particles, events (touch, keyboard, mouse) and a basic script to render tilemaps (no scrolling yet) I want to code the scrolling, camera and world system. If I create a game with a world of 30,000 pixels width and 15,000 pixels height, and my camera is in 800x and 800y for exemple; should I: -Call render and update functions for every element in the world (even if they are outside the canvas) -Get elements who are in the camera to update and render them. - Should I do something
  18. What is the smart way to do top-down tile terrain borders in Phaser? You can't see hard-line tile edges if you look at basically any top-down game with tiles (Sid Meier's Colonization, Rimworld, Civilization 2, Heroes of Might & Magic); there are a few pixels between the tiles that get merged which makes the image as a whole look more or less seamless. Using Phaser, it looks to me like manipulating and rendering a large tile-based game map/board should probably make use of Tilemaps. However, the examples all look like the tilemap tiles do not overlap at all. I can see how you could ma
  19. I started playing around with Phaser but I consistently have problems with collisions. I have a tilemap here https://github.com/lededje/game/blob/master/src/tilemaps/WorldTilemap.js A sprite here https://github.com/lededje/game/blob/master/src/objects/Player.js and the gamestate here https://github.com/lededje/game/blob/master/src/states/GameState.js As far as I know everything is in order but still no collisions. Aside from the answer to my query (which would be great) I'd also like to ask how to go about debugging these things in the future. I checked the `collisio
  20. I mean tilemaps! Dang OS X autocorrector is not helpful. I can't for the life of me find any description of the JSON files used with tilemaps. I can guess what a lot of it is but not, for example, what the "data" attribute is for. Since I'm making my own tilemaps I'm at a standstill. Can someone point me to where they're described?
  21. Hi everyone, Is there a way to get object like getTile method for tiles? I am making grid based game and i need to check if there are any objects on specific tile position. Thanks in advance.
  22. I'm currently working with tiles to create levels - so far so good - I've managed to make a demo car game with a maze, collisions with walls and mines all working as expected. I'd like to extend the functionality with a new tileLayer with one tile on it - let's say its a tile indicating fire - and on a timer I'm firing a function which looks at the neighbouring tiles around it, and if they're empty (hasTile()?) then fill them with a fire tile - this means the fire layer will expand over time but only into neighbouring tiles. I'm currently using forEach to cycle through the tiles and only c
  23. Does anyone have any working examples of using the createFromTiles() function of tilemaps that they would be willing to share?
  24. Hi there, I have a basic prototype, it´s a basic plattformer and I have the hero and the platforms working (with tilemaps) At the beginning of the game, I drop the hero on top of a platform and everything works fine I can walk in the platform and drop into a platform below. Also I can jump, but the problem is that I can jump everytime instead of just when I´m touching the floor (basically I can fly!). I´m using the sprite.body.touching.down property but it seems it´s not working at all, even when I´m walking on top of a platform the value of body.touching.down is false (and the physics and w
  25. I want to calculate a distance between object of the platformer and a place it can possibly achieve without moving up or down (face the obstacle or fall down), just left or right. So I use test bodies called this.shadowSide (to watch wall facing) and this.shadowDown (to watch falling). Prefer to call them "shadow bodies". I use this.game.physics.arcade.overlap to determine if the shadow body overlaps the floor. I move shadow bodies (left or right, depending of the direction I need), check overlaps and either continue searching or return a distance. It works well for sprite floors. The trouble
  • Create New...