Is a list of all tiles possible?

Generating Empty Tilemaps in Runtime!
Ok, so, I’ve been working on this for a bit, but to use a tile in the tilemap, it must be added to the list on line 23. I don’t want to have to do that. That’s the problem:
Is there a way to get all constants defined in the namespace “myTiles”? (myTiles.tile1…2… etc, but only if they exist)
I’ve tried a few things, but the docs for pygame are… interesting, to say the least. I like the old look, even though it hurts my eyes.
It doesn’t look like dir() exists. Though I would like to say I have only recently started coding with… code instead of blocks, so please don’t just give an answer cause I need an explanation if I’m ever gonna learn anything.
I have a feeling this would be possible if I made an extension… just based on the fact that the arcade-tile-util extension literally modifies this code to add myTiles.transparency8… yeah… a big thanks to anyone with a solution!!

2 Likes

I’m confused; pygame?
Are you trying to make a list of every tilemap location or every type of tile?

1 Like

Sorry, this is an impossible thing to do because Makecode does not support it. I was trying to get a list of all tile types (myTiles.tile1… etc).

1 Like

I think so, there is a certain block in the tile util extension, maybe you could use it.

1 Like

why not this?


Depending on what tile you got returned you could do diffrent things?

1 Like

Omg I love how you’re all trying to help! Unfortunately, as I said, it is IMPOSSIBLE in Makecode. This is the topic where Richard explains that it’s impossible
You can scroll down a bit to see Richard’s explanation.

1 Like