Animation Key Constants

Demonstrates organizing animation keys into a central constant object to manage asset strings safely and avoid typos throughout a project.

1024 × 768
GitHub
const ANIMATION_KEYS = {

    PLAYER_LEFT: 'player-left',
    PLAYER_RIGHT: 'player-right',
    PLAYER_IDLE: 'player-idle',
    
    COIN_SPIN: 'coin-spin',
    CHICK_WALK: 'chick-walk',
    CAKE_WALK: 'cake-walk',
};

export default ANIMATION_KEYS;

More in My First Game5 examples