45 Commits

Author SHA1 Message Date
b91ebeb775 fix boss
it works now except for a square being drawn in the shield. good enough
2023-12-20 13:33:00 -08:00
ab687f8f6d adjust spawning
now it runs for a little tiny bit!
2023-12-20 13:23:29 -08:00
bef95df6a1 typo 2023-12-20 13:18:20 -08:00
24435a3c15 move guns before ships 2023-12-20 13:18:01 -08:00
0c3a36f1fd defer zap_gun creation until it exists 2023-12-20 13:15:34 -08:00
a39c419e5f fix mknew 2023-12-20 13:13:51 -08:00
9ef762268f many assorted syntax errors 2023-12-20 13:04:13 -08:00
e50f516b11 allow strings when spawning guns 2023-12-20 12:00:34 -08:00
f9e28fa0e2 fix missing paren 2023-12-20 11:59:20 -08:00
38a054dec1 candidate conversion to csv for level format 2023-12-20 11:48:08 -08:00
fd391ff3bc use _ENV to get rid of level_events and spawns 2023-12-20 11:40:11 -08:00
fbd9f97429 maybe fix the level parser 2023-12-20 11:33:59 -08:00
2a61e8b5d6 partial conversion to CSV-based levels, does not run yet 2023-10-15 21:09:12 -07:00
4ccbe1dc35 okay honestly this all can and should just be CSVs 2023-10-13 01:02:43 -07:00
b536d2c987 base for representing a level as a string 2023-10-08 00:41:24 -07:00
62fe5f51d3 val helper function 2023-10-07 23:57:27 -07:00
fd68ef88ec document The Parser, take an emit function. 2023-10-07 23:53:40 -07:00
fd9866e963 The Parser 2023-10-03 22:41:52 -07:00
a5ce0fd020 update todo list 2023-10-01 14:39:34 -07:00
dae108c231 move spark_particle's mknew call to the right spot 2023-10-01 00:46:32 -07:00
2e46d87a84 refactor spark logic. this loses tokens; may need to revisit 2023-09-30 20:10:42 -07:00
a4590821be pre-initialize palettes for blip. costs tokens, saves time 2023-09-30 19:45:07 -07:00
cf1e1153a3 lframe increment is now 0x0.0001
avoids time rollover! not doing this for `distance` because I don't intend any level script to exceed five minutes, but freeze time could be much longer
2023-09-30 19:30:21 -07:00
f3ac1f492c Dithering-style fade
Higher performance, allows free use of other palettes, frees up compressed space.
2023-09-30 19:15:22 -07:00
fb95085bd9 declare bullet_base before bullets 2023-09-30 15:02:34 -07:00
6f9517cee1 complete conversion to new 2023-09-30 15:01:39 -07:00
8d5f697961 fix incomplete conversions 2023-09-30 14:27:43 -07:00
bad8452f3c migrate ships to mknew style 2023-09-30 14:24:31 -07:00
f49407baca move ship typedefs before ship impls 2023-09-30 14:11:36 -07:00
e8ed97be9e might as well offer a shortcut for that too 2023-09-30 14:07:54 -07:00
f4bcd11bed preserve extra args to puketh
useful for puking to the clipboard instead of the console
2023-09-30 14:07:23 -07:00
4ae0d05b47 actually fix indentation 2023-09-30 14:03:06 -07:00
a4bf3f616a fix indentation when puking up a linked list 2023-09-30 14:00:53 -07:00
8fb54ede26 fix list handling, add puketh 2023-09-30 13:59:07 -07:00
cb65a188a8 lua is not go 2023-09-30 13:50:39 -07:00
7c29c329b7 handle backreferences and linked lists in puke 2023-09-30 13:50:07 -07:00
f67c2da37f remove draw_debug since it doesn't work; add "puke" debug helper
linked lists don't have a measurable length. will use a persistent intangible for debug dumps in the future. `puke` however can be used at the CLI to dump a table. I need to write a `listpuke` variant too
2023-09-30 13:32:52 -07:00
da8a5b9589 update readme section 2023-09-30 13:06:34 -07:00
a58421bd19 once_next_frame helper
token and time inefficient for now, but might help reduce bugs later? dunno
2023-09-30 13:03:38 -07:00
e0b8386849 new events is now always valid to append to
also "vore" now resets the eaten list
2023-09-30 12:55:33 -07:00
2b02d2b94b fix blast projectile for rearranged checks 2023-09-30 12:52:58 -07:00
c90b56b603 fix obvious bugs
not working: ship bounds, "blast" weapon
2023-09-30 02:48:18 -07:00
2e8bba2a0e oops, tilde only means "not" in "not equals" 2023-09-30 02:18:19 -07:00
803062ef43 one-line if doesn't need end 2023-09-30 02:17:19 -07:00
b61fe936e3 lua ain't go 2023-09-30 02:16:24 -07:00
3 changed files with 992 additions and 999 deletions

61
the_parser.p8 Normal file
View File

@ -0,0 +1,61 @@
pico-8 cartridge // http://www.pico-8.com
version 41
__lua__
-- the parser
parser = {}
mknew(parser)
-- calls parse_into with a nop
-- emit function.
function parser:parse(str)
self:parse_into(str, function() end)
end
-- read a file of commands and
-- execute them, emitting the
-- results from each call into
-- `emit` as a table per row.
--
-- a "command" is a method on
-- self. a row alternates
-- commands with args. when
-- calling a command, it also
-- gets a table of previous
-- results as the first arg.
-- args are split on ','.
function parser:parse_into(str, emit)
for row in all(split(str, "\n")) do
local prev = {}
local sectors = split(row, ":")
for i=1,#sectors,2 do
local x = self[sectors[i]](self, prev, usplit(sectors[i+1]))
if (x) add(prev, x)
end
emit(prev)
end
end
-- saves prev[sel] as self.name.
-- if sel is unspecified, saves
-- all of prev (as a table).
function parser:saveas(prev, name, sel)
self[name] = sel and prev[sel] or prev
end
-- returns its args, ignoring
-- prev. Used to stuff things
-- into prev. args are packed
-- if there's multiple.
function parser:val(_, ...)
local ret := pack(...)
if (#ret == 1) return ret[1]
return ret
end
function parser:bind(_, fn, ...)
local f = self[fn]
return function()
f(...)
end
end

View File

@ -1,8 +1,8 @@
## 1. refine existing engine (knowing what I know now)
- [ ] rewrite event queue as a linked list
- [ ] rewrite animator stacks as linked lists
- [ ] rewrite ship/bullet collections as linked lists
- [x] rewrite event queue as a linked list
- [x] rewrite animator stacks as linked lists
- [x] 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

File diff suppressed because it is too large Load Diff