Dante-666 / bouncy-ball

hello world game for g3d development and learning
1 stars 0 forks source link

Implement behaviour by chain of effect. #37

Closed Dante-666 closed 3 years ago

Dante-666 commented 3 years ago

This can be made to work with an object and behaviour enabled/disabled in runtime. Extreme flexibility. How to make m_scene accessible to these behavioral entities could require some thought.

Dante-666 commented 3 years ago

We need a PhysicsEntity decorated by a Chain of Responsibility pattern to allow custom and intertwined effects. Create this and include it in the factory while keeping RigidEntity to avoid merging issues and when done. Add more effects. Less code and more work done.

Dante-666 commented 3 years ago

The design makes sense. First need to add simple behavior to Opaqueness in the Physics realm, whether to make the body ghost-like or Rigid.

  1. In this commit, simply have the utility without many complications and an array of one behavior. Code it in array for now.
  2. (without manager as the effects may need application one after the other) hardcode the Behavior class into the PhysicsEntity but via behavior else it would become the same as RigidEntity and that's what we ought to change.

I should be able to create and manipulate a physics object via PEngine via the scene.any file.