From 6fac71363024403c8bc5e92d286153dbe48b389a Mon Sep 17 00:00:00 2001 From: Eltrac Date: Thu, 20 Feb 2025 16:39:45 +0800 Subject: refactor: use Body object - Body defines an object's size and shape - Body provides a universal function to detect collision --- objects/Enemy.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'objects/Enemy.lua') diff --git a/objects/Enemy.lua b/objects/Enemy.lua index c00ea5f..05990f1 100644 --- a/objects/Enemy.lua +++ b/objects/Enemy.lua @@ -7,7 +7,7 @@ function Enemy:new(name, location) presetLocation = (type(location) == "string" and location) or nil, x = (type(location) == "table" and location.x) or nil, y = (type(location) == "table" and location.y) or nil, - r = enemyData[name] and enemyData[name].size or nil, + body = Body:new("circle", enemyData[name] and enemyData[name].size or nil), speed = enemyData[name] and enemyData[name].speed or nil, } -- cgit v1.2.3