aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-05 01:54:39 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-05 01:54:39 -0400
commite2ddd23b55bd51bd382ebc9b8d3094632472bf67 (patch)
treeb1fb7dcff42fad4fdc9e6a6393989ee980d5757f /examples
parentcb6a5f264c857691cf3db3c9d8e12375e4dc75fd (diff)
Fix some of the constructor logic
Diffstat (limited to 'examples')
-rw-r--r--examples/game/raylib.tm4
-rw-r--r--examples/game/world.tm2
2 files changed, 3 insertions, 3 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):
diff --git a/examples/game/world.tm b/examples/game/world.tm
index 8b721c5c..76acac6b 100644
--- a/examples/game/world.tm
+++ b/examples/game/world.tm
@@ -38,7 +38,7 @@ func solve_overlap(a_pos:Vector2, a_size:Vector2, b_pos:Vector2, b_size:Vector2
return Vector2(0, 0)
struct World(player:@Player, goal:@Box, boxes:@[@Box], dt_accum=Num32(0.0), won=no):
- DT := (Num32(1.)/Num32(60.))!
+ DT := (Num32(1.)/Num32(60.))
STIFFNESS := Num32(0.3)
func update(w:@World, dt:Num32):