diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-11 17:49:04 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-11 17:49:04 -0400 |
| commit | 1f6e586b2a3fe7f8ca32ce95659032bafef0ad24 (patch) | |
| tree | 49b6633bf0693952153f12e8ed4dce1dae1443cc /examples/game/box.tm | |
| parent | fb2d7b5379663e929ffabfbd8428de5b35ad67c4 (diff) | |
Support external structs with namespaced methods (also C-strings are now
`const char*` instead of `char*`)
Diffstat (limited to 'examples/game/box.tm')
| -rw-r--r-- | examples/game/box.tm | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/examples/game/box.tm b/examples/game/box.tm index acff269e..03294a0a 100644 --- a/examples/game/box.tm +++ b/examples/game/box.tm @@ -1,9 +1,7 @@ # Defines a struct representing boxes on the terrain -use vectors - use ./world.tm -use ./color.tm +use ./raylib.tm -struct Box(pos:Vec2, size=Vec2(50, 50), color=Color.GRAY, blocking=yes): +struct Box(pos:Vector2, size=Vector2(50, 50), color=Color(0x80,0x80,0x80), blocking=yes): func draw(b:Box): - b.color:draw_rectangle(b.pos, b.size) + DrawRectangleRec(Rectangle(b.pos.x, b.pos.y, b.size.x, b.size.y), b.color) |
