mcgivrer / monoclass2

This small Java project with only one (master) class is a proof-of-concept of an over simplified java program to deliver maximum feature in a minimum number lines of code, and WITHOUT dependencies out of the JDK itself (but only for test purpose, using JUnit and Cucumber). (Note: subclasses were dispatch into package since july 2022)
MIT License
1 stars 0 forks source link

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

Open mcgivrer opened 2 years ago

mcgivrer commented 2 years ago

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 tuplesname: {x,y,tw,th,time,resource} where