This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-10-19 13:45:05

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Realtime 2D shadowing with any sprite!

This project generates an extremely realistic shadow for 2D scratch can using the pen tool and a list for object data. Object Data is predetermined for this demo (so you don't have to wait 500 years), but to recalculate it center the cat and change the state to 2, and center the cat. You can change the sprite for this by changing the Y-size variable to match the Costume's Y Size and then re-generating the object data. This engine was inspired by DarthPickley's 111 Costume version, but this project only uses one 1x1 black square and a list 'o data. Shadows are generated within 1 second.

Clicky

Use the Left and Right arrows to move the cat left and right, and press the up arrow to make the character (very badly) jump.

Please review, love and remix it with lots of different sprites etc. I want to text the expandability of the engine with different sprites.  smile

PS: This will not work well with sprites with spaces on the Y axis. (eg. cut horizontally)

Offline

 

#2 2009-10-20 13:07:00

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Realtime 2D shadowing with any sprite!

Updated with new formula, and much faster! Shadows now extend above the character's original Y scale also.

Offline

 

Board footer