diff options
| author | Physcik <mynameisgennadiy@vk.com> | 2026-01-07 02:42:09 +0500 |
|---|---|---|
| committer | Physcik <mynameisgennadiy@vk.com> | 2026-01-07 02:42:09 +0500 |
| commit | b2895f2e9f64cf7cc593130980747b045f6abee8 (patch) | |
| tree | b1b3862bf835050bfbab573288248de37d5a0d2e /engine/Components/World/Tile.go | |
| parent | 284b235a8f7672090bc4f31e56d451bb21d8ee55 (diff) | |
Build system + world gen settings
Diffstat (limited to 'engine/Components/World/Tile.go')
| -rw-r--r-- | engine/Components/World/Tile.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/engine/Components/World/Tile.go b/engine/Components/World/Tile.go new file mode 100644 index 0000000..203d40d --- /dev/null +++ b/engine/Components/World/Tile.go @@ -0,0 +1,31 @@ +package world + +import rl "github.com/gen2brain/raylib-go/raylib" + +// The square that will be displayed at the screen +type Tile interface { + Update() + Draw() +} + +type StandardTile struct { + X float32 + Y float32 + ParentWorld *World + Descriptor TileDescriptor +} + +func (base *StandardTile) Update() { +} + +func (base *StandardTile) Draw() { + rl.DrawTexture(base.ParentWorld.Textures[base.Descriptor.TextureId], + int32(base.X) * int32(base.ParentWorld.TileSize.X), + int32(base.Y) * int32(base.ParentWorld.TileSize.Y), + rl.White) +} + + +type TileDescriptor struct { + TextureId int `json:"textureid"` +} |
