diff --git a/Resources/scenes/debugScene.xml b/Resources/scenes/debugScene.xml index af91548..456c249 100644 --- a/Resources/scenes/debugScene.xml +++ b/Resources/scenes/debugScene.xml @@ -34,7 +34,7 @@ - + diff --git a/Resources/scripts/shotgun_script.lua b/Resources/scripts/shotgun_script.lua new file mode 100644 index 0000000..4c8e4b6 --- /dev/null +++ b/Resources/scripts/shotgun_script.lua @@ -0,0 +1,17 @@ +-- 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 diff --git a/Resources/weapons/bubblegun.xml b/Resources/weapons/bubblegun.xml index 0d3163c..96ab369 100644 --- a/Resources/weapons/bubblegun.xml +++ b/Resources/weapons/bubblegun.xml @@ -11,6 +11,21 @@ + +