mcgivrer / mcgivrer/monoclass2

Feat(Animations): In TileMapLoader implements animations loading for Entity

Open
#76 0 comments 0 reactions 1 assignee View on GitHub

@mcgivrer is already working on this.

Since Oct 19, 2022.

documentation enhancement
Dominant language
Java
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

TileMapLoader

The existing TileMapLoader is already loading entities with a fixed image.

Animations definition

We need to implement animation loading to get a fully implemented level loading.

Here is the awaiting attributes format:

level.objects.9=name:player;\
     //...
    animations:{\
        idle:{x:0,y:0,tw:32,th:32,time:[450, 60, 60, 250, 60, 60, 60, 450, 60, 60, 60, 250, 60],resource:3},\
        walk:{x:0,y:32,tw:32,th:32,time:[60, 60, 60, 150, 60, 60, 60, 150],resource:3},\
        jump:{x:0,y:160,tw:32,th:32,time:[60, 60, 250, 250, 60, 60],resource:3},\
        dead:{x:0,y:224,tw:32,th:32,time:[160, 160, 160, 160, 160, 160, 500],resource:3}\
    };\
    defaultAnimation:idle

Animations attribute will be a JSON formatted list of tuples name: {x,y,tw,th,time,resource} where

  • name is the animation id used in code to activate specific animation (standardization must be provided),
  • {x,y,tw,th,time,resource} is a position (x,y) in a resource, a frame size (tw,th), and a list of time frames defining the number of concerned frames indirectly for that animation. The constraint is that all frames must be on the same row in the resource image.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.