© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2024
W. Wang, T. WalcottProgramming for Game Designhttps://doi.org/10.1007/979-8-8688-0190-7_9

9. Understanding Dictionaries

Wallace Wang1   and Tonnetta Walcott2
(1)
San Diego, CA, USA
(2)
El Cajon, CA, USA
 

Every program needs to store data and that data usually gets stored in one or more variables. However, the more data a program needs to store, the more variables you need to create. Even worse, multiple variables make it hard to know which variables might be related to one another. This is why it is important to declare variables early on and to make your program as simple as possible.

Two ways to avoid using multiple variables are to use an array or a dictionary. ...

Get Programming for Game Design: A Hands-On Guide with Godot now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.