diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-05 01:54:39 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-05 01:54:39 -0400 |
| commit | e2ddd23b55bd51bd382ebc9b8d3094632472bf67 (patch) | |
| tree | b1fb7dcff42fad4fdc9e6a6393989ee980d5757f /examples/game/raylib.tm | |
| parent | cb6a5f264c857691cf3db3c9d8e12375e4dc75fd (diff) | |
Fix some of the constructor logic
Diffstat (limited to 'examples/game/raylib.tm')
| -rw-r--r-- | examples/game/raylib.tm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/game/raylib.tm b/examples/game/raylib.tm index fc0affb9..ad248e4f 100644 --- a/examples/game/raylib.tm +++ b/examples/game/raylib.tm @@ -19,7 +19,7 @@ struct Vector2(x,y:Num32; extern): func negative(v:Vector2->Vector2; inline): return Vector2(-v.x, -v.y) func dot(a,b:Vector2->Num32; inline): - return ((a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y))! + return ((a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y)) func cross(a,b:Vector2->Num32; inline): return a.x*b.y - a.y*b.x func scaled_by(v:Vector2, k:Num32->Vector2; inline): @@ -27,7 +27,7 @@ struct Vector2(x,y:Num32; extern): func divided_by(v:Vector2, divisor:Num32->Vector2; inline): return Vector2(v.x/divisor, v.y/divisor) func length(v:Vector2->Num32; inline): - return (v.x*v.x + v.y*v.y)!:sqrt() + return (v.x*v.x + v.y*v.y):sqrt() func dist(a,b:Vector2->Num32; inline): return a:minus(b):length() func angle(v:Vector2->Num32; inline): |
