Jump to content

Search the Community

Showing results for tags 'tilemaplayer'.

  • 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 19 results

  1. Hi All, I'm new to phaser (using phaser 3.50.1) and trying to generate random objects around the level. The problem is I don't want these objects to be spawned over on the tilemapLayer tiles. Attached is an image of the stars spawning over the tiles. Before I added the tileMap, I was using this.physics.add.staticGroup(); with that I was able to check on the overlap with the walls in my method to add stars. this.scene.physics.overlap(walls, star) Now, with the tileset, I'm passing the tileMapLayer, but overlap is not detecting the tiles (picture, line 29) How is the correct way to check for collisions/overlaps for tileMaps ?
  2. I tried to create a Level with tilemapLayers. After adding everything. I try to display the debugGraphic. It only shows the Ball with a debug circle and the loaded Layers. But it only shows the image no bounding boxes or something like that. Does anyone see the problem here? preload() { this.load.atlas('kugellabyrinth', 'assets/Kugellabyrinth.png', 'assets/Kugellabyrinth.json'); // this.load.tilemapTiledJSON('map', 'assets/map.json'); // this.load.image('walls', 'assets/Walls.png'); this.load.tilemapTiledJSON('map', 'assets/rpg_map.json'); this.load.image('walls', 'assets/[Base]BaseChip_pipo.png'); console.log('preload method'); } create() { this.matter.world.setBounds(0, 0, 512, 512, 32, true, true, true, true); console.log('create method'); this.map = this.make.tilemap({key: 'map'}); this.tileset = this.map.addTilesetImage('RPG Set', 'walls'); this.floorLayer = this.map.createDynamicLayer('Floor', this.tileset, 50, 50); this.wallLayer = this.map.createDynamicLayer('Wall', this.tileset, 0, 0); this.wallLayer.setCollisionByProperty({collides: true}); this.matter.world.convertTilemapLayer(this.wallLayer);this.matter.world.convertTilemapLayer(this.floorLayer); this.matter.world.createDebugGraphic(); this.kugel = this.matter.add.image(48, 48, 'kugellabyrinth', 'Kugel.png'); this.kugel.setCircle(this.kugel.width / 2, { restitution: 1, friction: 0.25 });
  3. I'm still in the early prototyping phase so I suspect (hope?) my issue is one of overlooking a core tenant of Phaser... Also, I'm coding with Phaser CE 2.8.7 using Typescript/ES6. My primary game state is comprised of two classes: A combat class extending Phaser.Sprite which serves as a container for the 4 character atlases within, and, beneath, a UI Class extending Group which contains a few buttons and, to the right, a mini-map group comprised of a Tilemap and its lone TilemapLayer. (The star icon is a simple sprite on top of the tilemap layer which will later represent the player, but that is currently inactive.) The problem: as the characters advance to the right there's no problem until the camera kicks in. It "follows" the sprites just fine... BUT while advancing the camera seems to erase the tilemap layer as it goes, removing it entirely. When the characters return to the start position, however, the mini-map is restored as the camera passes from right to left. If I remove the camera altogether this never occurs, so it seems I've mismanaged the camera or the mini-map somehow. I've attached two screenshots: the first displaying the mini-map before the camera begins to erase it, the second as the camera begins to pass above the mini-map, erasing the image as it passes. I'll gladly provide any relevant code if needed...
  4. I'm having a lot of trouble with my tiled game, Everything loads fine, and the FPS is 60, but once the camera begins to follow the player the framerate takes a nosedive. I looked on some Phaser examples, and found that the example posted suffers from the same problem: http://examples.phaser.io/_site/view_full.html?d=tilemaps&f=sci+fly.js&t=sci%20fly Checking the code, I've loaded in my layers the same way. Nothing seems to be different. It just appears that Tilemaps + Game.Camera don't mix at the moment.
  5. How can I resize a TilemapLayer? I'm resizing my game on browser resize, and if the size increases the layer is only rendered to an area equal to the old size. Increasing a layer's width/height scales it, but it is not quite what I want. Something equivalent to setBoundsToWorld() (like what the camera have) would be perfect.
  6. Hi guys, How can I destroy tiles from TilemapLayer using an Array of indices? Regards, Nicholls
  7. Hi friends, Help me please, How can I set the TilemapLayer position in the bottom on the canvas when the scale mode is Phaser.ScaleManager.RESIZE? My demo: http://phaser.azurewebsites.net/runner/ Thanks in advance, Nicholls
  8. Hi guys, In earlier versions of Phaser I can get texture from a TilemapLayer and use it with a TileSprite... but with the 2.4.2 doesn't work. Any idea that you can suggest me? PD: My code: http://www.html5gamedevs.com/topic/12994-tilesprite-from-tilemap-and-tilemaplayer/ Thanks in advance, any help is greatly appreciated
  9. Hi guys! One question please... How Can I create a tilesprite from a TileMap and TileMapLayer? Thanks in advance, Nicholls.
  10. Hello all, Just wondering if the tileMapLayer is supposed to have the 'bringToTop' method in it still? I updated my version of Phaser to 2.3.0, and discovered that it no longer existed. Is this supposed to be the case? Currently I'm just hacking it a bit and doing: Phaser.TilemapLayer.prototype.bringToTop = Phaser.Component.BringToTop.prototype.bringToTop;Just wondered in case things had been changed, or if it was done by mistake. Cheers
  11. I would like to insert a tile into an empty TilemapLayer I have on a user click event, but I'm able to find anything in the documents on how to do this.
  12. Hello. I am tinkering with the blank tilemap example trying to scale down all layers "below" the current level. This is working fine except that the camera bounds gets scaled with the level, clipping it before it reaches the actual bound of the world. If you look at the attached files you will see the three different layers (scaled to 100%, 90% and 80%) as well as a red outline indicating the camerabounds for each layer. I don't necessarily think this should be considered a bug and there is probably a setting for this but if so, I cannot find it So my question is if there is a way to set the camera bounds per layer. Or any other way to achive what I want (making all layers fill out the whole camera). Thanks in advance. / AS
  13. Hi guys! I want to generate a texture to use with several sprites and tilesprites from a tilemaplayer, but i dont know how to use it... ¿someone could you give me an example? Thanks in advance, Nicholls
  14. <deleted>
  15. Hi all, I'm loading in my tiles with the TileMap.createLayer method, and loading in game world objects with the TileMap.createFromObjects method. It seems that createFromObjects has an autocull parameter, but createLayer does not. I'd like to cull everything outside the camera limits as the world I've built is rather large, and it's showing slowdown on mobile devices. So I'm trying to squeeze every bit of optimisation I can out of this thing. Is there another way to cull the tiles in my TileMapLayer object?
  16. Like the line of sight demo on game mechanicexplorer (http://gamemechanicexplorer.com/#raycasting-1), I'd like use ray casting for enemy detection and movement (chasing), but on a big tilemap, with a specific layer holding the collision information for certain tiles. My questions are: - How can I get this ray cast demo work with tilemapLayer? I looked up the docs, but could figure it out. - How can I assure perfomance, as the whole map would consist easily 100-200 objects in general which need to be ray casted, even just a few are in a relevant range where line of sight detection makes sense?
  17. How do I set the position of tilemapLayer in game world? I have tried the following code but it's not working: var width = map.layers[0].width * tileset.tileWidth;var height = map.layers[0].height * tileset.tileHeight; layer = game.add.tilemapLayer(game.world.centerX - (width / 2), game.world.centerY - (height / 2), width, height, tileset, map, 0); I need to set the position of tilemapLayer to center.
  18. Can I set the visibility of a tilemapLayer at runtime, such as semi-transparency?
  19. Collisions between sprites (as well as groups) and tilemaps won't call the collision callback in 1.1.2. This is already reported as an issue in git. As far as I can see the problem is that the sprites stops moving, thus body.deltaX & body.deltaY become 0, before there is an actual collision. I'm now looking for some sort of fix or workaround for this, so I can use 1.1.2 in my project.
×
×
  • Create New...