OpenSNES
Modern Open-Source SNES Development SDK
Loading...
Searching...
No Matches
GameState Struct Reference

Centralized game state structure. More...

Public Attributes

s16 bg1_scroll_x
s16 bg1_scroll_y
s16 bg2_scroll_x
s16 bg2_scroll_y
Entity bullets [8]
Entity enemies [8]
u8 fire_cd
u16 frame
s16 player_x
s16 player_y
u16 prng
u16 scroll_y

Detailed Description

Centralized game state structure.

Coordinates are s16 because the scroll thresholds subtract and compare them: a signed type keeps "left of the threshold" a plain <.

Member Data Documentation

◆ bg1_scroll_x

s16 GameState::bg1_scroll_x

BG1 horizontal scroll offset

◆ bg1_scroll_y

s16 GameState::bg1_scroll_y

BG1 vertical scroll offset

◆ bg2_scroll_x

s16 GameState::bg2_scroll_x

BG2 horizontal scroll offset (parallax: half of BG1's)

◆ bg2_scroll_y

s16 GameState::bg2_scroll_y

BG2 vertical scroll offset

◆ bullets

Entity GameState::bullets[8]

◆ enemies

Entity GameState::enemies[8]

◆ fire_cd

u8 GameState::fire_cd

◆ frame

u16 GameState::frame

◆ player_x

s16 GameState::player_x

Kit's X position (screen coords)

◆ player_y

s16 GameState::player_y

Kit's Y position (screen coords)

◆ prng

u16 GameState::prng

◆ scroll_y

u16 GameState::scroll_y

The documentation for this struct was generated from the following files:
  • examples/demos/shmup/main.c
  • examples/scrolling/continuous_scroll/main.c