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

Sprite state structure holding position, animation, and direction. More...

Public Attributes

u8 flipx
u16 gfx_frame
u8 state
s16 x
s16 y

Detailed Description

Sprite state structure holding position, animation, and direction.

Combines all per-sprite data into one struct. On the SNES, each OAM entry only stores position and tile number — animation state must be tracked separately in RAM and used to compute the correct tile each frame.

Member Data Documentation

◆ flipx

u8 Monster::flipx

Horizontal flip flag: 1 = mirror sprite for left-facing

◆ gfx_frame

u16 Monster::gfx_frame

Current tile number to display in OAM

◆ state

u8 Monster::state

Current direction (SpriteState enum value)

◆ x

s16 Monster::x

◆ y

s16 Monster::y

Screen position in pixels (signed for off-screen clamping)


The documentation for this struct was generated from the following file:
  • /home/runner/work/opensnes/opensnes/examples/sprites/animated_sprite/main.c