RPGDXThe center of Indie-RPG gaming
Not logged in. [log in] [register]
 
 
Post new topic Reply to topic Goto page Previous  1, 2 
View previous topic - View next topic  
Author Message
Rainer Deyke
Demon Hunter


Joined: 05 Jun 2002
Posts: 672

PostPosted: 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.
Back to top  
Post new topic Reply to topic Page 2 of 2 All times are GMT
Goto page Previous  1, 2 



Display posts from previous:   
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum