Foxy Game Prototype
Collect cherries and crystals.
Each cherry gives you 1 point, and each crystal gives you 5!
Collect them all and go home!
About object-oriented programming.
My project uses OOP in the following points:
1. Encapsulation - protection and management of data within objects.
In the project, each component stores and manages its data independently. For example, the game manager has its own counters of points and collected items, but the player cannot directly change these counters - he accesses the manager through special methods.
2. Inheritance - creating common templates and specialized versions.
All collectible items in the game - cherries and diamonds - have a common base template. It describes how the item should behave when it is collected.
3. Polymorphism - universal access to different objects.
The game works with different collectibles through a common interface, without thinking about what kind of object was picked up - a cherry or a diamond. When the player collects an object, the same method is called, but for each object it performs its own unique logic.
4. Abstraction - highlighting the main thing, discarding the details.
I have isolated the general properties and behavior of the collected objects into an abstract class, which specifies what exactly each object should be able to do, but does not say how exactly. The specific implementation remains with the heirs. This helps to structure the code and sets clear rules for new objects.
Published | 23 days ago |
Status | Released |
Platforms | HTML5 |
Author | Anastasia Jarbus |
Genre | Adventure |
Made with | Unity |