Skip to content

Make game object loading configurable #217

@punchcafe

Description

@punchcafe

This ticket is a WIP

Motivation

Diving in to developing a game, when I want to create a new entity in the game, I have to create a model to represent it, set up listeners to make sure it is instantiated properly, manually set it to the physics manager etc... Realistically, I should be able to define a class which implements a Model interface, and then be able to create objects in TMX with the same type, and it should appear.

For example:

interface GameObjectModel<T> {
  void initialize(ModelConfig<T> someMap){ default imp }; // This would be injected from the values provided in tiled, and the method would have default behaviour for nulls.
}

Also, behaviour resolution between two objects should be handled without having to know about game objects. Something like:

interface BehaviourStrategy<SubjectType> {
  BiConsumer<SubjectType,Object> getBehaviourStrategy(Class anyClass){
    // returns the correct method for resolving collision
  }
}

Ideally, I feel like we don't need to ever handle game objects. This means we can build entire Java models, and everything else is abstracted away

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions