Browse Source

gunpod pew pew

pixelbath 2 years ago
parent
commit
243f8bcb42
1 changed files with 11 additions and 0 deletions
  1. 11 0
      shmup/shmup.lua

+ 11 - 0
shmup/shmup.lua

@@ -9,6 +9,7 @@ local bullet_speed = 6
 local bullet_timer = 0
 local bullet_timer_start = 10
 
+-- props: x, y, vx, vy, type
 local player_bullets = {}
 
 local player = {
@@ -68,6 +69,16 @@ function add_bullet()
 		vx = 0,
 		vy = 0,
 	})
+	if #player.gunpods > 0 then
+		for _,pod in ipairs(player.gunpods) do
+			table.insert(player_bullets, {
+				x=pod.x + 4,
+				y=pod.y,
+				vx = 0,
+				vy = 0,
+			})
+		end
+	end
 end
 
 function add_gunpod()