From 2bb2ff871fa1761478442bec5f6a32c9428360a1 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 6 Apr 2025 14:20:18 -0400 Subject: Change method calls to use `foo.baz()` instead of `foo:baz()` --- examples/game/raylib.tm | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'examples/game/raylib.tm') diff --git a/examples/game/raylib.tm b/examples/game/raylib.tm index ad248e4f..5e58e996 100644 --- a/examples/game/raylib.tm +++ b/examples/game/raylib.tm @@ -27,37 +27,37 @@ 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() + return a.minus(b).length() func angle(v:Vector2->Num32; inline): return Num32.atan2(v.y, v.x) func norm(v:Vector2->Vector2; inline): if v.x == 0 and v.y == 0: return v - len := v:length() + len := v.length() return Vector2(v.x/len, v.y/len) func rotated(v:Vector2, radians:Num32 -> Vector2): - cos := radians:cos() or return v - sin := radians:sin() or return v + cos := radians.cos() or return v + sin := radians.sin() or return v return Vector2(cos*v.x - sin*v.y, sin*v.x + cos*v.y) func mix(a,b:Vector2, amount:Num32 -> Vector2): return Vector2( - amount:mix(a.x, b.x), - amount:mix(a.y, b.y), + amount.mix(a.x, b.x), + amount.mix(a.y, b.y), ) -extern InitWindow:func(width:Int32, height:Int32, title:CString) -extern SetTargetFPS:func(fps:Int32) -extern WindowShouldClose:func(->Bool) -extern GetFrameTime:func(->Num32) -extern BeginDrawing:func() -extern EndDrawing:func() -extern CloseWindow:func() -extern ClearBackground:func(color:Color) -extern DrawRectangle:func(x,y,width,height:Int32, color:Color) -extern DrawRectangleRec:func(rec:Rectangle, color:Color) -extern DrawRectangleV:func(pos:Vector2, size:Vector2, color:Color) -extern DrawText:func(text:CString, x,y:Int32, text_height:Int32, color:Color) -extern GetScreenWidth:func(->Int32) -extern GetScreenHeight:func(->Int32) +extern InitWindow : func(width:Int32, height:Int32, title:CString) +extern SetTargetFPS : func(fps:Int32) +extern WindowShouldClose : func(->Bool) +extern GetFrameTime : func(->Num32) +extern BeginDrawing : func() +extern EndDrawing : func() +extern CloseWindow : func() +extern ClearBackground : func(color:Color) +extern DrawRectangle : func(x,y,width,height:Int32, color:Color) +extern DrawRectangleRec : func(rec:Rectangle, color:Color) +extern DrawRectangleV : func(pos:Vector2, size:Vector2, color:Color) +extern DrawText : func(text:CString, x,y:Int32, text_height:Int32, color:Color) +extern GetScreenWidth : func(->Int32) +extern GetScreenHeight : func(->Int32) -- cgit v1.2.3