Compare commits

..

5 Commits

Author SHA1 Message Date
362f1f06a6
basic roadmap 2023-09-13 00:21:53 -07:00
2f8703c487
another golf thing 2023-09-13 00:00:09 -07:00
7b0c2e0133
more golfing 2023-09-12 23:52:14 -07:00
5591068f1d
split trick on powcols, save more tokens 2023-09-12 23:44:33 -07:00
43e6160dbc
csvify some large tables
Steal the csv and usplit routines from Extreme Tetrom. Not yet using usplit.
2023-09-12 23:35:27 -07:00
2 changed files with 74 additions and 49 deletions

34
todo.md Normal file
View File

@ -0,0 +1,34 @@
- [ ] rewrite event queue as a linked list
- [ ] rewrite animator stacks as linked lists
- [ ] rewrite ship/bullet collections as linked lists
- [ ] update/draw mode switching system (high-efficiency version)
- [ ] render ship shields (even for large ships)
- [ ] duplicate file -- about to split away from Tyrian features
- [ ] remove PWR meter, replace with weapon queue
- [ ] remove power mechanics from _player_ ship (only!)
- [ ] all player weapons are now ammo limited except pea shooter
- [ ] remove weapon drops
- [ ] implement fallback pea shooter
- [ ] implement turn timer (screen-height bar)
- [ ] implement extremely crude prototype for weapon select intermezzo
- [ ] implement "deck"
- [ ] implement basic weapon cards
- [ ] implement starter deck
- [ ] stabilize this with just starter deck and sample level
- [ ] implement post-encounter "get a card"
- [ ] implement deck lister
- [ ] implement more cards, mini-encounters for deck buildup
- [ ] implement card levels?
- [ ] implement card removal (shop?)
- [ ] actually design a branching encounter sequence
- [ ] map
- [ ] "minimap"/scanner on weapon picker
- [ ] high score board (difficulty x time)
- [ ] difficulty increase system
- [ ] as much more crap as I can fit in under the token limit, which
is probably not much at this point
- [ ] give up and move to TIC-80 because the token limits

View File

@ -11,6 +11,16 @@ lose = 3
debug = {} debug = {}
function usplit(str)
return unpack(split(str))
end
function csv(s)
local ret=split(s,"\n")
for i,v in ipairs(ret) do
ret[i] = type(v) == "string" and split(v) or {v} end
return ret
end
function _init() function _init()
init_bullet_mt() init_bullet_mt()
init_powerup_mt() init_powerup_mt()
@ -25,14 +35,11 @@ end
-- health gradients for 1..5 hp -- health gradients for 1..5 hp
-- exactly, then all "more". -- exactly, then all "more".
hpcols_lut = { hpcols_lut = csv[[36
{36}, 34, 136
{34, 136}, 34, 130, 136
{34, 130, 136}, 34, 34, 130, 136
{34, 34, 130, 136}, 34, 34, 130, 130, 136]]
{34, 34, 34, 130, 136},
{34, 34, 34, 130, 130, 136}
}
-- call after any change to maxhp -- call after any change to maxhp
-- configures health gradient -- configures health gradient
@ -176,24 +183,22 @@ function _draw()
fadescreen() fadescreen()
end end
local fadetable={ fadetable=csv[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, 1,1,129,129,129,129,129,129,129,129,0,0,0,0,0
{1,1,129,129,129,129,129,129,129,129,0,0,0,0,0}, 2,2,2,130,130,130,130,130,128,128,128,128,128,0,0
{2,2,2,130,130,130,130,130,128,128,128,128,128,0,0}, 3,3,3,131,131,131,131,129,129,129,129,129,0,0,0
{3,3,3,131,131,131,131,129,129,129,129,129,0,0,0}, 4,4,132,132,132,132,132,132,130,128,128,128,128,0,0
{4,4,132,132,132,132,132,132,130,128,128,128,128,0,0}, 5,5,133,133,133,133,130,130,128,128,128,128,128,0,0
{5,5,133,133,133,133,130,130,128,128,128,128,128,0,0}, 6,6,134,13,13,13,141,5,5,5,133,130,128,128,0
{6,6,134,13,13,13,141,5,5,5,133,130,128,128,0}, 7,6,6,6,134,134,134,134,5,5,5,133,130,128,0
{7,6,6,6,134,134,134,134,5,5,5,133,130,128,0}, 8,8,136,136,136,136,132,132,132,130,128,128,128,128,0
{8,8,136,136,136,136,132,132,132,130,128,128,128,128,0}, 9,9,9,4,4,4,4,132,132,132,128,128,128,128,0
{9,9,9,4,4,4,4,132,132,132,128,128,128,128,0}, 10,10,138,138,138,4,4,4,132,132,133,128,128,128,0
{10,10,138,138,138,4,4,4,132,132,133,128,128,128,0}, 11,139,139,139,139,3,3,3,3,129,129,129,0,0,0
{11,139,139,139,139,3,3,3,3,129,129,129,0,0,0}, 12,12,12,140,140,140,140,131,131,131,1,129,129,129,0
{12,12,12,140,140,140,140,131,131,131,1,129,129,129,0}, 13,13,141,141,5,5,5,133,133,130,129,129,128,128,0
{13,13,141,141,5,5,5,133,133,130,129,129,128,128,0}, 14,14,14,134,134,141,141,2,2,133,130,130,128,128,0
{14,14,14,134,134,141,141,2,2,133,130,130,128,128,0}, 15,143,143,134,134,134,134,5,5,5,133,133,128,128,0]]
{15,143,143,134,134,134,134,5,5,5,133,133,128,128,0}
}
function fadescreen() function fadescreen()
fadelvl += 0.25 fadelvl += 0.25
@ -240,6 +245,7 @@ function drawgame()
drawhud() drawhud()
end end
powcols=split"170,154,153,148,68"
function drawhud() function drawhud()
-- 112-and-right is hud zone -- 112-and-right is hud zone
rectfill(112, 0, 127, 127,0x56) rectfill(112, 0, 127, 127,0x56)
@ -253,7 +259,7 @@ function drawhud()
dropshadow("pwr",114,59,1) dropshadow("pwr",114,59,1)
inset(114,66,125,92) inset(114,66,125,92)
fillp(0x5a5a) fillp(0x5a5a)
vertmeter(115,67,124,91,primary_ship.power, primary_ship.max_power, {170,154,153,148,68}) vertmeter(115,67,124,91,primary_ship.power, primary_ship.max_power, powcols)
dropshadow("h s",114,97,1) dropshadow("h s",114,97,1)
@ -365,8 +371,8 @@ function init_ship_mt()
setmetatable(chasey, ship_t) setmetatable(chasey, ship_t)
end end
firespark = {9, 8, 2, 5, 1} -- bright spark colors firespark = split"9, 8, 2, 5, 1"
smokespark = {13, 13, 5, 5} smokespark = split"13, 13, 5, 5"
player = { player = {
--shape --shape
@ -1791,24 +1797,9 @@ blip_fx_t = {
} }
function blip(obj, col, frames) function blip(obj, col, frames)
obj.fx_pal = { local p = {[0]=0}
[0] = 0, obj.fx_pal = p
[1] = col, for i=1,15 do p[i]=col end
[2] = col,
[3] = col,
[4] = col,
[5] = col,
[6] = col,
[7] = col,
[8] = col,
[9] = col,
[10] = col,
[11] = col,
[12] = col,
[13] = col,
[14] = col,
[15] = col
}
if (obj.___fx_pal_event) obj.___fx_pal_event:abort() if (obj.___fx_pal_event) obj.___fx_pal_event:abort()
local e = { local e = {
frames = frames, frames = frames,
@ -1818,7 +1809,7 @@ function blip(obj, col, frames)
add(events, e) add(events, e)
end end
bossspark = {7, 7, 10, 10, 9, 9, 9, 8, 8, 8, 2, 2, 5, 5} bossspark = split"7,7,10,10,9,9,9,8,8,8,2,2,5,5"
function boom(x,y,boominess,is_boss) function boom(x,y,boominess,is_boss)
local sp = firespark local sp = firespark
@ -1891,7 +1882,7 @@ powerup = {
} }
-- sprite indexes for "sheen" animation -- sprite indexes for "sheen" animation
sheen8x8 = {2, 54, 55, 56, 57, 58, 59, 60, 61} sheen8x8 = split"2,54,55,56,57,58,59,60,61"
powerup_t = { powerup_t = {
__index = powerup __index = powerup