Git Product home page Git Product logo

phaser-tilemap-plus's People

Contributors

colinvella avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

phaser-tilemap-plus's Issues

Trigger Tile Animation on Region Based Event

Hello Colin,

do you think if it's somehow possible to trigger a Tile Animation
on a specific Region Based Event?

I'm trying to animate door tiles in my game, but don't know how to do that without
using Sprite Animations or Tile Sprites.

I uploaded a GIF to show you what i mean:
https://ibb.co/ijSxmb

Thanks for your help!

Scaled Layer Physics

Hello colinvella,

I'm trying to enable physics with a custom Layer scaleRate

My code:

this.map = this.game.add.tilemap("testmap");
this.map.addTilesetImage('tileset');
this.backgroundLayer = this.map.createLayer('BackgroundLayer');
this.backgroundLayer.setScale(3);
this.backgroundLayer.resizeWorld();

My map.json already has a CollisionObjectLayer

Is there a way to get this work? I tried messing around with ShapeLayer.js but it didn't work.

Thanks for you help and btw: I love your Plugin!

"Tile Layer Format" matters!

It's worth mentioning in the README that Tiled's "Tile Layer Format" matters when wanting to enable animations:

  • XML
  • Base64 (uncompressed) supported by Phaser.Loader
  • Base64 (gzip compressed) unsuported by Phaser.Loader
  • Base64 (zlib compressed) unsupported by Phaser.Loader
  • CSV

Basically, the JSON needs it's layer data to be Arrays of integers and not a String.

Took me forever to figure out why https://github.com/colinvella/phaser-tilemap-plus-demo was working, but my map wasn't...! ๐Ÿ˜†

[Issue] Multiple collisions on a sprite

Hey !
First of all, awesome work man !

I have some issues in multiples cases like multiple collision at the same time.
Let me explain with an example :

update () {
  // if sprite is colliding on the right and is on the floor then stop animate 
  // ( the sprite got a velocity.x of 200 and a velocity.y of 0)
  if (this.body.contactNormal.x < 0 && this.body.contactNormal.y < 0) {
    // never trigerred since contactNormal.y will always be = 0 because we can actually 
    only check one shape at the same time
  }
}

I know it works well with stuff like slopes but when It's a < -1 && < -1 situation there is this issue.
If it is not an issue and I am just doing wrong stuff please help me ^^

cannot read property 'plus' of undefined

basically the plugin doesn't seems to be loaded, but its recognised when using plugins.add. I tried reading tilemap from this. and this.game. Cant seem to find the loaded plugin. I have stolen code from your demo to see if I could make it work.

do you mind taking a look at my code? sorry for the trouble and thanks for this amazing plugin :)

https://github.com/Raagh/a-game-needs-no-name

npm install && npm run web

Support for Phaser 3?

I see this project hasn't been updated in over 6 years. Any plans to add support for Phaser 3?

Any quick tips or thoughts about what it would take to support Phaser 3?

Thank you for your work!

Hi!
Thank you a lot for your efforts !! This is exactly what I needed ! I'm sorry, I posted an issue before , and I found a solution ( it was due to the compression system I used in Tiled... and it wasn't due to anything in your work.)
I'm really sorry for the troubles.

Thank you again !

Cannot read property 'properties" of null

I tried to get it work with Ninja physics, but that always gave me the error: "Cannot set property 'game' of undefined" in phaser-ninja.physics.js.

Since I'm not using a lot of ninja physics yet, I tried it without, but now I always get:
"Cannot read property 'properties' of null" in phaser-tilemap-plus.js.

Did I forget something in the installation?

`tilemap.removeTile` etc operations don't modify `plus.tileAnimations`

I realize this is a nice-to-have, but would make using animations more plug-and-play:

When calling this.tilemap.removeTile(x, y, layer) (or "swap", "randomize", etc...), the corresponding this.tilemap.plus.tileAnimations[*].tileLocations[*] doesn't get "corrected".

I've currently got a crude external approach:

// keys: 23-27
// spear: 28
// dagger: 29
// money: 30
if (itemsTile && itemsTile.index >= 23 && itemsTile.index <= 30) {
    this.tilemap.removeTile(
        this.player.x,
        this.player.y,
        this.itemsLayer,
    );

    // remove rotating "key" animation?
    if (itemsTile.index >= 23 && itemsTile.index <= 27) {
        const anim = this.tilemap.plus.animation.tileAnimations.find(
            animation => animation.frames[0].tileId === 22,
        );
        const ind = anim.tileLocations.findIndex(
            location =>
                location.x === this.player.x &&
                location.y === this.player.y,
        );

        anim.tileLocations.splice(ind, 1);
    }
}

But would be sweet to have removeTile patched to remove "any tileLocations at given coordinates where tileAnimations' frames contains index".

And while typing this, I just realized that I could just as well override TileMap.prototype.removeTile and make this less clunky...

Maybe I'll send along a PR ๐Ÿ˜œ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.