• Content Count

  • Joined

  • Last visited

About microspace

  • Rank
    Advanced Member

Profile Information

  • Gender
  • Location
    Russia, Ufa

Recent Profile Visitors

209 profile views
  1. microspace

    getTileAbove gives error but getTile does not

    Sorry, I didnt notice that I removed reference tile, thats why error occured
  2. microspace

    Sprite position in terms of tiles

    Is there a way to determine sprite position in terms of tiles, faster than in the example: update: function () { var cposx = Math.floor(player.x / TileSize); var cposy = Math.floor(player.y / TileSize); } I dont want to load too much calculations inside update function. Maybe there is asynchronous way to do this or maybe there is built-in function to od this.
  3. I create layer from Tiled with these commands: var map; var fog; var flour; ... map = this.game.add.tilemap('lesson51'); map.addTilesetImage('tileSheetWinter', 'gameTiles'); flour = map.createLayer('flour'); fog = map.createLayer('fog'); flour.resizeWorld(); ... Why `map.getTileAbove(fog, x, y);` gives error TypeError: Cannot read property 'data' of undefined but map.getTile(x, y, fog); return Tile object as expected?
  4. Hello! I want to reload map, but this time without destroying map object. Previously I was doing it this way: Create: map = TopDownGame.game.add.tilemap("mytilemap"); map.addTilesetImage('tileSheet', 'myTiles'); flour = map.createLayer('flour'); Destroy and recreate: map.destroy(); flour.destroy(); map = TopDownGame.game.add.tilemap("mytilemap"); map.addTilesetImage('tileSheet', 'myTiles'); flour = map.createLayer('flour'); But here I have to destroy map object too. Is there a way to do this without destroying map object? (I now that I can always use `putTileWorld`)
  5. microspace

    Dynamic terrain brush during gameplay

    The process, that I tried to explain with the picture is called "terrain brush" in Tiled. In my case I want to edit terrain in gameplay. Therefore I need a tool to update tiles when user interacts with map (builds a road for example).
  6. microspace

    Dynamic terrain brush during gameplay

    Is there a ready to use examples or plugins that will generate smooth road/rivers like shown in this picture? For now, in Tiled, I have to place each road and crossroad individually.
  7. microspace

    Tile layer dept sorting

    After some thinking, I came to conclusion that I need to sort individual tiles to achieve this. I simply want to avoid this: The ice mountain consists of 4 tiles nad it was created in Tiled. So the simplest solution is to recreate all such objects (as mountains) using sprites?
  8. microspace

    Tile layer dept sorting

    Hello! Is there a way to sort tile layer on the map same as it is done here https://phaser.io/examples/v2/groups/depth-sort I the exxample sorting is done on group elements. I want to achieve same result as in example, but I operate with tile layers.
  9. microspace

    How to skip a couple of game ticks?

    Thank you, @samme, this was really helpful!
  10. microspace

    How to skip a couple of game ticks?

    In my game, player moves automatically using tween, than it shoots a bullet also automatically. Camera is set to follow player, so during the tweening world view changes. This causes the bullet to fly from the player too early, as if weapon chases the player during tweening and can't run after it. Here is example video of the bug. On the video we can see that bullet flies over barrel. But it must hit the barrel nad it does hit it sometimes. So the question is, how to skip couple of game ticks before shooting, so that the weapon and the player settle down to one coordinate? Or is there something like "force update screen"?
  11. microspace

    Collision in multilevel rpg game

    So I had to put group of immovable and impassable sprites as a barier for upper level. Not a beautiful solution, but will do.
  12. microspace

    Collision in multilevel rpg game

    I've got a tilemap created in Tiled and there is a platform with ladder on the map. How to make player stop when it tries to move from platform to group layer? Also how to make player collide with tiles pointed by green arrow when player approaches then from left, bot not collide when player approaches from right. Simply, is there `checkCollision` property for a tile?
  13. microspace

    Cannot place game between two other divs

    You need to place div contained with an id attribute: https://stackoverflow.com/a/21053003/1402321
  14. microspace

    Phaser with Blockly

    Hello! Here you go: https://github.com/rusi/canvas-demos Nice project! I'll appreciate if you show us the results 🙂
  15. microspace

    Transparency of a single tile

    But still I can't set opacity on tile inside game loop. Only on level creation.