-
Notifications
You must be signed in to change notification settings - Fork 2
NPC Upgrades
The NPCFactory
class provides methods for creating different types of NPC (Non-Player Character) entities in the game. This documentation covers the creation of a special upgrade NPC (penguin) that interacts with players to offer random upgrades. This NPC appears in the game area, and players can press "U" to access the upgrades menu when the press U hover box is shown.
Creates a special upgrade NPC, represented as a penguin, that offers upgrades to the player. The penguin is animated, follows a defined path, and displays a hover box when ready.
Creates a standard NPC entity with basic movement and collision components. This serves as a base for other NPC types.
This class provides factory methods for creating various types of NPCs in the game. It uses different game components, such as physics and AI tasks, to define the behavior and interactions of the created NPCs.
Description: Creates an upgrade NPC that moves to a specified position, displays a hover box when ready, and opens the upgrades menu when U is pressed.
Parameters:
-
firstPosition
: The initial position where the NPC will be placed in the game. -
upgradesDisplay
: The display component that will show the upgrades menu when the NPC is clicked.
Behavior:
- The NPC starts moving to the specified position.
- Once it reaches the destination, the hover box becomes visible, indicating it’s ready to interact.
- When U is pressed, the upgrades menu is displayed.
- NPC will be disposed of after interaction.
Description: Creates a basic NPC entity with physics and movement capabilities.
Parameters:
-
targetPosition
: The position the NPC will move towards.
Behavior:
- The NPC moves along a predefined path and interacts with other game entities based on its components.
-
PhysicsComponent
: Adds properties to the NPC. -
PhysicsMovementComponent
: Enables movement using physics-based controls. -
ColliderComponent
: Sets up collision detection with other entities. -
HitboxComponent
: Defines the hitbox area for interactions.
Description: Spawns the upgrade NPC (penguin) in the forest game area at a specified position.
Parameters:
-
upgradesDisplay
: The display component for showing the upgrades menu.
Behavior:
- The penguin is created using the
createUpgradeNPC
method and spawned at the designated position within the forest game area. - The penguin's position is set based on the
targetPos
vector. - Once spawned, the penguin will move to its initial position and await player interaction.
![Screenshot 2024-10-03 at 8 30 10 AM](https://private-user-images.githubusercontent.com/173228941/373054995-fe89689e-8f12-4efb-aa14-23474d5e11f6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNjExMDQsIm5iZiI6MTczOTM2MDgwNCwicGF0aCI6Ii8xNzMyMjg5NDEvMzczMDU0OTk1LWZlODk2ODllLThmMTItNGVmYi1hYTE0LTIzNDc0ZDVlMTFmNi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMlQxMTQ2NDRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05MmM4OWVmYmVmZWU0NTIxYzY0ZjBiZDZjNmY5YTZmZWQzODg5MjdhYzRlNTNmNTQyM2I1MDk1NjFlYzMzNzlhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.8jD-t96K9ttPitUJ1qofAle9Ai5I0clpv4_4HCP8vs0)
![Screenshot 2024-10-03 at 8 30 36 AM](https://private-user-images.githubusercontent.com/173228941/373055060-14acc0ee-c6be-4873-b5ef-be0c145280c4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNjExMDQsIm5iZiI6MTczOTM2MDgwNCwicGF0aCI6Ii8xNzMyMjg5NDEvMzczMDU1MDYwLTE0YWNjMGVlLWM2YmUtNDg3My1iNWVmLWJlMGMxNDUyODBjNC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMlQxMTQ2NDRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iNDcxYTJjZTE2YjcwMTc2OWRlZDE2NjcwYzZlNTgxNjRjNGU5MzAwODM4OWRhYjRhYTk3MDRkMmM3OWRmODk1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.0yTs4Qb1qhXCwWDpZFHs18zzXqnlsFJ_JOpCKU7XpX0)
The NPCFactory
class provides an efficient way to create and manage special NPCs, like the upgrade-offering penguin. By using predefined components and behaviors, it ensures consistency in NPC interactions and easy integration into different game areas. The spawnPenguin
method can be used to place these NPCs in specific locations, adding variety and interactive opportunities for players within the game.
Inventory System
Scoring System
Food Recipes
Level System
Player Actions
Ordering System
Stations
Items
Map Design
Customers
Pause Menu
Upgrades
End of Day Display
Day Night Cycle
Moral System
Debug Terminal
Game Interactions Tutorial
Backstory Cutscenes
Entities and Components
Input Handling
Game Screens and Areas
Fire Extinguisher Handler Component
MainGameActions Create Docket Triggers
Main Game Order Button Display
BackstoryCutsceneDisplay Test Plan
Test Plan for MainGameOrderTicketDisplay
Test Plan for MainGameOrderBtnDisplay
Test Plan for DocketLineDisplay
Test plan for RandomComboService
Test plan for SpeedBoostUpgrade
Test plan for DancePartyUpgrade