×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

shadows

shadows

(OP)
on several games i've seen, the are around a sprite is a darker shade, in the shape of the sprite that's on the ground tile.  does anyone know how to do this?  

RE: shadows

I am not sure but maybe you create a Shadow Sprite??

RE: shadows

They probably drew the sprite pixil by pixil.  They probably used something like this.

FOR x = 0 TO 10   'lets use round numbers
 FOR y = 0 TO 10
  IF sprite%(x,y) THEN
    PSET (spx%+x,spy%+y),sprite%(x,y)
    PSET (spx%+x+2,spy%+y+2), shadow%(POINT(spx%+x+2,spy%+y+2))
 NEXT
NEXT

where they have a tabel made of the shadows for all of the colours

RE: shadows

(OP)
binarycoder: maybe it could work, but have you ever played quest for a king by sjzero? (demo) it utilizes shadows like this: it shows all the sprites.  then below them is them upside down, except, say below the sprites is a grass tile with all these shades of green.  the shadow is basically the same grass tile but with deeper shades of green, like a real shadow. (you don't really see real shadows all black or grey.  it's just a deeper shade of those colours.)  i'm guessing it's palette manipulation, and was just wondering if anyone knew about how it worked.  

RE: shadows

Try this in screen 13

a% = POINT (x%, y%)
IF a% > 31 AND a% < 183 THEN
   PSET (x%, y%), a% + 72
ELSEIF a% < 32 AND a% > 14 THEN
   PSET (x%, y%), a% + 1
ELSEIF a% > 182 THEN
   PSET (x%, y%), 0
END IF

The colours 0 - 14 are oddballs you will have to assign shadows to them, but the ones above will be dead-on, this is using the default palettes for screen 13.

RE: shadows

(OP)
heh, i never really thought of that.  I just remembered that the palette i'm working with is a gradient (e.g. say colour 20 is a very dark green, colour 40 would be a very bright green.)  i'm trying to make a very flexible engine in pure qb, and thought that shadows would be a nice touch (wonder why i keep wanting to type real-time shadows?)

RE: shadows

(OP)
the only thing that would be a problem i guess would be the rotations.  I mean, i don't want to waste space making dozens of upsidedown tiles, so i suppose that it would work better if i use sin and cos tables to rotate.  then again, i'll probably use them for spell effects and particles anyways, and i guess if i make tables, the slowdown won't be bad, so i guess that'll work.  

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close