demoth / jake2

Quake 2 java port
GNU General Public License v2.0
59 stars 9 forks source link

[PREVIEW] Kotlin game entities: func_door #81

Closed demoth closed 1 year ago

demoth commented 1 year ago

An attempt to structure and improve the game mechanics code. (Most probably, this is not the final state of the entities)

Entities in scope: func_door, func_door_rotating, func_secret_door.

The usage of Ent*Adapter abstract classes are replaced with elegant lambdas register*(id) { ...

Behaviour of entities is not changed.

The scope of door functions are now bound to the Doors.kt file, exposing only spawning functions (plus couple of functions reused in other entities. Did you know that func_water is actually func_door?)