CS111: Object-Oriented Programming - Instantiation & Objects
Creating and configuring game objects in level setup
Instantiation & Objects
Objective
Students must demonstrate the ability to create instances of classes and configure them for use in the game.
Evidence
Objects created and configured in level setup:
- GameLevelOutside.js - Creates Player, NPCs, and game element instances
- GameLevelMaze.js - Configures maze layout with multiple object instances
Implementation Details
- Using
newkeyword to instantiate classes - Passing configuration objects to constructors
- Storing references to instances for later access
- Initializing object properties and state
Key Concepts
- Instance creation with
newoperator - Constructor parameters for object configuration
- Object state initialization
- Reference management for game entities