placeholder flotilla ships
This commit is contained in:
parent
e3a2810f0a
commit
d13290f438
@ -466,6 +466,14 @@ end
|
|||||||
-->8
|
-->8
|
||||||
--ship behavior
|
--ship behavior
|
||||||
|
|
||||||
|
-- generic full sprite hurtbox
|
||||||
|
box8 = {
|
||||||
|
x_off = 0,
|
||||||
|
y_off = 1,
|
||||||
|
width = 8,
|
||||||
|
height = 8
|
||||||
|
}
|
||||||
|
|
||||||
scrollrate = 0.25 --in px/frame
|
scrollrate = 0.25 --in px/frame
|
||||||
|
|
||||||
ship_m = mknew{
|
ship_m = mknew{
|
||||||
@ -1347,7 +1355,6 @@ chasey = mknew(ship_m.new{
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- todo: use constraints
|
|
||||||
function chasey:act()
|
function chasey:act()
|
||||||
self.xmin = max(primary_ship.x-8, 0)
|
self.xmin = max(primary_ship.x-8, 0)
|
||||||
self.xmax = min(primary_ship.x + 8, 112 - 8*self.size)
|
self.xmax = min(primary_ship.x + 8, 112 - 8*self.size)
|
||||||
@ -1385,6 +1392,51 @@ xl_chasey=mknew(chasey.new{
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- flotilla ships
|
||||||
|
|
||||||
|
ship_f = mknew(ship_m.new{
|
||||||
|
-- sprite required
|
||||||
|
size = 1,
|
||||||
|
hurt = box8,
|
||||||
|
-- no sparks
|
||||||
|
hp = 0.5,
|
||||||
|
xp = 0x0.0001,
|
||||||
|
|
||||||
|
maxspd = 3,
|
||||||
|
thrust = 0.15,
|
||||||
|
drag = 0.05,
|
||||||
|
slip = false,
|
||||||
|
act = function(self)
|
||||||
|
local wx,wy=self.want_x,self.want_y
|
||||||
|
self.xmin,self.xmax,self.ymin,self.ymax = wx,wx,wy,wy
|
||||||
|
return 0,0,false,false
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
ship_mook = mknew(ship_f.new{
|
||||||
|
sprite=103
|
||||||
|
})
|
||||||
|
ship_defender = mknew(ship_f.new{
|
||||||
|
sprite=105,
|
||||||
|
hp = 2.5,
|
||||||
|
xp = 0x0.0003,
|
||||||
|
})
|
||||||
|
ship_turret = mknew(ship_f.new{
|
||||||
|
sprite=106,
|
||||||
|
xp = 0x0.0002,
|
||||||
|
})
|
||||||
|
ship_skirmisher = mknew(ship_f.new{
|
||||||
|
sprite=107,
|
||||||
|
xp = 0x0.0004,
|
||||||
|
})
|
||||||
|
|
||||||
|
function rnd_spawn_loc()
|
||||||
|
local x,y = flr(rnd(304)), flr(rnd(32))
|
||||||
|
if (x<184) return x-40,-y-8
|
||||||
|
if (x<244) return -y-8,x-184
|
||||||
|
return 112+y, x-244
|
||||||
|
end
|
||||||
|
|
||||||
-->8
|
-->8
|
||||||
-- collisions
|
-- collisions
|
||||||
|
|
||||||
@ -1672,6 +1724,18 @@ function multi(times, interval, fnm, ...)
|
|||||||
end}
|
end}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function demo_spawn_f(ttn)
|
||||||
|
local spx,spy=rnd_spawn_loc()
|
||||||
|
local s = _ENV[ttn].new{
|
||||||
|
x = spx,
|
||||||
|
y = spy,
|
||||||
|
want_x = 8 + rnd(96),
|
||||||
|
want_y = 8 + rnd(64)
|
||||||
|
}
|
||||||
|
eships:push_back(s)
|
||||||
|
return s
|
||||||
|
end
|
||||||
|
|
||||||
-- then convert sample_level to csv.
|
-- then convert sample_level to csv.
|
||||||
-- spawn_spec_gun_at and spawn_main_gun_at will need parsed forms.
|
-- spawn_spec_gun_at and spawn_main_gun_at will need parsed forms.
|
||||||
-- the boss also needs to be reachable, but one-off is fine.
|
-- the boss also needs to be reachable, but one-off is fine.
|
||||||
@ -1679,6 +1743,10 @@ end
|
|||||||
-- where offset,eol is a special case.
|
-- where offset,eol is a special case.
|
||||||
|
|
||||||
example_level_csv=[[1,spawn_frownie
|
example_level_csv=[[1,spawn_frownie
|
||||||
|
20,demo_spawn_f,ship_mook
|
||||||
|
25,demo_spawn_f,ship_defender
|
||||||
|
30,demo_spawn_f,ship_turret
|
||||||
|
35,demo_spawn_f,ship_skirmisher
|
||||||
60,spawn_vulcan_chasey
|
60,spawn_vulcan_chasey
|
||||||
61,spawn_blocky
|
61,spawn_blocky
|
||||||
85,spawn_spewy
|
85,spawn_spewy
|
||||||
|
Loading…
x
Reference in New Issue
Block a user