Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 The z-space problem of displaying sprites
#18
Well, the layers used when creating the final resulting bitmap may not be 'resized' to suit you, icogil.  But the layers can be controlled as to where the player is when it comes to layering.  By that, I can draw things like a shield  'behind' the actor if he/she is facing the right of the screen.  And the shield draws 'over' the actor when facing left.  So my 'layering' system that happens automatically is now working.

  # CONSTANT SLOTS
  # ==============
  # Add, remove or change the value of constants to match the slots
  # used in your system.
  # ======================================================================
    BODY        = 0 # (FAKE SLOT) Reserved for the Subject's body
    RIGHT       = 1 # Slot for the Right hand ... weapon
    LEFT        = 2 # Slot for the Left Hand  ... weapon or shield
    HELMET      = 3 # Slot for the Helmet
    ARMOR       = 4 # Slot for the Armor
    ACCESSORY   = 5 # Slot for the Accessory

  # SLOT ORDER STYLE
  # ================
  # This array defines the order in which your graphics are drawn based
  # on the slots.  Easy to use, just fill in with the IDs of the contants
  # defined above.
  # ======================================================================
    ORDER_STYLE[2] = [ BODY, ARMOR, HELMET, ACCESSORY, LEFT, RIGHT]
    ORDER_STYLE[4] = [ BODY, ARMOR, HELMET, ACCESSORY, LEFT, RIGHT]
    ORDER_STYLE[6] = [ LEFT, BODY, ARMOR, HELMET, ACCESSORY, RIGHT]
    ORDER_STYLE[8] = [ BODY, ARMOR, HELMET, ACCESSORY, LEFT, RIGHT]


The first section, the CONSTANT SLOTS section, lets you identify the equipment slots.  Not really hard to understand, you have five equipment slots in your game including your weapon, so the RIGHT hand is your weapon and the LEFT is typically your shield  *No suggesting left-handers, guys!!  And for convenience, I just set up a constant for the default actor sprite, the BODY slot.

The second section, the ORDER STYLE section, allows you to define the way all the graphic layers are applied based on the direction your sprite is facing. So visibly show, we have four arrays indicating if the sprite is facing down, left, right and up.  Most of the time, it would be the same... or you would ASSUME it would be the same. But when the sprite faces right (6), then the way the graphic layers are put together changes... the item (shield) in the LEFT slot is drawn first before even the character's body... so it is hidden behind the character.

Yes. This means that the graphics are updated, not only when your characters' equipment changes, but when your sprite(s) change direction. Already tested and it is quite nice.

The beginning of true layering!

More cleaning and work needs to be performed.  But after that, methinks 'sizes' may be next?
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png] [Image: liM4ikn.png] [Image: fdzKgZA.png] [Image: sj0H81z.png]
[Image: QL7oRau.png] [Image: uSqjY09.png] [Image: GAA3qE9.png] [Image: 2Hmnx1G.png] [Image: BwtNdKw.png%5B]
Above are clickable links

Reply }


Messages In This Thread
RE: The z-space problem of displaying sprites - by DerVVulfman - 02-22-2023, 10:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Problem with drain script form the ATOA ACBS Djigit 2 4,956 07-12-2015, 09:17 PM
Last Post: Djigit
   Event collision problem with FPLE script ThePrinceofMars 2 5,269 11-11-2014, 06:30 PM
Last Post: ThePrinceofMars
  Custom meter problem daylights 13 14,203 08-12-2013, 03:34 AM
Last Post: daylights
   [RUBY] Depack Thread Problem Narzew 1 3,957 07-20-2012, 01:16 PM
Last Post: Narzew
   Advantages & Charlie Fleed CTB problem Yin 7 10,782 12-12-2011, 03:45 PM
Last Post: Yin
   Charlie Fleed's CTB - Problem with dual wielding characters MegaPowerNinja 2 5,311 04-25-2011, 09:51 AM
Last Post: Charlie Fleed
   Slight problem with Omega Quest script. Boot 4 7,797 03-08-2011, 02:53 AM
Last Post: BlackDragon 31
   Help on an old problem. Yin 5 8,434 12-07-2010, 02:55 AM
Last Post: Yin
   AMS script problem Thehero 2 5,944 05-18-2010, 07:30 AM
Last Post: Jaberwocky
   Window Visibility Problem computerwizoo7 7 10,150 05-10-2010, 05:53 PM
Last Post: deValdr



Users browsing this thread: