First draft - 50 minutes :/

This commit is contained in:
Jeremy Penner 2021-07-04 13:42:00 -04:00
parent c850a5dc8e
commit 17375a5929
5 changed files with 47 additions and 18 deletions

View file

@ -52,7 +52,7 @@
[:vm :hires [:vm :hires
:lit :level1 :load-level :lit :level1 :load-level
(vm:forever (vm:forever
(vm:hotswap-sync :lit :level6 :load-level) (vm:hotswap-sync :full-redraw)
:interactive-eval-checkpoint :interactive-eval-checkpoint
:handle-key :handle-key
) )

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

BIN
presentation/pics/bitsy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

View file

@ -8,19 +8,21 @@
(local PortraitEditView (require :editor.portraitedit)) (local PortraitEditView (require :editor.portraitedit))
(local FontEditView (require :editor.fontedit)) (local FontEditView (require :editor.fontedit))
(local ScreenEditView (require :editor.screenedit)) (local ScreenEditView (require :editor.screenedit))
(local files (require :game.files))
(local h (local h
{:style true {:style true
:font (renderer.font.load "presentation/font/PrintChar21.ttf" (* 64 SCALE)) :font (renderer.font.load "presentation/font/PrintChar21.ttf" 64)
:color style.caret :color style.caret
:justify :center :justify :center
:topPadding (* style.padding.y 2) :topPadding 14
:lowerPadding 64}) :lowerPadding 64})
(local ** (local **
{:style true {:style true
:font (renderer.font.load "presentation/font/PRNumber3.ttf" (* 32 SCALE)) :font (renderer.font.load "presentation/font/PRNumber3.ttf" 32)
:color style.text :color style.text
:justify :left :justify :left
:lowerPadding 7
:pause-after true}) :pause-after true})
(fn p [style] (lume.merge style {:pause-after true})) (fn p [style] (lume.merge style {:pause-after true}))
(fn np [style] (lume.merge style {:pause-after false})) (fn np [style] (lume.merge style {:pause-after false}))
@ -32,19 +34,23 @@
node (root:get_node_for_view view)] node (root:get_node_for_view view)]
(when node (node:close_active_view root)))) (when node (node:close_active_view root))))
(fn split-and-open [f ?split] (fn split-and-open [self f]
(let [focused-view core.active_view (let [focused-view core.active_view
focused-node (core.root_view:get_active_node) focused-node (core.root_view:get_active_node)
_ (when ?split (focused-node:split ?split)) _ (when self.split (focused-node:split self.split))
view (f) view (f self)
node (core.root_view:get_active_node)] node (core.root_view:get_active_node)]
(when (= (core.root_view.root_node:get_node_for_view view) nil) (node:add_view view)) (when (= (core.root_view.root_node:get_node_for_view view) nil) (node:add_view view))
(when ?split (core.set_active_view focused-view)) ; don't switch focus (when self.split (core.set_active_view focused-view)) ; don't switch focus
#(view-cleanup view))) #(view-cleanup view)))
(fn openview [f ?extra] (lume.merge {:action #(split-and-open f $1.split)} (or ?extra {}))) (fn openview [f ?extra] (lume.merge {:action #(split-and-open $1 f)} (or ?extra {})))
(fn openfile [filename ?extra] (fn openfile [filename ?extra]
(openview #(core.root_view:open_doc (core.open_doc filename)) ?extra)) (openview #(let [ldoc (core.open_doc filename)
view (core.root_view:open_doc ldoc)]
(when $1.line (view:scroll_to_line $1.line))
view)
?extra))
(parse [ (parse [
[h "" "" "" [h "" "" ""
@ -78,7 +84,7 @@
"* How can I leverage emulation?"] "* How can I leverage emulation?"]
[h "Step 1: Assembler" [h "Step 1: Assembler"
** "Represent instructions using Fennel data literals" ** "Represent instructions using Fennel data literals"
(openfile :asm/asm.fnl {:split :right}) (openfile :neuttower/defs.fnl {:split :right :line 57})
" [:lda 0xff]" " [:lda 0xff]"
"Represent labels with Fennel strings" "Represent labels with Fennel strings"
" :loop [:bne :loop]" " :loop [:bne :loop]"
@ -119,7 +125,9 @@
"Could I rewrite it to run under LÖVE2D?" "Could I rewrite it to run under LÖVE2D?"
" Yes! In a weekend!"] " Yes! In a weekend!"]
[h "Custom Editors" [h "Custom Editors"
** "14x16 tile editor" ** "Retro game programming is just the process of writing a series of barely-usable custom paint programs."
{:action #(files.reload :neuttower/game.json)}
"14x16 tile editor"
(openview #(TileEditView)) (openview #(TileEditView))
"Font editor" "Font editor"
(openview #(FontEditView)) (openview #(FontEditView))
@ -127,14 +135,14 @@
(openview #(PortraitEditView)) (openview #(PortraitEditView))
"Map editor" "Map editor"
(openview #(MapEditView)) (openview #(MapEditView))
"Screen editor" "Full-screen bitmap editor"
(openview #(ScreenEditView :neuttower/title.screen) {:pause-after true}) (openview #(ScreenEditView :neuttower/title.screen) {:pause-after true})
(openfile :presentation/slides.fnl {:split :right :line 133}) (openfile :presentation/slides.fnl {:split :right :line 133})
"Presentation viewer!?"] "Presentation viewer!?"]
[h "Editing Editors With My Editor" [h "Editing Editors With My Editor"
** "Lua provides a very dynamic environment that allows me tremendous flexibility" ** "Lua provides a very dynamic environment that allows me tremendous flexibility"
(openview #(MapEditView)) (openview #(MapEditView))
(openfile :editor/mapedit.fnl {:split :right}) (openfile :editor/mapedit.fnl {:split :right :line 235})
"Downside:" "Downside:"
{:image "presentation/pics/bsod.png" :justify :center :pause-after true}] {:image "presentation/pics/bsod.png" :justify :center :pause-after true}]
[h "Step 4: Emulator Integration" [h "Step 4: Emulator Integration"
@ -155,8 +163,29 @@
(openfile :asm/tape.fnl {:split :right}) (openfile :asm/tape.fnl {:split :right})
" [:basic [10 :call :2061]]" " [:basic [10 :call :2061]]"
"Future work: Apple Game Server fastloader"] "Future work: Apple Game Server fastloader"]
[h "ProDOS" [(bgimg "presentation/pics/beneath-apple-prodos.png")
** "Eventually we'll want a disk image for release"] h "ProDOS"
** "Disk image is a must-have for distribution"
(openfile :asm/prodos.fnl {:split :right :line 132})
"Of course I wrote my own disk image generation code!"
"Start with a blank ProDOS disk and add to it"
"Fun bugs!"
"* Accidentally implemented undelete instead of inserting new files at first"
"* Read the free space bitmap backwards and overwrote the OS"
"* Tried to name a volume starting with a number"]
[(bgimg "presentation/pics/boot-tower.jpeg")
{:action #(files.reload :neuttower/game.json)}
h "Neu] [ower"
** "A small puzzle adventure game!"
"--== D E M O ==--"]
[(bgimg "presentation/pics/bitsy.png")
{:action #(files.reload :bitsy/game.json)}
h "8-Bitsy"
** "Bitsy is a popular free, accessible, web-based game-making tool"
"Spring Lisp Game Jam - 10 days to hack"
"Could I make my tools a little less... programmer-y?"
(openview #(MapEditView) {:pause-after true})]
[h "Thanks!"
(openfile :neuttower/level6.fnl {:split :right :line 153})
** "Questions?"]
]) ])