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 new keyword 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 new operator
  • Constructor parameters for object configuration
  • Object state initialization
  • Reference management for game entities