basic stacking hats pattern and basic woody ennemy
This commit is contained in:
27
scripts/battle/bullets/hatbulllet.lua
Normal file
27
scripts/battle/bullets/hatbulllet.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
---@class HatBullet : Bullet
|
||||
local HatBullet, super = Class(Bullet)
|
||||
|
||||
---@param x number # The X position of the bullet
|
||||
---@param y number # The Y position of the bullet
|
||||
---@param dir number # The dir (in radians) of the bullet
|
||||
---@param speed number # The speed the bullet will move at in the specified direction
|
||||
function HatBullet:init(x, y, dir, speed)
|
||||
-- Last argument = sprite path
|
||||
super.init(self, x, y, "bullets/hatbullet")
|
||||
|
||||
-- Move the bullet in dir radians (0 = right, pi = left, clockwise rotation)
|
||||
self.physics.direction = dir
|
||||
-- Speed the bullet moves (pixels per frame at 30FPS)
|
||||
self.physics.speed = speed
|
||||
self.collision = false
|
||||
|
||||
|
||||
end
|
||||
|
||||
function HatBullet:update()
|
||||
-- For more complicated bullet behaviours, code here gets called every update
|
||||
|
||||
super.update(self)
|
||||
end
|
||||
|
||||
return HatBullet
|
||||
Reference in New Issue
Block a user