Log In  

All the other sprites seem fine but 000 always places for me like its blank.

Here's a gif of the bug in action:

P#20758 2016-05-18 02:44 ( Edited 2016-06-19 17:07)

Sprite 000 is a special case and is always blank/transparent. I usually draw an x in it to remind myself not to use it.

P#20759 2016-05-18 02:51 ( Edited 2016-05-18 06:51)

Haha, I did not know that. That explains it. Thanks.

There's a lot of half-documented stuff out there like this, I would pay handsomely for a richly designed beautiful full colour manual that detailed all of this while just oozing with pixel art and style.

P#20761 2016-05-18 03:30 ( Edited 2016-05-18 07:30)

Cute sprites!

P#20763 2016-05-18 04:35 ( Edited 2016-05-18 08:35)

Haha I didn't know that either, I just learnt to avoid using it because it never worked, thanks for clearing that up :D

P#20765 2016-05-18 05:03 ( Edited 2016-05-18 09:03)

"exception: sprite 0 is always taken to mean empty."

There's also some situations in which pico-8 will put an x there for you, but I'm not quite sure what they are.

P#20771 2016-05-18 08:26 ( Edited 2016-05-18 12:26)

It is tile 0 not sprite 0 which have a special meaning.

When making a map tile0 is alway a full transparent tile, but you can still use it as a sprite!

P#23076 2016-06-17 15:47 ( Edited 2016-06-17 19:47)

As has been said, it's in the manual but easy to miss

P#23078 2016-06-17 16:15 ( Edited 2016-06-17 20:15)

Why it is so anyway? I mean, if I want to clear some part of map, I can just use any other unused (and therefore transparent) tile.

Seriously, it always came to me as an artificial limitation.

P#23094 2016-06-17 21:46 ( Edited 2016-06-18 01:47)

In computer design it's a common thing to have whatever is at 0 to be a null/blank/zero value. You need one such special case (because reasons) and zero is the easiest value to remember.

P#23097 2016-06-18 04:11 ( Edited 2016-06-18 08:11)

As far as I can remember every tile editor since Mappy (1998) has used this method.

P#23117 2016-06-18 10:42 ( Edited 2016-06-18 14:42)

I find it weird that it refers to it as "tile 0", yet Lua is 1-based for indexing. It always throws me off, since I can never seem to recall which is 0-based and which is 1-based, it's rather strange sometimes.

Another weird thing is trying to figure out when it displays the token count versus the character count in the code editor. I think it's supposed to show the char count whenever you're working with an unterminated string, but if I fill the first two or three lines of my code with comments (eg author/date comments) it'll "break" and default to char count for the entire code (unless the first 8-12 characters of the file are actual, usable tokens)

P#23148 2016-06-18 18:24 ( Edited 2016-06-18 22:24)

Danjen: Clicking the count bar will toggle between char count and token count; you probably clicked it by mistake and didn't notice. (It took me ages to notice this too.)

P#23193 2016-06-19 06:34 ( Edited 2016-06-19 10:34)

Ahaha, sure enough that was the problem. I feel like a dummy now. Thanks

P#23199 2016-06-19 09:11 ( Edited 2016-06-19 13:11)

@darkhog:

I can illustrate why it's good to have map tile 0 be forced transparent by the system.

To simplify, let's pretend that the system only provides 4 tiles, shared between map and sprites.

Given that, let's make a simple co-op platforming game with a simple background. We'll call it RGB Infinity.

RGB Infinity has simple solid white blocks for its ground and platforms. Maps need only the solid white tile and a transparent tile.

RGB Infinity has two simple players: a red open parenthesis and a blue close parenthesis.

RGB Infinity has one manic AI the two players have to cooperate to capture between them: a green X.

If we set up our tileset like this:

0 - green X
1 - solid white
2 - red (
3 - blue )

We can then draw the map with this effective tileset:

0 - forced transparent
1 - solid white

And the sprites with this:

0 - green X
2 - red (
3 - blue )

If we didn't have tile 0 forced transparent when used for the map, we'd need this tileset instead:

0 - transparent
1 - solid white
2 - red (
3 - blue )
4 - green X

And, oops, we couldn't fit the game in 4 tiles anymore.

So effectively we get one more usable sprite tile by having the system force map tile 0 to transparent.

P#23212 2016-06-19 12:58 ( Edited 2016-06-19 16:59)
1

As an aside to zep, I think the map editor ought to show tile 0 as transparent in the tileset, regardless of its actual contents, so that the editor will be more wysiwyg.

P#23214 2016-06-19 13:07 ( Edited 2016-06-19 17:07)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 23:32:13 | 0.019s | Q:37