From afa1f2217035ed0371447d3baf55cdc87823efe5 Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Sun, 29 Dec 2024 23:39:56 -0800 Subject: [PATCH] go back to 0x0.0001 increments for xp I foresee the 32K limit being a bigger problem than the math in vertmeter, although I will probably need to go patch vertmeter up too --- vacuum_gambit.p8 | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/vacuum_gambit.p8 b/vacuum_gambit.p8 index 604cd7e..754f4b4 100644 --- a/vacuum_gambit.p8 +++ b/vacuum_gambit.p8 @@ -485,14 +485,15 @@ function ship_m:die() local sz4 = self.size * 4 local cx, cy, xp, z = self.x + sz4, self.y + sz4, self.xp or 0, 0 boom(cx, cy, 3*sz4, self.boss) - if xp > 499 then + if xp > 0x0.01f3 then -- dec 499 -- spawn a huge gem with all -- overage XP, min 100 - spawn_xp_at(cx, cy, 0, xp-399) - xp = 399 + spawn_xp_at(cx, cy, 0, xp-0x0.18f) + xp = 0x0.18f -- dec 399 z += 1 end - for gsz in all{100, 25, 5, 1} do + -- 100, 25, 5, 1 + for gsz in all{0x0.0064, 0x0.0019, 0x0.0005, 0x0.0001} do while xp >= gsz do spawn_xp_at(cx, cy, z, gsz) xp -= gsz @@ -950,9 +951,9 @@ player = mknew(ship_m.new{ shield = 2, -- regenerates maxshield = 2, - -- xp; watch out for 16-bit range limits + -- xp in increments of 0x0.0001 xp = 0, - xptarget = 4, + xptarget = 0x0.0004, level = 1, -- gun @@ -1010,7 +1011,7 @@ frownie = mknew(ship_m.new{ sparkodds = 8, hp = 0.5, -- enemy ships need no max hp - xp = 1, + xp = 0x0.0001, -- position x=60, -- x and y are for upper left corner @@ -1032,7 +1033,7 @@ frownie = mknew(ship_m.new{ blocky = mknew(frownie.new{ sprite = 10, hp = 1.5, - xp = 2, + xp = 0x0.0002, hurt = { x_off = 0, y_off = 0, @@ -1052,7 +1053,7 @@ blocky = mknew(frownie.new{ spewy = mknew(frownie.new{ sprite=26, - xp = 3, + xp = 0x0.0003, hurt = { x_off=0, y_off=1, @@ -1073,7 +1074,7 @@ spewy = mknew(frownie.new{ chasey = mknew(ship_m.new{ sprite = 5, - xp = 4, + xp = 0x0.0004, size = 1, hurt = { x_off = 1, @@ -1108,7 +1109,7 @@ end xl_chasey=mknew(chasey.new{ size=2, - xp = 10, + xp = 0x0.000a, maxspd=1.25, hurt = { x_off = 2, @@ -1606,7 +1607,7 @@ function spawn_xp_at(x, y, off, amt) x += rnd(off+off)-off y += rnd(off+off)-off xp_gem.new{ - qsprite=amt == 1 and 32 or amt == 5 and 33 or amt == 25 and 34 or 35, + qsprite=amt == 0x0.0001 and 32 or amt == 0x0.0005 and 33 or amt == 0x0.0019 and 34 or 35, val = amt, }:spawn_at(mid(x, 0, 124),mid(y,-4,125)) end