Shadow Techniques
![Santa Shadow Match](https://games.phoneky.com/pics/santa-shadow-match1x.jpg)
![LOF Shadow Match 2](https://games.phoneky.com/pics/lof-shadow-match-21x.jpg)
![Lof Shadow Match 1](https://games.phoneky.com/pics/lof-shadow-match-11x.jpg)
![Shadow Match Halloween](https://games.phoneky.com/pics/shadow-match-halloween1x.jpg)
![Farm Shadow Match](https://games.phoneky.com/pics/farm-shadow-match1x.jpg)
![Knight Of Light](https://games.phoneky.com/pics/knight-of-light1x.jpg)
![Picolumia v1.2](https://games.phoneky.com/pics/picolumiav121x.png)
![Realtime 3d shadows](https://games.phoneky.com/pics/realtime3dshadows1x.png)
![Ryan Ward's Lunch-Out!!](https://games.phoneky.com/pics/ryanwardslunchout1x.png)
![Stickman Shadow Hero](https://games.phoneky.com/pics/stickman-shadow-hero1x.jpg)
![Stick Shadow Fighter Legacy](https://games.phoneky.com/pics/stick-shadow-fighter-legacy1x.jpg)
![aajibi (512b intro)](https://games.phoneky.com/pics/aajibi512bintro1x.png)
![Star-Cat](https://games.phoneky.com/pics/starcat1x.png)
![Bob of Thunder](https://games.phoneky.com/pics/bobofthunder1x.png)
![Animation through Palette Cycling](https://games.phoneky.com/pics/animationthroughpalettecycling1x.png)
![Brick Breaker](https://games.phoneky.com/pics/brickbreaker1x.png)
![Convolution shader tests! (full-screen AA counting every pixel)](https://games.phoneky.com/pics/convolutionshadertestsfullscreenaacountingeverypixel23351x.png)
![Pico-Bot v1.3](https://games.phoneky.com/pics/picobotv131x.png)
![The Career of Peter](https://games.phoneky.com/pics/thecareerofpeter1x.png)
![Bracewell Probe Simulator](https://games.phoneky.com/pics/bracewellprobesimulator1x.png)
![Red Outpost](https://games.phoneky.com/pics/red-outpost1x.jpg)
![Baby Hazel Bathroom Hygiene](https://games.phoneky.com/pics/baby-hazel-bathroom-hygiene1x.jpg)
![Bakery Shop](https://games.phoneky.com/pics/bakery-shop1x.jpg)
![Sushi Challenge](https://games.phoneky.com/pics/sushi-challenge1x.jpg)
![Cave Runners!](https://games.phoneky.com/pics/caverunners1x.png)
![The Serpent's Shadow](https://games.phoneky.com/pics/theserpentsshadow1x.png)
![Friendly Dungeon](https://games.phoneky.com/pics/friendlydungeon1x.png)
![The Dead Should Die](https://games.phoneky.com/pics/thedeadshoulddie1x.png)
![Mail Runner](https://games.phoneky.com/pics/mailrunner1x.png)
![The Snowman (Walking in the Air)](https://games.phoneky.com/pics/thesnowmanquotwalkingintheairquot1x.png)
![Minimalizard](https://games.phoneky.com/pics/minimalizard1x.png)
![Equestria Girls Avatar Maker](https://games.phoneky.com/pics/equestria-girls-avatar-maker1x.jpg)
![Dove Trendy Dolly Makeup](https://games.phoneky.com/pics/dove-trendy-dolly-makeup1x.jpg)
![BFF Autumn Makeup](https://games.phoneky.com/pics/bff-autumn-makeup1x.jpg)
![Kitty Beach Makeup](https://games.phoneky.com/pics/kitty-beach-makeup1x.jpg)
![Princess Black Wedding Dress](https://games.phoneky.com/pics/princess-black-wedding-dress1x.jpg)
![Snakeskin Pattern Fashion](https://games.phoneky.com/pics/snakeskin-pattern-fashion1x.jpg)
![St Patrick's Day Princess Challenge](https://games.phoneky.com/pics/st-patricks-day-princess-challenge1x.jpg)
![School Puzzle Book](https://games.phoneky.com/pics/school-puzzle-book1x.jpg)
![Children Games](https://games.phoneky.com/pics/children-games1x.jpg)
![Top Model Fashion Dress Up](https://games.phoneky.com/pics/top-model-fashion-dress-up1x.jpg)
![InsectaQuest-Adventures](https://games.phoneky.com/pics/insectaquest-adventures1x.jpg)
![Ball Blast v1.2 - Mobile friendly](https://games.phoneky.com/pics/ballblastv12-mobilefriendly1x.jpg)
![Fill Pattern Catalogue](https://games.phoneky.com/pics/fillpatterncatalogue1x.png)
![(Touhou Unmei no Hoshi)](https://games.phoneky.com/pics/touhouunmeinohoshi1x.png)
![Egypt](https://games.phoneky.com/pics/egypt1x.png)
![Santa 1080](https://games.phoneky.com/pics/santa10801x.png)
![Spirit Solstice](https://games.phoneky.com/pics/spiritsolstice1x.png)
Shadow Techniques
OVERVIEW
This cart is a bit of a demo of a few shadow methods I've given some thought to. The first two techniques work best at 60fps, but the final technique I think is suitable at any speed.
UPDATE
The original cart had an issue where the 'peekpoke merge' technique could not draw starting at odd numbered X coordinates. This has been fixed (but made things a bit more complicated)
METHODS
1 ONOFF SPRITE:
This method uses a solid shadow sprite that cycles between onoff every frame
2 ALTERNATE PATTERNED SPRITE:
This method uses two sprites with an alternating pattern that is cycled every frame
3 PEEKPOKE MERGE:
This is what I really wanted to get to :) This method uses a defined palette of darker colours. Each PICO-8 colour is given a darker alternative. For some, that is full black, but for 8 (red), it is given dark purple (2).
The shadow sprite is read in from PICO-8's memory and every pixel that is not black is considered shadow, and black is ignored.
The draw coordinates for the shadow are read from memory in the graphic area, the existing colour values are determined and are replaced with their darker version wherever there is shadow pixel in the sprite
The new darker pixels are poked back into memory
CONTROLS
O: Cycle shadow method
X: Cycle background
Down: Toggle background scrolling