GameScore is a new object class introduced in 2023.
It computes the overall score of the game basing on some given parameters and then manages the display of a score screen on the UI when receiving the message "EGP_SHOW_SCORE_RESULTS".
To add a gameScore object in your game level simply choose GameScore class from the Create panel and follow the create from scratch procedure.
The GameScore class object is located into the "Other Objects" page of the Create tool panel
HOW IT WORKS
The GameScore object accumulates the player score during the game. For now the score is computed basing on 2 parameters:
Number of kills: incremented when player kills an enemy.
Completed missions: incremented when player completes a mission.
To make its computations the GameScore needs to be notified when an enemy is killed or when a mission is completed.
This can be done sending two messages to the GameScore:
EGP_INCREMENT_KILLS: to be sent when an enemy is killed.
EGP_INCREMENT_COMPLETED_MISSIONS: to be sent when a mission is ciompleted.
These messages can be sent in the usual way:
By using the GameMachine action sendMessage
By using objects like switches, triggers, counters, timers, Tags, etc...
To calculate the total score the GameScore computes the percentage of the number of kills over the total number of enemies and the number of completed missions over the total number of missions.
The total number of enemies and the total number od mission must be specified by hand.
A mission can be completed itself with a percentage (in case it is composed by goals, see missions).
So the mission total score takes into account also the percentage of completion of every single mission.
Once the total kills score and the total missions score is computed the gameScore computes the final score to assign to the player a medal.
The kind of medal is computed basing on 6 tresholds to be defined by hand and it is represented by 6 different icons. See parameters.
The GameScore also manages the UI screen showing the score results.
It shows the score screen result sequence when it is notified with the message "EGP_SHOW_SCORE_RESULTS".
As for the inventory, this score screen is composed by active elements that are managed by the gameScore object basing on their names.