mcgivrer / mcgivrer/fromClassToGame

Entity Loading

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

@mcgivrer is already working on this.

Since Dec 21, 2021.

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

Description

Load Entities from the level map file to create corresponding GameObject's and mapping.

A sample Entity class to understand what the challenge is:

class Entity {
  String id,
  Image image,
  Map<String, Object> attributes;
}

In the level file test-level-entity.lvl:

{
'name':'test-level-tileset',
'entities': { 'pixelsImage':'images/tiles/tiles01.png',
    'items':[
      { 'id':'P',
        'pos':(0,32),'size':(16,16),
        'attributes':{ 'entity':'player', 'life':5, 'energy':100, 'mana':100}
      }
    ]
 }]
}

The Use Case is:

Feature: Loading a Level

  The `LevelLoader` service is dedicated to load objects from a level file and initialize all corresponding entities.

  Scenario: 02- loading a Entities
    Given the LevelLoader is instanciated
    And the level file "test-level-entity.lvl" is loaded
    Then a level named 'test-level-entity' is defined
    And  Level contains 1 Entities
    And the Entity with id 'P' has a 'entity' attribute with value 'player'
    And the Entity with id 'P' has a 'life' attribute with value 5
    And the Entity with id 'P' has a 'energy' attribute with value 100
    And the Entity with id 'P' has a 'mana' attribute with value 100

Contributor guide

No contributing guide indexed for this repository

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.