Pulp how-to: faking "alpha" on your Player

NOTE: As of March 2022, Pulp player tiles—note, only player tiles—support transparency! The method below might still be useful for other sprites in your game.

Pulp tiles don't include transparency; pixels are black or white. This means that if your Player steps onto a tile that's something other than their own background color, they'll appear to be trapped in a box:

image

The rug in the background is dark, but the Player is still drawn on a white background.

A simple way to fix this is to take account of all the backgrounds your Player can step onto, and make new Player tiles where they're drawn on top of that background. This might sound a bit goofy and manual, but Pulp solutions are often this way: brute force at its best :slight_smile:

Here's a demo Pulp game that shows this effect. The game has you as a chicken in a little yard with a pond and a bridge.

image

The bridge is made of 3 different tiles types (top, middle, and bottom.) Each tile implements a tiny script to tell the Player to change to the appropriate appearance. The neutral "ground" tile does the same for when you step back onto land.

image

Not much to it, but maybe it helps someone! Here's the Pulp game:

Alpha Tutorial.json.zip (3.4 KB)

13 Likes

This is absolutely clever! Thanks for the tips Neven! Now if I only knew how’d this work with stick figures… Lol

Very clever indeed. :clap:

NOTE: As of March 2022, Pulp player tiles—note, only player tiles—support transparency! The method above might still be useful for other sprites in your game.

4 Likes

Hi @neven ,

How do we enable transparency for player tiles? I can't see a flag or anything in the editor, but perhaps i'm being dense and/or blind? Does this need toggling in pulpscript somehow?

There is now an eraser tool between the pencil and the fill bucket. You might need to refresh your tab if it has been open since before the update?

1 Like

Nice one, cheers Scott!