17 lines
548 B
Lua
17 lines
548 B
Lua
-- How bullets are produced make sure to generate bullet data, then pass it through createBullet
|
|
function onShoot()
|
|
rot = weapon.wielder.rotation
|
|
data = weapon:genBulletData()
|
|
for i=1, 10 do
|
|
spread = math.random(-20, 20)
|
|
print("direction x: "..data.direction.x.." y: "..data.direction.y);
|
|
data.direction.x = math.cos(math.rad(rot + spread))
|
|
data.direction.y = math.sin(math.rad(rot + spread))
|
|
weapon:createBullet(data)
|
|
end
|
|
end
|
|
|
|
-- How the bulllet, target or wielder respond when the bullet hits a target.
|
|
function onHit(target)
|
|
|
|
end
|