Loading...
Searching...
No Matches
Monster Struct Reference

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

Public Attributes

u16 anim_delay
 
u16 anim_frame
 
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

◆ anim_delay

u16 Monster::anim_delay

Frame counter for animation timing (counts up to ANIM_DELAY)

◆ anim_frame

u16 Monster::anim_frame

Current frame index within the walk cycle (0 to FRAMES_PER_ANIMATION-1)

◆ 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: