From a5ce1401312b97fd447d00656b250571c4db4880 Mon Sep 17 00:00:00 2001 From: ewy Date: Thu, 13 Aug 2026 14:18:13 +0200 Subject: use ecs.IsGameObject instead of cast --- objs/cursor.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'objs/cursor.go') diff --git a/objs/cursor.go b/objs/cursor.go index b1fdca3..dd09a8b 100644 --- a/objs/cursor.go +++ b/objs/cursor.go @@ -12,12 +12,24 @@ type Cursor struct { func (c *Cursor) Render(renderer *sdl.Renderer) { renderer.SetDrawColor(255, 0, 0, 255) - renderer.RenderPoint(c.Position.X, c.Position.Y) + r := &sdl.FRect{ + X: c.Position.X - 5, + Y: c.Position.Y - 5, + W: 10, + H: 10, + } + renderer.RenderRect(r) } func (c *Cursor) Process(ev input.Event) { c.Position.X += ev.Dx c.Position.Y += ev.Dy + if c.Position.X < 0 { + c.Position.X = 0 + } + if c.Position.Y < 0 { + c.Position.Y = 0 + } } func (c *Cursor) GO() *ecs.GameObject { -- cgit v1.3.1