[Ohrrpgce] Slice tutorial

James Paige Bob at HamsterRepublic.com
Tue Jan 20 13:42:28 PST 2009


On Tue, Jan 20, 2009 at 11:56:22AM -0800, Adam Perry wrote:
>    On Tue, Jan 20, 2009 at 11:53 AM, James Paige <Bob at hamsterrepublic.com>
>    wrote:
> 
>      On Mon, Jan 19, 2009 at 08:52:38PM -0800, S'orlok Reaves wrote:
>      >
>      > I like this approach to slices a lot! In a few releases, I'll
>      incorporate this approach into the OHRRPGCE FMF --it makes a lot more
>      sense.
>      >
>      > Here's an idea: make a slice "insurmountable". If you have:
>      >
>      > parent_slice
>      >     child_slice_1
>      >     child_slice_2
>      >     child_slice_3, (insurmountable = true)
>      >     child_slice_4
>      >     child_slice_5
>      >
>      > ...then, adding a child slice to parent_slice will add it after
>      child_slice_2.
>      >
>      > In this example, slices 3, 4, and 5 might be used to make some complex
>      cursor (with a hat :D), and we want to enforce that new sprites are
>      never added after it.
>      >
>      > By adding the "insurmountable" property, we enforce this. And, if we
>      want to explicitly add child_slice_6 after child_slice_5, we can still
>      iterate to slice_5 and call "add sibling". So everybody wins.
>      >
>      > That's my only suggestion; I feel it makes a lot of sense for cursors
>      and other top-level objects (like hats). What do you think?
> 
>      No, I think it would be easier to do
> 
>      parent_slice
>         container_slice_1
>             child_slice_1
>             child_slice_2
>         container_slice_2
>             child_slice_3
>             child_slice_4
>             child_slice_5
> 
>      > -->Seth
>      > PS: Another use for this flag is if you want to give a sprite custom
>      graphics depending on his armor: always make the helmet
>      "insurmountable", and you can simply add/remove the weapon/armor/helmet
>      slices in any order.
> 
>      I would just make the hero a parent, and all the armor would be children
>      of that parent.
> 
>    Here's my nagging question: what about shields? If the hero is facing
>    down, it's in front of him, but if he's facing up, it's behind.

Ooh, that is a rough one. I see a couple approaches.

1) Since you will be drawing a different shield picuture for up and 
down, just make the "up" shield blank :)

2) Orrrrr, you could arrange the tree like this:

  hero_container
    behind_hero_container
      shield_when_facing_up_sprite
    hero_sprite
    front_of_hero_container
      shield_when_facing_down_sprite

---
James Paige



More information about the Ohrrpgce mailing list