Rainer Deyke Demon Hunter
Joined: 05 Jun 2002 Posts: 672
|
Posted: Mon Jul 21, 2003 3:05 pm Post subject: Re: Pixel-Based and Data Storage |
[quote] |
|
Jihgfed Pumpkinhead wrote: |
Incidentally, how would you recommend I store these bounding boxes, if I'm not extrapolating them from the bitmaps at run-time? Just text files?
|
For Feyna's Quest, I store the collision box information with the scripts, not the bitmaps. Sample script:
Code: |
width 64
height 64
immune all
appearance npc 0 0
on interact:
if $Raerl == 0:
story_box(0x0000c0, "\"Too late... Ceiling collapsed... All dead... "
"You need to escape or you will be killed.\"")
story_box(0xc000ff, "\"But how?\"")
play_sound("chimehi")
story_box(0x0000c0, "\"Here, take this key and enter the basement. "
"There you will find... magic portal... But you will need the "
"necklace.\"")
story_box(0x0000c0, "\"The necklace should be in my lab, if the rats "
"haven't gotten it. It is the key to the magic portal. Get it, then "
"step through the portal... It will take you far away...\"")
$Raerl = $Raerl + 1
player_receive("MAGIC_GUILD_BASEMENT_KEY")
else:
story_box(0x0000c0, "\"Go...\"")
if player_has("HEALING_POTION"):
story_box(0xc000ff, "\"But you're hurt. I've got a healing potion...\"")
else:
story_box(0xc000ff, "\"But you're hurt.\"")
story_box(0x0000c0, "\"Don't worry about me. ...already dying... "
"Just save yourself.\"")
|
Objects can change their appearance without changing their bounding boxes (or, less usefully, vice versa).
Of course if you want pixel perfect collision detection, you really want to extrapolate your bounding boxes from your bitmaps. Just beware of entanglements caused by animation.
|
|