Skip to content

Create Mobs #82

@Glebanister

Description

@Glebanister

Create variations of mobs: Player and Enemy

They should be instances of the class Mob. Mob class have health and it should be able to take damage from an attack. They should be controlled by a Controller object, which will be stored in LevelRunner.

You also should think about how the attack will work, and what properties the attack will have. Remember, that sometime this system should be able to support long-distance attacks, for example.

Earlier, we discussed how the attack should work:

  • Controller fins out that an attack should be initiated (some key is pressed for player or enemy controller detected that 'player' is too close to the enemy)
  • The Controller detects all attack parameters (force, for example, or maybe something else)
  • It sends an Intent to the world, that all mobs in the particular radius should accept some damage

It looks like a legit scheme, but you can modify it.

In this task, you should start creating the game itself. Therefore, all hard-coded elements (player and enemy controllers, for example) should be put in the ./game directory.

  • Add tags to the Entity object
  • Create TagFilter, which will filter entities with a particular tag
  • Create Mob class
  • Create Controller interface
  • Create a Filter, which will filter entities in some radius (to detect which enemies are under attack)
  • Create a separate executable for your experiments with Player and Enemies
  • Implement a Player's controller, which will move the player when the left and right buttons are pressed. Player - a mob, which have a "player" tag. It should also attack every enemy (a Mob with an "enemy" tag) in the given radius when some button is pressed.
  • Implement an Enemy Controller, which will attack the entity with the tag "player" when the Player is too close to the Enemy

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions