From b2895f2e9f64cf7cc593130980747b045f6abee8 Mon Sep 17 00:00:00 2001 From: Physcik Date: Wed, 7 Jan 2026 02:42:09 +0500 Subject: Build system + world gen settings --- engine/Components/World/Tile.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 engine/Components/World/Tile.go (limited to 'engine/Components/World/Tile.go') 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"` +} -- cgit v1.3