Data Types: Arrays

Objective

Students must use arrays to store and manage collections of game objects and data.

Evidence

Array usage in game components:

  • GameLevelOutside.js - Game object collections
  • GameLevelMaze.js - Maze wall and element arrays
  • Multiple levels - Animation frame arrays

Implementation Details

  • Array literals with bracket notation
  • Indexing to access elements
  • Adding/removing elements (push, pop, splice)
  • Iterating with loops and methods
  • Array methods for transformation

Key Concepts

  • Array indexing and length
  • Array methods: push, pop, shift, unshift, splice
  • Iteration methods: forEach, map, filter, reduce
  • Spread operator for array operations
  • Multi-dimensional arrays (arrays of objects)