OpenSNES
Modern Open-Source SNES Development SDK
Loading...
Searching...
No Matches
kit.c File Reference
#include <snes.h>
#include <snes/map.h>
#include <snes/object.h>
#include "res/kit.inc"

Macros

#define FRAME_FALL   25
#define FRAME_IDLE   0
#define FRAME_RISE   23
#define FRAME_WALK   4
#define KIT_ACCEL   0x0038
#define KIT_DRAW_DX   (-8)
#define KIT_DRAW_DY   (-14)
#define KIT_HIJUMPING   0x0594
#define KIT_JUMPING   0x0394
#define KIT_MAXACCEL   0x0140

Functions

static void kitfall (void)
static void kitframe (u16 f)
void kitinit (u16 xp, u16 yp, u16 type, u16 minx, u16 maxx)
 Create the player object (object type 0) at a map position.
static void kitjump (void)
void kitupdate (u16 idx)
 The player's per-frame update: input, collision with slopes, animation, camera.
static void kitwalk (void)

Variables

u8 flip
u8 kitfidx
u8 kitflp
u16 kitid
u16 kitx
u16 kity
u16 nbobjects
 Shared sprite palette for all entity types (BGR555).
u16 pad0

Macro Definition Documentation

◆ FRAME_FALL

#define FRAME_FALL   25

◆ FRAME_IDLE

#define FRAME_IDLE   0

◆ FRAME_RISE

#define FRAME_RISE   23

◆ FRAME_WALK

#define FRAME_WALK   4

◆ KIT_ACCEL

#define KIT_ACCEL   0x0038

◆ KIT_DRAW_DX

#define KIT_DRAW_DX   (-8)

◆ KIT_DRAW_DY

#define KIT_DRAW_DY   (-14)

◆ KIT_HIJUMPING

#define KIT_HIJUMPING   0x0594

◆ KIT_JUMPING

#define KIT_JUMPING   0x0394

◆ KIT_MAXACCEL

#define KIT_MAXACCEL   0x0140

Function Documentation

◆ kitfall()

void kitfall ( void )
static

◆ kitframe()

void kitframe ( u16 f)
static

◆ kitinit()

void kitinit ( u16 xp,
u16 yp,
u16 type,
u16 minx,
u16 maxx )

Create the player object (object type 0) at a map position.

◆ kitjump()

void kitjump ( void )
static

◆ kitupdate()

void kitupdate ( u16 idx)

The player's per-frame update: input, collision with slopes, animation, camera.

◆ kitwalk()

void kitwalk ( void )
static

Variable Documentation

◆ flip

u8 flip

◆ kitfidx

u8 kitfidx

◆ kitflp

u8 kitflp

◆ kitid

u16 kitid

◆ kitx

u16 kitx

◆ kity

u16 kity

◆ nbobjects

u16 nbobjects
extern

Shared sprite palette for all entity types (BGR555).

Running count of active objects in the level.

Initialized to 1 (Kit is always object 0) and incremented as enemies are loaded from the map's object layer by objLoadObjects().

◆ pad0

u16 pad0