Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiled: using polygon from object layer to create transparent collision object #210

Closed
tchex opened this issue Dec 4, 2021 · 8 comments
Closed

Comments

@tchex
Copy link

tchex commented Dec 4, 2021

Hello and thank you for your great work. It is really nice and powerful to work with bonfire.
Is it possible to create a polygon in Tiled (object layer) and to define it as a collision object with bonfire ?
For example, on a beach, create a polygone around the sea, to force player to stay on the beach.
Thanks !

@RafaelBarbosatec
Copy link
Owner

RafaelBarbosatec commented Dec 6, 2021

Hi @tchex !
Thanks so much!
Create an object with collision in Tiled is not possible in the moment. You can add collision by Tiled in your tiles in your tileset. Currently, when I want to make a collision of this type, I place a collision on a transparent tile and add it to the options where I want it to have a collision.

This is a good idea. I will think a way of the implements this feature.

@tchex
Copy link
Author

tchex commented Dec 6, 2021

Hi @RafaelBarbosatec,
Thank you, I will use the transparent tiles.
I look forward to seeing your implementation as it will allow to create barriers, paths.. very easily and activate / unactivate these objects programatically. (forbidden area until quest finished..)

@RafaelBarbosatec
Copy link
Owner

Hi @tchex !
This features is available in version 1.12.2.
Only set in type object to collision in your ObjectLayer of the Tiled.
The Bonfire will add a CollisionGameComponent.

@tchex
Copy link
Author

tchex commented Dec 14, 2021

Hi @RafaelBarbosatec!
That's great! Not tested yet, but thanks for your work. I guess Bonfire will have more and more success as Flame is now part of flutter official.

@tchex
Copy link
Author

tchex commented Dec 16, 2021

Hi @RafaelBarbosatec,
Thanks again: I tried and it works!
But not perfectly. Object is not placed at the right place. And sometimes disappears.. It seems to happen when a corner of the shape is out of the screen but not the object. (my object is way larger than the screen). I will try to do more tests to give you some better feedback.

@RafaelBarbosatec
Copy link
Owner

Right, I'll test more this case to find this problem.
Thanks for reporting. 😊

@RafaelBarbosatec
Copy link
Owner

Hi @tchex !
I think what i found this problem. Please could test again with 1.12.3 version.

@tchex
Copy link
Author

tchex commented Dec 19, 2021

Hi @RafaelBarbosatec !
Yes, no problem anymore. Thanks a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants