User
User System
Overview
The User system is responsible for managing player-related functionalities in the Candy Merge game. This includes handling player settings, movement, and scoring. The system ensures that player interactions and behaviors are managed correctly and interact with other game elements as intended.
Classes
PlayerSettings
A ScriptableObject that contains player settings for the game. This class holds the movement settings for the player, defining how the player moves in the game.
Key Responsibilities:
Movement Settings: Contains the movement settings for the player, such as speed and input method.
Example Use Cases
Configuring Player Movement: The PlayerSettings class can be used to configure how the player moves in the game by adjusting the movement settings.
MovementSettings
A ScriptableObject that holds movement settings for the player. This class defines the input method used to control the movement and the speed at which the player moves.
Key Responsibilities:
Input Method: Defines the input method used to control the movement.
Movement Speed: Specifies the speed at which the player moves.
Example Use Cases
Adjusting Movement Speed: The MovementSettings class can be used to adjust the speed at which the player moves, providing a customizable gameplay experience.
Player
Handles player-specific functionalities and interactions in the game. This class manages the player's state and interactions with other game elements.
Key Responsibilities:
Managing Player State: Handles the player's state and interactions with other game elements.
Example Use Cases
Interacting with Game Elements: The Player class can be used to manage how the player interacts with various game elements, such as candies and obstacles.
PlayerMovement
Handles the player's movement and interaction with the environment. This class manages the player's movement logic, including setting the movement type and updating the player's position based on input.
Key Responsibilities:
Setting Movement Type: Provides methods to set the movement type for the player.
Updating Player Position: Updates the player's position based on input and movement logic.
Example Use Cases
Setting Movement Type: The PlayerMovement class can be used to set different movement types for the player, such as simple movement or no movement.
Updating Player Position: The PlayerMovement class updates the player's position based on input, ensuring smooth and responsive movement.
Movement
Abstract class that provides base movement logic. This class defines the basic movement behavior and can be extended to create specific movement types.
Key Responsibilities:
Base Movement Logic: Provides the base logic for moving an object along the x-axis within specified bounds.
Example Use Cases
Creating Custom Movement Types: The Movement class can be extended to create custom movement types, such as simple movement or no movement.
SimpleMovement
Represents a simple movement behavior where the object moves based on the provided speed and time. This class extends the Movement class and implements the movement logic.
Key Responsibilities:
Moving Object: Moves the object based on speed and fixed delta time.
Example Use Cases
Implementing Simple Movement: The SimpleMovement class can be used to implement a straightforward movement behavior for the player.
NoMovement
Represents a no-movement behavior where the object's position remains unchanged. This class implements the IMovement interface and provides the logic for no movement.
Key Responsibilities:
No Movement Logic: Returns the current position of the object, indicating no movement.
Example Use Cases
Implementing No Movement: The NoMovement class can be used to implement a behavior where the player does not move.
Score
Handles the scoring system for the player. This class manages the player's score and interactions with the scoring system.
Key Responsibilities:
Managing Player Score: Handles the player's score and interactions with the scoring system.
Example Use Cases
Updating Player Score: The Score class can be used to update the player's score based on their actions and achievements in the game.
By using the User system, you can manage various player-related functionalities in the Candy Merge game, such as player settings, movement, and scoring, providing a comprehensive and engaging gameplay experience for players.
Last updated