Compare commits
No commits in common. "7f86166f8d0c6a8671f1b9e79625996a213ec2f0" and "abb33b4cbe2486363d94b8706dbc7f053f555eea" have entirely different histories.
7f86166f8d
...
abb33b4cbe
2 changed files with 1 additions and 3 deletions
|
|
@ -49,7 +49,6 @@ end
|
|||
---@param x number|nil horizontal position
|
||||
---@param y number|nil vertical position
|
||||
---@param opts table|nil additional arguments
|
||||
---@return GameObject
|
||||
function Area:addGameObject(game_object_type, x, y, opts)
|
||||
local game_object = _G[game_object_type](self, x or 0, y or 0, opts or {})
|
||||
table.insert(self.game_objects, game_object)
|
||||
|
|
|
|||
|
|
@ -72,8 +72,7 @@ function Player:shoot()
|
|||
local d = 1.2*self.w
|
||||
local offset_x, offset_y = self.x + d*math.cos(self.r), self.y + d*math.sin(self.r)
|
||||
self.area:addGameObject('ShootEffect', offset_x, offset_y, {player = self, d = d})
|
||||
local proj = self.area:addGameObject('Projectile', offset_x, offset_y, {v = 100 ,r = self.r})
|
||||
proj.timer:tween(0.5, proj, {v = 400}, 'linear')
|
||||
self.area:addGameObject('Projectile', offset_x, offset_y, {r = self.r})
|
||||
end
|
||||
|
||||
return Player
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue