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

Create an integrated tile collision editor for an easy definition of them #18

Closed
DjThunder opened this issue Feb 10, 2014 · 0 comments
Closed
Assignees
Labels
editor Related to editor plugins new New feature or request
Milestone

Comments

@DjThunder
Copy link
Member

Tile collision implementation can only be done from code.
The current way of implementing it is not really complex, but it may be hard to implements more complex collisions (such as link between ground & slope), and also harder to debug it (impossible to show them).

The goal is to allow an easier tile collision definition directly from the collisions.xml file, such as the following examples (tile size = 16, so min=0 & max=15):

  • Simple example
<collision name="GROUND">
    <tiles pattern="4" start="1" end="100"/>
    <function description="ground" y="0">
        <x min="0" max="15"/>
    </function>
</collision>
  • y is the returned collision vertical point
  • min & max are the function range for the horizontal location (where it can be applied)
    Here we defined a ground collision for the complete surface (from 0 to 15), and the return vertical location is at the bottom of the tile (0).

  • More complex example
<collision name="SLOPE_TRANSITION">
    <tiles pattern="4" start="1" end="100"/>
    <function description="ground" y="0">
        <x min="0" max="7"/>
    </function>
    <function description="slope" y="-x/2+8">
        <x min="8" max="15"/>
    </function>
</collision>
  • y is the returned collision vertical point, by considering x as the horizontal location on the tile)
  • Here we defined a complex slope collision:
    • The first half size of the tile is a ground collision at the bottom
    • The last half size of the tile is a slope collision, starting perfectly after the ground one (+8, were the ground ended at 7)

Considering this, it should be easy to display an integrated debug mode for the collisions (by displaying the corresponding function after the map rendering).

It would also be nice to have a visual editor of this function, by using a simple map tile editor, that should be able to import a level rip (already available), define & assign collisions for the desired tiles by clicking on them.

@DjThunder DjThunder added this to the LionEngine 6.0.1 milestone Feb 10, 2014
@DjThunder DjThunder self-assigned this Feb 10, 2014
DjThunder added a commit that referenced this issue Feb 18, 2014
number per collision. Tile collision edition working.
@DjThunder DjThunder modified the milestone: LionEngine 6.1.0 Mar 25, 2014
DjThunder added a commit that referenced this issue Mar 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor Related to editor plugins new New feature or request
Development

No branches or pull requests

1 participant