Masynchin / tiles

Zen game
https://masynchin.github.io/tiles/
MIT License
0 stars 0 forks source link

Easier system for tile creating #2

Closed Masynchin closed 2 years ago

Masynchin commented 2 years ago

Doing this plain tiles for Field tests... :

let top = tile true false false false
    right = tile false true false false
    bottom = tile false false true false
    left = tile false false false true

... I came to think that it should be done other way. Here is the prototypes:

empty :: Tile
empty = Tile { top :: false, right :: false, bottom :: false, left :: false}

top :: Tile
top = Tile { top :: true, right :: false, bottom :: false, left :: false}

right :: Tile
right = Tile { top :: false, right :: true, bottom :: false, left :: false}

bottom :: Tile
bottom = Tile { top :: false, right :: false, bottom :: true, left :: false}

left :: Tile
left = Tile { top :: false, right :: false, bottom :: false, left :: true}
topLeft = top `intersect` left

But I think it can be done another way. We need to think about it.