diff --git a/content/pong/ball/bouncing/library_integration.md b/content/pong/ball/bouncing/library_integration.md index 412f336..18fcf03 100644 --- a/content/pong/ball/bouncing/library_integration.md +++ b/content/pong/ball/bouncing/library_integration.md @@ -45,6 +45,8 @@ export interface World { move(table: table, x: number, y: number): [number, number, Collision[], number]; update(table: table, x: number, y: number, width?: number, height?: number): void; + + remove(table: table): void; } ``` @@ -56,6 +58,8 @@ In Lua, *table* is our generic object. All of our classes and other objects are "check" and "move" return four variables. The first two are _actualX_ and _actualY_, which are the new positions after the move. The next is _cols_, which is a list of collisions detected during the move. The final is _len_, which is the total amount of collisions detected. +"remove" takes a table and removes it from the world. This is used when objects are destroyed and no longer exist in the game. + Inspecting the contents of _cols_ in the bump.lua documentation gives us the following types and interfaces: ```ts