Game Components
The Game Components toolbox has two helpers for realtime games made with Glaze, Divooka's 2D game framework (see Application Framework):
Input Map binds input events, such as a key, to named actions ("jump", "left"). The game asks Is Down or Means for an action rather than for a key, so players can rebind keys with Rebind.
Seeded Random gives random numbers from a seed: Next Between, Next Whole, Next Chance. The same seed gives the same sequence every time, so a level or a replay comes out identical.
Included in: Divooka Explore and Divooka Compute Standard. In Compute, start a document from the Game Development workload, or add the Glaze Realtime reference with Add reference (
Ctrl+Shift+L). The Glaze Realtime reference holds Glaze's part of Application Framework, and Game Components.Maturity: Preview · Support: Tier 3 (proposed) · what these mean
Open it: node library (
Ctrl+Shift+Space) → Game Components, or search for a node withCtrl+Space.Examples and reference:
Ctrl+Shift+E→ Glaze (4 examples) · node reference
New to graphs? Start with Your first program.
Example
Open Glaze > Sky Hopper (Ctrl+Shift+E). Its data members hold an Input Map, which turns key presses into the game's actions, and a Seeded Random, which makes the game's random choices. Because the random numbers come from a seed, the same run plays out the same way every time.
Tips and limits
- Restart puts a Seeded Random back to its first number.
- For one-off random values outside games, see Random in Basic.
What is in the toolbox
| Category | Some of its nodes |
|---|---|
| Input Map | Make Input Map, Bind, Binding At, Binding Count and 9 more |
| Seeded Random | Make Seeded Random, Draws, Seed, Next Around and 5 more |
See also
- Game Components node reference
- Glaze!
- Toolboxes - every other toolbox.