killertypo/seed — Issue #12: Sprite "Hit Box"
Author: killertypo
Created: 2011-10-20 22:15:43+00:00
State: open
Labels: Engine Logic, Sprites

Sprites need to keep track of not only their size, but their "actual" size, aka the contents within them.

The easiest course of action will probably be to just manually assign a sprite size (height / width) and a sprite hitbox size with xy coordinates that are relative to the sprite.

For example, given SpriteA with the following information
Size: 64x64
Location: 0,0

We know that the SpriteA contains an image of a ball that is only 32x32 pixels. In the current frame the ball is located at the very bottom of the sprite image and centered.
Hitbox size: 32,32
Location (Top Left), 12 ((sprite size - sprite hitbox width) / 16), 32.

We will need to calculate these sprite hit boxes for each and every sprite that it matters. (looking like sprite drawing software that understands this will be very important to have or create).