From 97e179716c06f8507ce38b80453d365cf620aec9 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Sat, 2 Oct 2021 20:52:16 -0700 Subject: [PATCH] Add Technical Doodads + UI Fixes New category for the Doodad Dropper: "Technical" Technical doodads have a dashed outline and label for now, and they turn invisible on level start, and are for hidden technical effects on your level. The doodads include: * Goal Region: acts like an invisible Exit Flag (128x128), the level is won when the player character touches this region. * Fire Region: acts like a death barrier (128x128), kills the player when a generic "You have died!" message. * Power Source: on level start, acts like a switch and emits a power(true) signal to all linked doodads. Link it to your Electric Door for it to be open by default in your level! * Stall Player (250ms): The player is paused for a moment the first time it touches this region. Useful to work around timing issues, e.g. help prevent the player from winning a race against another character. There are some UI improvements to the Doodad Dropper window: * If the first page of doodads is short, extra spacers are added so the alignment and size shows correctly. * Added a 'background pattern' to the window: any unoccupied icon space has an inset rectangle slot. * "Last pages" which are short still render weirdly without reserving the correct height in the TabFrame. Doodad scripting engine updates: * Self.Hide() and Self.Show() available. * Subscribe to "broadcast:ready" to know when the level is ready, so you can safely Publish messages without deadlocks! --- dev-assets/doodads/build.sh | 4 + dev-assets/doodads/regions/Makefile | 25 +++++ dev-assets/doodads/regions/fire-128.png | Bin 0 -> 965 bytes dev-assets/doodads/regions/fire.js | 19 ++++ dev-assets/doodads/regions/goal-128.png | Bin 0 -> 986 bytes dev-assets/doodads/regions/goal.js | 19 ++++ dev-assets/doodads/regions/power-128.png | Bin 0 -> 1150 bytes dev-assets/doodads/regions/power-64.png | Bin 0 -> 873 bytes dev-assets/doodads/regions/power.js | 22 +++++ dev-assets/doodads/regions/stall-128.png | Bin 0 -> 1106 bytes dev-assets/doodads/regions/stall.js | 40 ++++++++ pkg/uix/canvas_actors.go | 9 ++ pkg/uix/scripting.go | 2 + pkg/windows/doodad_dropper.go | 118 ++++++++++++++++++++++- scripts/fpm-bundle-32bit.sh | 88 +++++++++++++++++ 15 files changed, 342 insertions(+), 4 deletions(-) create mode 100644 dev-assets/doodads/regions/Makefile create mode 100644 dev-assets/doodads/regions/fire-128.png create mode 100644 dev-assets/doodads/regions/fire.js create mode 100644 dev-assets/doodads/regions/goal-128.png create mode 100644 dev-assets/doodads/regions/goal.js create mode 100644 dev-assets/doodads/regions/power-128.png create mode 100644 dev-assets/doodads/regions/power-64.png create mode 100644 dev-assets/doodads/regions/power.js create mode 100644 dev-assets/doodads/regions/stall-128.png create mode 100644 dev-assets/doodads/regions/stall.js create mode 100755 scripts/fpm-bundle-32bit.sh diff --git a/dev-assets/doodads/build.sh b/dev-assets/doodads/build.sh index d115872..6bc41eb 100755 --- a/dev-assets/doodads/build.sh +++ b/dev-assets/doodads/build.sh @@ -66,6 +66,10 @@ objects() { cd crumbly-floor/ make cd .. + + cd regions/ + make + cd .. } onoff() { diff --git a/dev-assets/doodads/regions/Makefile b/dev-assets/doodads/regions/Makefile new file mode 100644 index 0000000..63b40ad --- /dev/null +++ b/dev-assets/doodads/regions/Makefile @@ -0,0 +1,25 @@ +ALL: build + +.PHONY: build +build: + # Goal Region + doodad convert -t "Goal Region" goal-128.png reg-goal.doodad + doodad install-script goal.js reg-goal.doodad + + # Fire Region + doodad convert -t "Fire Region" fire-128.png reg-fire.doodad + doodad install-script fire.js reg-fire.doodad + + # Stall Region + doodad convert -t "Stall Player (250ms)" stall-128.png reg-stall-250.doodad + doodad edit-doodad --tag "ms=250" reg-stall-250.doodad + doodad install-script stall.js reg-stall-250.doodad + + # Power Source + doodad convert -t "Power Source" power-64.png power-source.doodad + doodad install-script power.js power-source.doodad + + for i in *.doodad; do\ + doodad edit-doodad --tag "category=technical" $${i};\ + done + cp *.doodad ../../../assets/doodads/ \ No newline at end of file diff --git a/dev-assets/doodads/regions/fire-128.png b/dev-assets/doodads/regions/fire-128.png new file mode 100644 index 0000000000000000000000000000000000000000..117a231f879e5c23ca611ac8e9ffbfa32928211c GIT binary patch literal 965 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7xzrU~I{Bb`J1#c2+1T%1_J8No8Qr zm{>c}*5j~)%+dH@S4~lN?GB5S6^{}eLyiQl4rt+87?yGM;FC-G8J8w3*nm5IldZQUej0Ta5>j_YDf3X zH>+-Z?Gj-5k}T46Mkm>C(xeZv@!vTkmQ`2g9BpXuusO|hS?!*}yn9=C z&;33k7&ayJQSl?g$$B1tPLv*fY<`Y)I_o@1!^>7JvJ+ToF(=lyAYIA`CcGo`bfJrV@HCnz{MimFaYRCZhK*VQWW_IT}|=5_H( z)1B4{Nmz;nG_u|N+Wi0E`@FS(p0rFC>0_R&-}l*&r{pbD@2tl)^45NjSvc&N!>dlm zuVgl!zvOyU)EAByciHsTMbFyA9`lZY*}pC4)H;zRnom9-_$^r*EcRkIt5bGd{@L0& zb_|)Xv?`fpWSEp$PsM$&EHAIl|35GD+jnLS*P_l(3HOuXF*Aw$FN_DqF!Z*N5xH5o`W zTs*Kt`rC7*JMynL`k%SLb7g+C?+MHPP~~I!4wp*SCsr(%o%i^L>-^nMZL_4eUrV0% zrE?kQg2KChu55fd#d+_u`#X&rycw7r7&sc(Y!~epD?VTN=9=96cWU443y|TwNE~um5;8-*sD^(|AY+%kW;Ke(9i>H74te))@UclzGiCGh$B zp_7u_j_$|ftLjn~YVQ)*A~LIfFEax}{4U;->`QXHn><1OabQ>mBpDbL7+4s<;7)h! zLEcT;GgKH@8W>m-xPYVp0~1IM80-+deMmYb+QJj0iQ|9>L~8>?vY~pT_72A~*2yeD zO$`h_ji_41cQ;9=gd3o1%{a4u=>y$uI@0--{kM*-{W@bVqX2{EUj{=TOZ`1b4;4XX Nd%F6$taD0e0ssu}n-c&4 literal 0 HcmV?d00001 diff --git a/dev-assets/doodads/regions/fire.js b/dev-assets/doodads/regions/fire.js new file mode 100644 index 0000000..aae40c8 --- /dev/null +++ b/dev-assets/doodads/regions/fire.js @@ -0,0 +1,19 @@ +// Goal Region. +function main() { + Self.Hide(); + + Events.OnCollide(function (e) { + if (!e.Settled) { + return; + } + + // Only care if it's the player. + if (!e.Actor.IsPlayer()) { + return; + } + + if (e.InHitbox) { + FailLevel("You have died!"); + } + }); +} diff --git a/dev-assets/doodads/regions/goal-128.png b/dev-assets/doodads/regions/goal-128.png new file mode 100644 index 0000000000000000000000000000000000000000..b76991735766e6e6762b97b8e7e970c1eccf6a7d GIT binary patch literal 986 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7xzrU~I{Bb`J1#c2+1T%1_J8No8Qr zm{>c}*5j~)%+dH@S4~lN?GB5S6^{}eLyiQl4rt+87?yGM;FC-G8J8w3*nm5IldZQUej0Ta5>j_YDf3X zH>+-Z?Gj-5k}T46Mkm>C(xeZv@!vTkmQ`2g9BpXuusO|hS?!*}yn9=C z&;33k7&ayJQSl?g$$B1tPLv*fY<`Y)I_o@1!^>7JvJ+ToF(=lyAYIA`CcGo`bfJrV@HCnz{MimFaYRCZhK*VQWW_IT}|=5_H( z)1B4{Nmz;nG_u|N+Wi0E`@FS(p0rFC>0_R&-}l*&r{pbD@2tl)^45NjSvc&N!>dlm zuVgl!zvOyU)EAByciHsTMbFyA9`lZY*}pC4)H;zRnom9-_$^r*EcRkIt5bGd{@L0& zb_|)Xv?`fpWSEp$PsM$&EHAIl|35GD+jnLS*P_l(3HOuXTABOxwao{{F!Z*MvFH7hW% z2AJ5+D*wc@H~9UtH9j)UT(hDke4ljl%1Wj>L5;f>J;4?a|5lc-{6D+6_tv@S?3wAc z3o@B5?8v)W`lQ72N_OS>uMBaF91Khi3>OxJzguBw7Hu)hGe>s5y}kAC8&Q8|oZr6P zLP*>F)%W1n^1uIN&CTa`Saaa9f!{{1-oqBU{dZGix0OnMJGD7{|CHHbPJj1*E(SM{$Y7JPMG7UX>Ke(cA1lOuOb&)1j7?|<@P|G9sULV}j| zotk=ksr}yLQPG(aFYRmk6pN{01R-EF!8_i**75~mDKqsTFik*R>&V<**G_ybUAPb`d zg8&2L1s0$;6&QfN1%@mT*mTDppjwR$^(I$e*}(9RWCHNfCW9jYzrs>q#H0s&>w}rZp-`WYuBND=zDSq~?Bt846+B!qlB;il&U(Zm>GDb*5hJQoGZuvvP%1ZhgJJ zNBOABshpO8G#Q@rN_VtMo074*Nh8>n`PH!E zkAW}L*tCwpCT%0ws>oD3B*C)qxK3rVac}OW0gFBEelz#xQ`@^ltvwPFh<0ZvN*n56 zCUuQZIyDPxckyI=cD*ZOXtkD^DYa2%XlkjwLt=VuzPQfFa@+V_pPLVfFII^AoX*R; zEb^HVFU$TK++XynS=&gqwkL!$XNO3+Ym1HEr=w_>zviwCW7n1zA1OT-d`Tn=Nrb-Q5NhKE6KjZ6^= zE`a3LyVKJ|vf{G&LULB1FFd6NO@z}$e%X?Hrt)LVCSWH9$wxFUDP^zKcN}%kW7tV( z#^h%RJRSUxd1rz^$z0_8x~De&%{lrEH;A_>T$59&`-(h|g5>3r(ng^hEQ|q^5#0uw z+zlXnK}3To{D1?J1TWoeED?5=7XXsMkKPTrLj(f`xl?}p`FwVyYXC6OBZBn&_keoN z|K#tnTXJ}}`93ql@lC)H1O59Ypj~Qm)=vgX>qkpKVy literal 0 HcmV?d00001 diff --git a/dev-assets/doodads/regions/power-64.png b/dev-assets/doodads/regions/power-64.png new file mode 100644 index 0000000000000000000000000000000000000000..cfe47f55a065c001c773b19937b1e605d2e3fd36 GIT binary patch literal 873 zcmV-v1D5=WP)EX>4Tx04R}tkv&MmKpe$iQ$;Bi2P=p;WT@g`K~%(1t5Adrp;l;o12rOiL;hes*%ypVWNMI35kRU=q6(y8mBSx!EiiH&I$9?>Ru3sXTLaq`R zITlcX2HEw4|H1EWt^DMKmlTczoiC2_F${F=0*#vEd>=bb;{*sk16O*>U#SB#pQP7X zTJ#9$-3BhMTbi;5TFDGXRq=5hc0cJ@=K~#9!?OR(8gdhwQ!qL1F zXW&lW&HXYVL{YRY?RF;FpY;J9+Gz_hG9vyy=5z*m%Dq{DaAUC7A1MjdtUQ?W@vkjs_5yBKQ#o} zRc=Xv1~jW?P6NK+F2;LWBUzB8853-uzk45NwVIy1@XMg}FR03E(FQNfuD}iF= zI7Bv5PUtH4|8*9)D||+>ME#TW0ssI2z$;AT>$8-nq8Vd^lAmgAR1 z1ihp?6COadabh|Ir2G7+)p#jSNEVFeBqM4zUcw8aN4Hng4Ql8^f@kBW5um994W5k` z5y7joK`na^(d){Kg}}_Se|2?$#w|B-4^S5Z9ydic}*5j~)%+dH@S4~lN?GB5S6^{}eLyiQl4rt+87?yGM;FC-G8J8w3*nm5IldZQUej0Ta5>j_YDf3X zH>+-Z?Gj-5k}T46Mkm>C(xeZv@!vTkmQ`2g9BpXuusO|hS?!*}yn9=C z&;33k7&ayJQSl?g$$B1tPLv*fY<`Y)I_o@1!^>7JvJ+ToF(=lyAYIA`CcGo`bfJrV@HCnz{MimFaYRCZhK*VQWW_IT}|=5_H( z)1B4{Nmz;nG_u|N+Wi0E`@FS(p0rFC>0_R&-}l*&r{pbD@2tl)^45NjSvc&N!>dlm zuVgl!zvOyU)EAByciHsTMbFyA9`lZY*}pC4)H;zRnom9-_$^r*EcRkIt5bGd{@L0& zb_|)Xv?`fpWSEp$PsM$&EHAIl|35GD+jnLS*P_l(3HOuX@eA5~sqbZAVDk5LaSW-r_4ZC~Ub6xN zTS9Ktmb)v{U(BuA{&qU2a+k+J{dwv)=a)Gj31?A}j<;Wbf8l}OpXG|{%TF7w3wsy( z+NP4H#FxR!ye;qL&wqQ4Z>>zXSP&zX;WuBO*Y5g0 z{khWqPoGY+5C6Y(Kd-(2*1%W4ZP_26pCdfq`lPP-r;Nhb$G@gelbpWw3Sai|tib)t z`WY^}CO5ouG7kU$;hcT7euNF1hwWkSd55dZ^0$indcBsPUbyUY{j()@HjS%e4_p&h zkU66}HQMOJ9bE=X_MYZ|$9fjKey=lKydrY{UbcqBpZ$BKKJ_IxOmnn2s_@}<*OA!A zg6cPl|E}&~oF>*3Ww$t(+f(;d!Lm=!uZaW0Y{8_fu?JUL=DcfTv+h5yx<_ucw9_-a zv_F-v79F!r(J7eYeeL#v{K;Z^OP{qVl%KviGk$B_!Np_6FMa;5H1P{VFVlq2PLEe?PhDFj&$z;(E59(k&9+~`gzJFlvVuZ^6(S95 zvstpGHL~8%Dcx>9k8PP$b> literal 0 HcmV?d00001 diff --git a/dev-assets/doodads/regions/stall.js b/dev-assets/doodads/regions/stall.js new file mode 100644 index 0000000..c174594 --- /dev/null +++ b/dev-assets/doodads/regions/stall.js @@ -0,0 +1,40 @@ +// Stall Player. +// Tags: ms (int) +// Grabs the player one time. Resets if it receives power. +function main() { + Self.Hide(); + + var active = true, + timeout = 250, + ms = Self.GetTag("ms"); + + if (ms.length > 0) { + timeout = parseInt(ms); + } + + Events.OnCollide(function (e) { + if (!active || !e.Settled) { + return; + } + + // Only care if it's the player. + if (!e.Actor.IsPlayer()) { + return; + } + + if (e.InHitbox) { + // Grab hold of the player. + e.Actor.Freeze(); + setTimeout(function () { + e.Actor.Unfreeze(); + }, timeout); + + active = false; + } + }); + + // Reset the trap if powered by a button. + Message.Subscribe("power", function (powered) { + active = true; + }); +} diff --git a/pkg/uix/canvas_actors.go b/pkg/uix/canvas_actors.go index 32ad18a..ffdb9c8 100644 --- a/pkg/uix/canvas_actors.go +++ b/pkg/uix/canvas_actors.go @@ -83,6 +83,15 @@ func (w *Canvas) InstallScripts() error { } } + // Broadcast the "ready" signal to any actors that want to publish + // messages ASAP on level start. + for _, actor := range w.actors { + w.scripting.To(actor.ID()).Inbound <- scripting.Message{ + Name: "broadcast:ready", + Args: nil, + } + } + return nil } diff --git a/pkg/uix/scripting.go b/pkg/uix/scripting.go index cbb5ab2..3ca4daf 100644 --- a/pkg/uix/scripting.go +++ b/pkg/uix/scripting.go @@ -43,6 +43,8 @@ func (w *Canvas) MakeSelfAPI(actor *Actor) map[string]interface{} { "HasItem": actor.HasItem, "ClearInventory": actor.ClearInventory, "Destroy": actor.Destroy, + "Hide": actor.Hide, + "Show": actor.Show, "GetLinks": func() []map[string]interface{} { var result = []map[string]interface{}{} for _, linked := range w.GetLinkedActors(actor) { diff --git a/pkg/windows/doodad_dropper.go b/pkg/windows/doodad_dropper.go index f6d7e47..530db4a 100644 --- a/pkg/windows/doodad_dropper.go +++ b/pkg/windows/doodad_dropper.go @@ -91,6 +91,7 @@ func NewDoodadDropper(config DoodadDropper) *ui.Window { {"doors", "Doors"}, {"gizmos", "Gizmos"}, {"creatures", "Creatures"}, + {"technical", "Technical"}, {"", "All"}, } for _, category := range categories { @@ -114,6 +115,10 @@ func makeDoodadTab(config DoodadDropper, frame *ui.Frame, size render.Rect, cate columns = balance.DoodadDropperCols rows = balance.DoodadDropperRows + // Count how many doodad buttons we need vs. how many can fit. + iconsDrawn int + iconsPossible = columns * rows + // pagination values page = 1 pages int @@ -144,6 +149,50 @@ func makeDoodadTab(config DoodadDropper, frame *ui.Frame, size render.Rect, cate ), ) + // First, draw the empty grid of inset frames to serve as the 'background' + // of the drawer. This both serves an aesthetic purpose and reserves space + // in the widget for short page views. + { + var ( + decorFrame = ui.NewFrame("Background Slots") + row *ui.Frame + ) + + for i := 0; i < iconsPossible; i++ { + if row == nil || i%columns == 0 { + row = ui.NewFrame("BG Row") + decorFrame.Pack(row, ui.Pack{ + Side: ui.N, + }) + } + + spacer := ui.NewFrame("Spacer") + spacer.Configure(ui.Config{ + BorderSize: 2, + BorderStyle: ui.BorderSunken, + Background: render.Grey.Darken(20), + }) + spacer.Resize(render.NewRect( + buttonSize-2, // TODO: without the -2 the button border + buttonSize-2, // rests on top of the window border + )) + spacer.Compute(config.Engine) + row.Pack(spacer, ui.Pack{ + Side: ui.W, + }) + } + + decorFrame.Compute(config.Engine) + + // frame.Pack(decorFrame, ui.Pack{ + // Side: ui.NW, + // }) + frame.Place(decorFrame, ui.Place{ + Top: 0, + Left: 0, + }) + } + // Draw the doodad buttons in rows. var btnRows = []*ui.Frame{} { @@ -151,7 +200,8 @@ func makeDoodadTab(config DoodadDropper, frame *ui.Frame, size render.Rect, cate row *ui.Frame rowCount int // for labeling the ui.Frame for each row - // TODO: pre-size btnRows by calculating how many needed + // the state we end up at when we exhaust all doodads + lastColumn int // last position in current row ) for i, doodad := range items { @@ -162,17 +212,21 @@ func makeDoodadTab(config DoodadDropper, frame *ui.Frame, size render.Rect, cate rowCount++ row = ui.NewFrame(fmt.Sprintf("Doodad Row %d", rowCount)) - row.SetBackground(balance.DoodadButtonBackground) + + row.Resize(render.NewRect(size.W, buttonSize)) + row.Compute(config.Engine) btnRows = append(btnRows, row) frame.Pack(row, ui.Pack{ Side: ui.N, - // Fill: true, }) - // Hide overflowing rows until we scroll to them. + // Hide overflowing rows until we page to them. if hidden { row.Hide() } + + // New row, new columns. + lastColumn = 0 } can := uix.NewCanvas(int(buttonSize), true) @@ -213,6 +267,62 @@ func makeDoodadTab(config DoodadDropper, frame *ui.Frame, size render.Rect, cate )) btn.Compute(config.Engine) + + iconsDrawn++ + lastColumn++ + } + + // If we have fewer doodad icons than this page can hold, + // fill out dummy placeholder cells to maintain the UI shape. + // TODO: this is very redundant compared to the ATTEMPT above + // to only do this once. It seems our background widget doesn't + // size up the full tab height properly, so doodad tabs that + // have fewer than one page worth (short first page) the sizing + // was wrong. The below hack pads out the screen for short first + // pages only. There is still a bug with short LAST pages where + // it doesn't hold height and the pager buttons come up. + if iconsDrawn < iconsPossible { + for i := lastColumn; i < iconsPossible; i++ { + if row == nil || i%columns == 0 { + var hidden = rowCount >= rows + rowCount++ + + row = ui.NewFrame(fmt.Sprintf("Doodad Row %d", rowCount)) + row.SetBackground(balance.DoodadButtonBackground) + btnRows = append(btnRows, row) + frame.Pack(row, ui.Pack{ + Side: ui.N, + }) + + // Hide overflowing rows until we page to them. + if hidden { + row.Hide() + } + } + + spacer := ui.NewFrame("Spacer") + spacer.Configure(ui.Config{ + BorderSize: 2, + BorderStyle: ui.BorderSunken, + Background: render.Grey, + }) + spacer.Resize(render.NewRect( + buttonSize-2, // TODO: without the -2 the button border + buttonSize-2, // rests on top of the window border + )) + spacer.Compute(config.Engine) + row.Pack(spacer, ui.Pack{ + Side: ui.W, + }) + + // debug + // lbl := ui.NewLabel(ui.Label{ + // Text: fmt.Sprintf("i=%d\nrow=%d", i, rowCount), + // }) + // spacer.Pack(lbl, ui.Pack{ + // Side: ui.NW, + // }) + } } } diff --git a/scripts/fpm-bundle-32bit.sh b/scripts/fpm-bundle-32bit.sh new file mode 100755 index 0000000..5ed3de8 --- /dev/null +++ b/scripts/fpm-bundle-32bit.sh @@ -0,0 +1,88 @@ +#!/bin/bash + +# fpm-bundle: create bundles for the app. + +# Add the user-level "gem install fpm" to the $PATH. +# Might need fixing over time. +export PATH="$PATH:$HOME/.local/share/gem/ruby/3.0.0/bin" + +INSTALL_ROOT="/opt/sketchy-maze" +LAUNCHER_FILENAME="etc/linux/net.kirsle.ProjectDoodle.desktop" +LAUNCHER_ROOT="/usr/share/applications" # Where the .desktop file goes. +ICON_ROOT="/usr/share/icons/hicolor/" + +# Find out how many levels up we need to go, so this +# script can run from either of these locations: +# ./dist/sketchymaze-$version/ +# ./dist/stage/$version/linux/ +UPLEVELS="." +if [[ -f "../../${LAUNCHER_FILENAME}" ]]; then + # run from a ./dist/x folder. + UPLEVELS="../.." +elif [[ -f "../../../../${LAUNCHER_FILENAME}" ]]; then + # run from a release stage folder + UPLEVELS="../../../.." +else + echo Did not find ${LAUNCHER_FILENAME} relative to your working directory. + echo Good places to run this script include: + echo " * ./dist/sketchymaze-\$version/ (as in 'make dist')" + echo " * ./dist/stage/\$version/linux/ (as in 'make release')" + exit 1 +fi + +VERSION=`egrep -e 'Version\s+=' ${UPLEVELS}/pkg/branding/branding.go | head -n 1 | cut -d '"' -f 2` +LAUNCHER_FILE="${UPLEVELS}/${LAUNCHER_FILENAME}" + +if [[ ! -f "./sketchymaze" ]]; then + echo Run this script from the directory containing the Doodle binary. + echo This is usually at /dist/doodle-VERSION/ relative to the git root. + exit 1 +fi + +if [[ ! -f "$LAUNCHER_FILE" ]]; then + echo "Didn't find Linux desktop launcher relative to current folder." + echo "I looked at $LAUNCHER_FILE." + exit 1 +fi + +# Clean previous artifacts. +rm *.rpm *.deb + +# Create the root structure. +mkdir -p root +mkdir -p root$INSTALL_ROOT root$LAUNCHER_ROOT +cp * root$INSTALL_ROOT/ +cp $LAUNCHER_FILE root$LAUNCHER_ROOT/ + +# Copy icons in. +mkdir -p root$ICON_ROOT/{256x256,128x128,64x64,32x32,16x16}/apps +cp ${UPLEVELS}/etc/icons/256.png "root${ICON_ROOT}256x256/apps/project-doodle.png" +cp ${UPLEVELS}/etc/icons/128.png "root${ICON_ROOT}128x128/apps/project-doodle.png" +cp ${UPLEVELS}/etc/icons/64.png "root$ICON_ROOT/64x64/apps/project-doodle.png" +cp ${UPLEVELS}/etc/icons/32.png "root$ICON_ROOT/32x32/apps/project-doodle.png" +cp ${UPLEVELS}/etc/icons/16.png "root$ICON_ROOT/16x16/apps/project-doodle.png" + +# Copy runtime package and guidebook +cp -r guidebook rtp "root$INSTALL_ROOT/" + +echo ===================== +echo Starting fpm package build. +echo ===================== + +# RPM Package +fpm -C ./root -s dir -t rpm \ + -d SDL2 -d SDL2_ttf -a i386 \ + -n sketchy-maze -v ${VERSION} \ + --license="Copyright" \ + --maintainer=noah@kirsle.net \ + --description="Sketchy Maze - A drawing-based maze game." \ + --url="https://www.sketchymaze.com" + +# Debian Package +fpm -C ./root -s dir -t deb \ + -d libsdl2 -d libsdl2-ttf -a i386 \ + -n sketchy-maze -v ${VERSION} \ + --license="Copyright" \ + --maintainer=noah@kirsle.net \ + --description="Sketchy Maze - A drawing-based maze game." \ + --url="https://www.sketchymaze.com"