diff --git a/Makefile b/Makefile index 6433974..a8cba8b 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ all: check: stylua -c src/ - cat __stub.ext.lua <(sed 's/^function/-- selene: allow(unused_variable)\nfunction/' ${PLAYDATE_SDK_PATH}/CoreLibs/__stub.lua) ${SOURCE_FILES} | grep -v '^import' | sed 's///g' | selene - + cat __stub.ext.lua <(sed 's/^function/-- selene: allow(unused_variable)\nfunction/' ${PLAYDATE_SDK_PATH}/CoreLibs/__types.lua) ${SOURCE_FILES} | grep -v '^import' | sed 's///g' | selene - lint: stylua src/ diff --git a/__stub.ext.lua b/__stub.ext.lua index 2a90888..da90630 100644 --- a/__stub.ext.lua +++ b/__stub.ext.lua @@ -1,31 +1,15 @@ -- A small additional stub to keep Selene from complaining about playdate being missing. --- Strictly, just putting `playdate = {}` would alleviate these warnings, but I've also --- found that this quick structure, *actually* prepended to __stub.lua can help --- SumnekoLua (an IntelliJ plugin) better provide autocompletion. +-- These warning-allieviators could also be injected directly into __types.lua +-- Base __types.lua can be found at https://github.com/balpha/playdate-types -- selene: allow(unused_variable) -- selene: allow(unscoped_variables) -playdate = { - datastore = {}, - display = {}, - file = {}, - frameTimer = {}, - geometry = {}, - graphics = {}, - inputHandlers = {}, - json = {}, - keyboard = {}, - math = {}, - menu = { - item = {} - }, - pathfinder = {}, - simulator = {}, - sound = { - sampleplayer = {} - }, - string = {}, - table = {}, - timer = {}, - ui = {} -} \ No newline at end of file +playdate = playdate + +-- selene: allow(unscoped_variables) +-- selene: allow(unused_variable) +json = json + +-- selene: allow(unused_variable) +-- selene: allow(unscoped_variables) +kTextAlignment = kTextAlignment diff --git a/src/fonts/Roobert-20-Medium-table-32-32.png b/src/fonts/Roobert-20-Medium-table-32-32.png new file mode 100644 index 0000000..0e7b41b Binary files /dev/null and b/src/fonts/Roobert-20-Medium-table-32-32.png differ diff --git a/src/fonts/Roobert-20-Medium.fnt b/src/fonts/Roobert-20-Medium.fnt new file mode 100644 index 0000000..5baaa1c --- /dev/null +++ b/src/fonts/Roobert-20-Medium.fnt @@ -0,0 +1,591 @@ +--metrics={"baseline":0,"xHeight":0,"capHeight":0,"pairs":{"10":[-1,0,0,0],"11":[-1,0,0,0],"12":[-1,0,0,0],"13":[-1,0,0,0],"14":[-1,0,0,0],"15":[-1,0,0,0],"16":[-1,0,0,0],"17":[-1,0,0,0],"18":[-1,0,0,0],"19":[-1,0,0,0],"20":[-1,0,0,0],"21":[-1,0,0,0],"22":[-1,0,0,0],"23":[-1,0,0,0],"24":[-1,0,0,0],"25":[-1,0,0,0],"26":[-1,0,0,0],"27":[-1,0,0,0],"28":[-1,0,0,0],"29":[-1,0,0,0],"30":[-1,0,0,0],"31":[-1,0,0,0],"32":[-1,0,0,0],"33":[-1,0,0,0],"34":[-1,0,0,0],"35":[-1,0,0,0],"36":[-1,0,0,0],"37":[-1,0,0,0],"38":[-1,0,0,0],"39":[-1,0,0,0],"40":[-1,0,0,0],"41":[-1,0,0,0],"42":[-1,0,0,0],"43":[-1,0,0,0],"44":[-1,0,0,0],"45":[-1,0,0,0],"46":[-1,0,0,0],"47":[-1,0,0,0],"48":[-1,0,0,0],"49":[-1,0,0,0],"50":[-1,0,0,0],"51":[-1,0,0,0],"52":[-1,0,0,0],"53":[-1,0,0,0],"54":[-1,0,0,0],"55":[-1,0,0,0],"56":[-1,0,0,0],"57":[-1,0,0,0],"58":[-1,0,0,0],"59":[-1,0,0,0],"60":[-1,0,0,0],"61":[-1,0,0,0],"62":[-1,0,0,0],"63":[-1,0,0,0],"64":[-1,0,0,0],"65":[-1,0,0,0],"66":[-1,0,0,0],"67":[-1,0,0,0],"68":[-1,0,0,0],"69":[-1,0,0,0],"70":[-1,0,0,0],"71":[-1,0,0,0],"72":[-1,0,0,0],"73":[-1,0,0,0],"74":[-1,0,0,0],"75":[-1,0,0,0],"76":[-1,0,0,0],"77":[-1,0,0,0],"78":[-1,0,0,0],"79":[-1,0,0,0],"80":[-1,0,0,0],"81":[-1,0,0,0],"82":[-1,0,0,0],"83":[-1,0,0,0],"84":[-1,0,0,0],"85":[-1,0,0,0],"86":[-1,0,0,0],"87":[-1,0,0,0],"88":[-1,0,0,0],"89":[-1,0,0,0],"90":[-1,0,0,0],"91":[-1,0,0,0],"92":[-1,0,0,0],"93":[-1,0,0,0],"94":[-1,0,0,0],"95":[-1,0,0,0],"96":[-1,0,0,0],"97":[-1,0,0,0],"98":[-1,0,0,0],"99":[-1,0,0,0],"00":[-1,0,0,0],"01":[-1,0,0,0],"02":[-1,0,0,0],"03":[-1,0,0,0],"04":[-1,0,0,0],"05":[-1,0,0,0],"06":[-1,0,0,0],"07":[-1,0,0,0],"08":[-1,0,0,0],"09":[-1,0,0,0],"A'":[-3,0,0,0],"ac":[0,0],"AC":[-1,0,0,0],"Ac":[-1,0,0,0],"ad":[0,0],"Ad":[-1,0,0,0],"ae":[0,0],"Ae":[-1,0,0,0],"af":[-1,0,0,0],"ag":[0,0],"AG":[-1,0,0,0],"Ag":[-1,0,0,0],"AO":[-1,0,0,0],"Ao":[-1,0,0,0],"ap":[0,0],"Ap":[-1,0,0,0],"AQ":[-1,0,0,0],"Aq":[-1,0,0,0],"At":[-1,0,0,0],"at":[-1,0,0,0],"AT":[-4,0,0,0],"Au":[-1,0,0,0],"au":[0,0],"AU":[-1,0,0,0],"Av":[-2,0,0,0],"av":[-1,0,0,0],"AV":[-4,0,0,0],"Aw":[-2,0,0,0],"aw":[-1,0,0,0],"AW":[-4,0,0,0],"Ay":[-3,0,0,0],"ay":[-1,0,0,0],"AY":[-5,0,0,0],"b,":[-2,0,0,0],"B,":[-3,0,0,0],"b.":[-1,0,0,0],"B.":[-1,0,0,0],"BA":[-1,0,0,0],"Bb":[0,0],"BE":[0,0],"Bi":[1,0,0,0],"Bk":[1,0,0,0],"Bl":[1,0,0,0],"bl":[1,0,0,0],"BL":[1,0,0,0],"BP":[1,0,0,0],"br":[1,0,0,0],"BR":[1,0,0,0],"Br":[0,0],"bu":[0,0],"BU":[0,0],"Bu":[0,0],"BV":[-1,0,0,0],"BW":[-1,0,0,0],"by":[-2,0,0,0],"BY":[-2,0,0,0],"By":[-1,0,0,0],"C,":[-2,0,0,0],"C.":[-1,0,0,0],"ca":[0,0],"CA":[-1,0,0,0],"Ca":[0,0],"ch":[0,0],"ck":[0,0],"CO":[-1,0,0,0],"CR":[0,0],"Cr":[0,0],"d,":[-1,0,0,0],"D,":[-3,0,0,0],"d.":[0,0],"D.":[-2,0,0,0],"da":[0,0],"DA":[-2,0,0,0],"Da":[-1,0,0,0],"dc":[0,0],"DD":[0,0],"de":[0,0],"DE":[0,0],"dg":[0,0],"DI":[1,0,0,0],"DL":[1,0,0,0],"DM":[1,0,0,0],"DN":[1,0,0,0],"do":[1,0,0,0],"DO":[0,0],"DP":[0,0],"DR":[0,0],"dt":[0,0],"du":[1,0,0,0],"DU":[1,0,0,0],"dv":[0,0],"DV":[-1,0,0,0],"dw":[0,0],"DW":[-1,0,0,0],"dy":[0,0],"DY":[-3,0,0,0],"e,":[-2,0,0,0],"e.":[-1,0,0,0],"ea":[0,0],"EC":[-1,0,0,0],"ei":[1,0,0,0],"el":[1,0,0,0],"em":[0,0],"en":[1,0,0,0],"EO":[-1,0,0,0],"ep":[1,0,0,0],"er":[1,0,0,0],"et":[-1,0,0,0],"eu":[0,0],"Eu":[-1,0,0,0],"ev":[-1,0,0,0],"Ev":[-1,0,0,0],"ew":[-1,0,0,0],"ey":[-1,0,0,0],"f,":[-3,0,0,0],"F,":[-4,0,0,0],"F;":[-3,0,0,0],"F:":[-1,0,0,0],"f.":[-3,0,0,0],"F.":[-4,0,0,0],"fa":[-1,0,0,0],"FA":[-3,0,0,0],"Fa":[-1,0,0,0],"FC":[-1,0,0,0],"fe":[-1,0,0,0],"Fe":[-2,0,0,0],"ff":[-2,0,0,0],"FG":[-1,0,0,0],"fi":[0,0],"Fi":[0,0],"fl":[0,0],"fo":[-2,0,0,0],"FO":[-1,0,0,0],"Fo":[-2,0,0,0],"Fr":[-1,0,0,0],"Ft":[-1,0,0,0],"Fu":[-1,0,0,0],"Fy":[-2,0,0,0],"g,":[0,0],"g.":[0,0],"ga":[0,0],"ge":[0,0],"GE":[0,0],"gg":[0,0],"gh":[1,0,0,0],"gl":[1,0,0,0],"go":[0,0],"GO":[-1,0,0,0],"GR":[1,0,0,0],"Gu":[0,0],"GU":[1,0,0,0],"hc":[0,0],"hd":[0,0],"he":[0,0],"He":[0,0],"hg":[0,0],"ho":[0,0],"HO":[0,0],"Ho":[0,0],"hp":[0,0],"ht":[-1,0,0,0],"hu":[0,0],"Hu":[0,0],"hv":[-1,0,0,0],"hw":[-1,0,0,0],"hy":[-1,0,0,0],"Hy":[-1,0,0,0],"ic":[0,0],"IC":[0,0],"Ic":[0,0],"id":[-1,0,0,0],"Id":[0,0],"ie":[-1,0,0,0],"ig":[0,0],"IG":[0,0],"io":[0,0],"IO":[-1,0,0,0],"Io":[0,0],"ip":[1,0,0,0],"iq":[0,0],"Iq":[0,0],"it":[-1,0,0,0],"It":[0,0],"iu":[1,0,0,0],"iv":[0,0],"j,":[0,0],"J,":[-1,0,0,0],"j.":[1,0,0,0],"J.":[0,0],"ja":[1,0,0,0],"JA":[-1,0,0,0],"Ja":[0,0],"je":[0,0],"Je":[0,0],"jo":[0,0],"JO":[0,0],"Jo":[0,0],"ju":[1,0,0,0],"Ju":[0,0],"ka":[-2,0,0,0],"kc":[-2,0,0,0],"kd":[-2,0,0,0],"ke":[-2,0,0,0],"Ke":[-3,0,0,0],"kg":[-2,0,0,0],"ko":[-3,0,0,0],"KO":[-4,0,0,0],"Ko":[-3,0,0,0],"Ku":[-2,0,0,0],"L'":[-3,0,0,0],"la":[0,0],"lc":[0,0],"LC":[-2,0,0,0],"ld":[0,0],"le":[0,0],"lf":[0,0],"lg":[0,0],"LG":[-3,0,0,0],"li":[1,0,0,0],"lo":[0,0],"LO":[-3,0,0,0],"lp":[1,0,0,0],"lq":[0,0],"LT":[-5,0,0,0],"Lu":[-1,0,0,0],"lu":[0,0],"LU":[-1,0,0,0],"lv":[0,0],"LV":[-5,0,0,0],"lw":[0,0],"LW":[-5,0,0,0],"Ly":[-3,0,0,0],"LY":[-6,0,0,0],"Ma":[0,0],"ma":[0,0],"Mc":[-1,0,0,0],"mc":[0,0],"Md":[0,0],"md":[0,0],"Me":[0,0],"me":[0,0],"mg":[0,0],"MG":[-1,0,0,0],"mn":[0,0],"MO":[-1,0,0,0],"Mo":[-1,0,0,0],"mo":[0,0],"mp":[0,0],"mt":[-1,0,0,0],"mu":[0,0],"mv":[-1,0,0,0],"my":[-1,0,0,0],"N,":[-1,0,0,0],"N.":[-1,0,0,0],"Na":[0,0],"nc":[0,0],"NC":[-1,0,0,0],"nd":[0,0],"ne":[0,0],"Ne":[0,0],"ng":[0,0],"NG":[-1,0,0,0],"Ni":[1,0,0,0],"no":[0,0],"NO":[-1,0,0,0],"No":[0,0],"np":[1,0,0,0],"nt":[-1,0,0,0],"nu":[0,0],"Nu":[0,0],"nv":[-1,0,0,0],"nw":[-1,0,0,0],"ny":[-1,0,0,0],"o,":[-4,0,0,0],"O,":[-4,0,0,0],"o.":[-2,0,0,0],"O.":[-2,0,0,0],"OA":[-2,0,0,0],"Oa":[-1,0,0,0],"ob":[0,0],"OB":[0,0],"Ob":[0,0],"OD":[0,0],"OE":[0,0],"of":[-2,0,0,0],"OF":[0,0],"oh":[0,0],"OH":[0,0],"Oh":[0,0],"OI":[0,0],"oj":[-4,0,0,0],"ok":[-1,0,0,0],"OK":[0,0],"Ok":[0,0],"ol":[-1,0,0,0],"OL":[0,0],"Ol":[0,0],"om":[-1,0,0,0],"OM":[0,0],"ON":[0,0],"oo":[-2,0,0,0],"op":[-1,0,0,0],"OP":[0,0],"or":[-1,0,0,0],"OR":[0,0],"OT":[-3,0,0,0],"ou":[-1,0,0,0],"OU":[0,0],"ov":[-2,0,0,0],"OV":[-2,0,0,0],"ow":[-2,0,0,0],"OW":[-2,0,0,0],"ox":[-2,0,0,0],"OX":[-2,0,0,0],"oy":[-2,0,0,0],"OY":[-2,0,0,0],"p,":[-3,0,0,0],"P,":[-5,0,0,0],"P;":[-1,0,0,0],"P:":[-1,0,0,0],"p.":[-1,0,0,0],"P.":[-1,0,0,0],"pa":[0,0],"PA":[-1,0,0,0],"Pa":[-1,0,0,0],"PE":[-1,0,0,0],"Pe":[-1,0,0,0],"ph":[0,0],"pi":[0,0],"pl":[0,0],"PL":[-1,0,0,0],"PO":[-1,0,0,0],"Po":[-1,0,0,0],"pp":[0,0],"PP":[-1,0,0,0],"pu":[0,0],"PU":[-1,0,0,0],"PY":[-1,0,0,0],"qu":[0,0],"QU":[-1,0,0,0],"r,":[-3,0,0,0],"r.":[-2,0,0,0],"ra":[-1,0,0,0],"RC":[-1,0,0,0],"Rd":[-1,0,0,0],"rd":[-1,0,0,0],"Re":[-1,0,0,0],"re":[-2,0,0,0],"rg":[-1,0,0,0],"RG":[-1,0,0,0],"rk":[0,0],"rl":[0,0],"rm":[0,0],"rn":[0,0],"Ro":[0,0],"ro":[-2,0,0,0],"rq":[-1,0,0,0],"rr":[0,0],"Rt":[-1,0,0,0],"rt":[-1,0,0,0],"RT":[-1,0,0,0],"Ru":[-1,0,0,0],"RU":[-1,0,0,0],"rv":[0,0],"RV":[-1,0,0,0],"RW":[-1,0,0,0],"ry":[0,0],"RY":[-1,0,0,0],"s,":[-1,0,0,0],"S,":[-1,0,0,0],"s.":[-1,0,0,0],"S.":[-1,0,0,0],"sh":[0,0],"SI":[-1,0,0,0],"Si":[-1,0,0,0],"SM":[-1,0,0,0],"Sp":[-1,0,0,0],"st":[-1,0,0,0],"ST":[-1,0,0,0],"su":[0,0],"SU":[-1,0,0,0],"Su":[-1,0,0,0],"T,":[-3,0,0,0],"t,":[-1,0,0,0],"T;":[-3,0,0,0],"T:":[-2,0,0,0],"T.":[-3,0,0,0],"t.":[1,0,0,0],"ta":[0,0],"TA":[-3,0,0,0],"Ta":[-2,0,0,0],"TC":[-2,0,0,0],"Tc":[-3,0,0,0],"td":[0,0],"te":[-1,0,0,0],"Te":[-2,0,0,0],"Ti":[0,0],"to":[-1,0,0,0],"TO":[-2,0,0,0],"To":[-4,0,0,0],"Tr":[-3,0,0,0],"Ts":[-3,0,0,0],"Tu":[-3,0,0,0],"tw":[-1,0,0,0],"Tw":[-3,0,0,0],"Ty":[-3,0,0,0],"U,":[-1,0,0,0],"U.":[-1,0,0,0],"ua":[0,0],"UA":[-1,0,0,0],"Ua":[-1,0,0,0],"uc":[0,0],"UC":[-1,0,0,0],"ud":[0,0],"ue":[0,0],"ug":[0,0],"UG":[-1,0,0,0],"Ug":[-1,0,0,0],"Um":[-1,0,0,0],"Un":[-1,0,0,0],"uo":[0,0],"UO":[-1,0,0,0],"up":[0,0],"Up":[-1,0,0,0],"uq":[0,0],"US":[-1,0,0,0],"Us":[-1,0,0,0],"ut":[-1,0,0,0],"uv":[0,0],"uw":[0,0],"uy":[0,0],"v,":[-2,0,0,0],"V,":[-1,0,0,0],"V;":[-1,0,0,0],"V:":[-1,0,0,0],"v.":[-2,0,0,0],"V.":[-1,0,0,0],"va":[0,0],"VA":[-1,0,0,0],"Va":[-1,0,0,0],"vb":[0,0],"vc":[-1,0,0,0],"VC":[-1,0,0,0],"vd":[-1,0,0,0],"ve":[-1,0,0,0],"Ve":[-1,0,0,0],"vg":[-1,0,0,0],"VG":[-1,0,0,0],"Vi":[-1,0,0,0],"vo":[-2,0,0,0],"VO":[-1,0,0,0],"Vo":[-3,0,0,0],"Vr":[-1,0,0,0],"VS":[-1,0,0,0],"Vu":[-1,0,0,0],"vv":[0,0],"vy":[-1,0,0,0],"w,":[-2,0,0,0],"W,":[-1,0,0,0],"W;":[-1,0,0,0],"W:":[-1,0,0,0],"w.":[-2,0,0,0],"W.":[-1,0,0,0],"wa":[-1,0,0,0],"WA":[-1,0,0,0],"WC":[-1,0,0,0],"wd":[-1,0,0,0],"Wd":[-1,0,0,0],"we":[-1,0,0,0],"wg":[-1,0,0,0],"WG":[-1,0,0,0],"wh":[0,0],"Wi":[-1,0,0,0],"Wm":[-1,0,0,0],"wo":[-2,0,0,0],"WO":[-1,0,0,0],"Wr":[-1,0,0,0],"Wt":[-1,0,0,0],"Wu":[-1,0,0,0],"wx":[-1,0,0,0],"Wy":[-1,0,0,0],"Xa":[-1,0,0,0],"xa":[-1,0,0,0],"Xe":[-1,0,0,0],"xe":[-1,0,0,0],"Xo":[-1,0,0,0],"xo":[-1,0,0,0],"Xu":[-1,0,0,0],"Xy":[-1,0,0,0],"Y,":[-1,0,0,0],"y,":[-4,0,0,0],"Y;":[-1,0,0,0],"Y:":[-1,0,0,0],"Y.":[-1,0,0,0],"y.":[-3,0,0,0],"ya":[-1,0,0,0],"YA":[-4,0,0,0],"yc":[-1,0,0,0],"YC":[-1,0,0,0],"yd":[-1,0,0,0],"Yd":[-1,0,0,0],"ye":[-1,0,0,0],"Ye":[-1,0,0,0],"Yi":[-1,0,0,0],"yo":[-1,0,0,0],"YO":[-2,0,0,0],"Yp":[-1,0,0,0],"YS":[-1,0,0,0],"Yu":[-1,0,0,0],"Yv":[-1,0,0,0],"ZO":[-1,0,0,0],"am":[1,0,0,0],"ot":[-2,0,0,0],"ih":[1,0,0,0],"ij":[-3,0,0,0],"ik":[1,0,0,0],"il":[1,0,0,0],"im":[1,0,0,0],"in":[1,0,0,0],"iz":[1,0,0,0],"ji":[1,0,0,0],"ef":[-1,0,0,0],"tt":[-1,0,0,0],"pt":[-1,0,0,0],"ti":[0,0],"//":[-6,0,0,0],"/w":[-2,0,0,0],"Zo":[-1,0,0,0],"od":[0,0],"di":[2,0,0,0],"Mi":[1,0,0,0],"ll":[1,0,0,0],"zo":[-1,0,0,0],"oz":[-1,0,0,0],"OZ":[-1,0,0,0],"YY":[-1,0,0,0],"HE":[1,0,0,0],"ND":[1,0,0,0],"XO":[-2,0,0,0],"MI":[1,0,0,0],"MM":[1,0,0,0],"IM":[1,0,0,0],"NI":[1,0,0,0],"UM":[1,0,0,0],"RI":[1,0,0,0],"OS":[-1,0,0,0]},"left":[],"right":[]} +tracking=2 + +0 15 +1 7 +2 14 +3 15 +4 17 +5 15 +6 15 +7 14 +8 15 +9 15 +space 6 +! 3 +" 8 +# 17 +$ 16 +% 18 +& 18 +' 3 +( 6 +) 6 +* 10 ++ 15 +, 5 +- 12 +. 3 +/ 13 +: 3 +; 5 +< 10 += 14 +> 10 +? 12 +@ 25 +A 18 +B 15 +C 18 +D 17 +E 13 +F 13 +G 18 +H 16 +I 3 +J 7 +K 17 +L 13 +M 18 +N 14 +O 21 +P 14 +Q 21 +R 15 +S 16 +T 15 +U 16 +V 16 +W 29 +X 14 +Y 15 +Z 15 +[ 6 +\ 12 +] 5 +^ 12 +_ 14 +` 5 +a 13 +b 15 +c 14 +d 14 +e 15 +f 10 +g 15 +h 13 +i 3 +j 7 +k 13 +l 3 +m 23 +n 13 +o 15 +p 15 +q 15 +r 9 +s 12 +t 10 +u 13 +v 12 +w 21 +x 12 +y 14 +z 12 +{ 8 +| 3 +} 8 +~ 15 +¥ 15 +… 17 +™ 21 +‼ 8 +© 20 +® 20 +� 15 +Ⓐ 27 +Ⓑ 27 +🌐 25 +› 14 +▸ 12 +✨ 29 + +10 -1 +11 -1 +12 -1 +13 -1 +14 -1 +15 -1 +16 -1 +17 -1 +18 -1 +19 -1 +20 -1 +21 -1 +22 -1 +23 -1 +24 -1 +25 -1 +26 -1 +27 -1 +28 -1 +29 -1 +30 -1 +31 -1 +32 -1 +33 -1 +34 -1 +35 -1 +36 -1 +37 -1 +38 -1 +39 -1 +40 -1 +41 -1 +42 -1 +43 -1 +44 -1 +45 -1 +46 -1 +47 -1 +48 -1 +49 -1 +50 -1 +51 -1 +52 -1 +53 -1 +54 -1 +55 -1 +56 -1 +57 -1 +58 -1 +59 -1 +60 -1 +61 -1 +62 -1 +63 -1 +64 -1 +65 -1 +66 -1 +67 -1 +68 -1 +69 -1 +70 -1 +71 -1 +72 -1 +73 -1 +74 -1 +75 -1 +76 -1 +77 -1 +78 -1 +79 -1 +80 -1 +81 -1 +82 -1 +83 -1 +84 -1 +85 -1 +86 -1 +87 -1 +88 -1 +89 -1 +90 -1 +91 -1 +92 -1 +93 -1 +94 -1 +95 -1 +96 -1 +97 -1 +98 -1 +99 -1 +00 -1 +01 -1 +02 -1 +03 -1 +04 -1 +05 -1 +06 -1 +07 -1 +08 -1 +09 -1 +A' -3 +AC -1 +Ac -1 +Ad -1 +Ae -1 +af -1 +AG -1 +Ag -1 +AO -1 +Ao -1 +Ap -1 +AQ -1 +Aq -1 +At -1 +at -1 +AT -4 +Au -1 +AU -1 +Av -2 +av -1 +AV -4 +Aw -2 +aw -1 +AW -4 +Ay -3 +ay -1 +AY -5 +b, -2 +B, -3 +b. -1 +B. -1 +BA -1 +Bi 1 +Bk 1 +Bl 1 +bl 1 +BL 1 +BP 1 +br 1 +BR 1 +BV -1 +BW -1 +by -2 +BY -2 +By -1 +C, -2 +C. -1 +CA -1 +CO -1 +d, -1 +D, -3 +D. -2 +DA -2 +Da -1 +DI 1 +DL 1 +DM 1 +DN 1 +do 1 +du 1 +DU 1 +DV -1 +DW -1 +DY -3 +e, -2 +e. -1 +EC -1 +ei 1 +el 1 +en 1 +EO -1 +ep 1 +er 1 +et -1 +Eu -1 +ev -1 +Ev -1 +ew -1 +ey -1 +f, -3 +F, -4 +F; -3 +F: -1 +f. -3 +F. -4 +fa -1 +FA -3 +Fa -1 +FC -1 +fe -1 +Fe -2 +ff -2 +FG -1 +fo -2 +FO -1 +Fo -2 +Fr -1 +Ft -1 +Fu -1 +Fy -2 +gh 1 +gl 1 +GO -1 +GR 1 +GU 1 +ht -1 +hv -1 +hw -1 +hy -1 +Hy -1 +id -1 +ie -1 +IO -1 +ip 1 +it -1 +iu 1 +J, -1 +j. 1 +ja 1 +JA -1 +ju 1 +ka -2 +kc -2 +kd -2 +ke -2 +Ke -3 +kg -2 +ko -3 +KO -4 +Ko -3 +Ku -2 +L' -3 +LC -2 +LG -3 +li 1 +LO -3 +lp 1 +LT -5 +Lu -1 +LU -1 +LV -5 +LW -5 +Ly -3 +LY -6 +Mc -1 +MG -1 +MO -1 +Mo -1 +mt -1 +mv -1 +my -1 +N, -1 +N. -1 +NC -1 +NG -1 +Ni 1 +NO -1 +np 1 +nt -1 +nv -1 +nw -1 +ny -1 +o, -4 +O, -4 +o. -2 +O. -2 +OA -2 +Oa -1 +of -2 +oj -4 +ok -1 +ol -1 +om -1 +oo -2 +op -1 +or -1 +OT -3 +ou -1 +ov -2 +OV -2 +ow -2 +OW -2 +ox -2 +OX -2 +oy -2 +OY -2 +p, -3 +P, -5 +P; -1 +P: -1 +p. -1 +P. -1 +PA -1 +Pa -1 +PE -1 +Pe -1 +PL -1 +PO -1 +Po -1 +PP -1 +PU -1 +PY -1 +QU -1 +r, -3 +r. -2 +ra -1 +RC -1 +Rd -1 +rd -1 +Re -1 +re -2 +rg -1 +RG -1 +ro -2 +rq -1 +Rt -1 +rt -1 +RT -1 +Ru -1 +RU -1 +RV -1 +RW -1 +RY -1 +s, -1 +S, -1 +s. -1 +S. -1 +SI -1 +Si -1 +SM -1 +Sp -1 +st -1 +ST -1 +SU -1 +Su -1 +T, -3 +t, -1 +T; -3 +T: -2 +T. -3 +t. 1 +TA -3 +Ta -2 +TC -2 +Tc -3 +te -1 +Te -2 +to -1 +TO -2 +To -4 +Tr -3 +Ts -3 +Tu -3 +tw -1 +Tw -3 +Ty -3 +U, -1 +U. -1 +UA -1 +Ua -1 +UC -1 +UG -1 +Ug -1 +Um -1 +Un -1 +UO -1 +Up -1 +US -1 +Us -1 +ut -1 +v, -2 +V, -1 +V; -1 +V: -1 +v. -2 +V. -1 +VA -1 +Va -1 +vc -1 +VC -1 +vd -1 +ve -1 +Ve -1 +vg -1 +VG -1 +Vi -1 +vo -2 +VO -1 +Vo -3 +Vr -1 +VS -1 +Vu -1 +vy -1 +w, -2 +W, -1 +W; -1 +W: -1 +w. -2 +W. -1 +wa -1 +WA -1 +WC -1 +wd -1 +Wd -1 +we -1 +wg -1 +WG -1 +Wi -1 +Wm -1 +wo -2 +WO -1 +Wr -1 +Wt -1 +Wu -1 +wx -1 +Wy -1 +Xa -1 +xa -1 +Xe -1 +xe -1 +Xo -1 +xo -1 +Xu -1 +Xy -1 +Y, -1 +y, -4 +Y; -1 +Y: -1 +Y. -1 +y. -3 +ya -1 +YA -4 +yc -1 +YC -1 +yd -1 +Yd -1 +ye -1 +Ye -1 +Yi -1 +yo -1 +YO -2 +Yp -1 +YS -1 +Yu -1 +Yv -1 +ZO -1 +am 1 +ot -2 +ih 1 +ij -3 +ik 1 +il 1 +im 1 +in 1 +iz 1 +ji 1 +ef -1 +tt -1 +pt -1 +// -6 +/w -2 +Zo -1 +di 2 +Mi 1 +ll 1 +zo -1 +oz -1 +OZ -1 +YY -1 +HE 1 +ND 1 +XO -2 +MI 1 +MM 1 +IM 1 +NI 1 +UM 1 +RI 1 +OS -1 diff --git a/src/fonts/Full Circle/font-full-circle-table-12-15.png b/src/fonts/font-full-circle-table-12-15.png similarity index 100% rename from src/fonts/Full Circle/font-full-circle-table-12-15.png rename to src/fonts/font-full-circle-table-12-15.png diff --git a/src/fonts/Full Circle/font-full-circle.fnt b/src/fonts/font-full-circle.fnt similarity index 100% rename from src/fonts/Full Circle/font-full-circle.fnt rename to src/fonts/font-full-circle.fnt diff --git a/src/main.lua b/src/main.lua index 7aa9bae..1040a06 100644 --- a/src/main.lua +++ b/src/main.lua @@ -4,6 +4,7 @@ import 'CoreLibs/animator.lua' import 'CoreLibs/easing.lua' import 'CoreLibs/graphics.lua' import 'CoreLibs/object.lua' +import 'CoreLibs/timer.lua' import 'CoreLibs/ui.lua' import 'graphics.lua' @@ -28,10 +29,10 @@ local Screen = { local Center = xy(Screen.W / 2, Screen.H / 2) local BatCrackSound = playdate.sound.sampleplayer.new("sounds/bat-crack-reverb.wav") -local GrassBackground = gfx.image.new("images/game/grass.png") --[[@as PlaydateGraphicsImage]] -local PlayerFrown = gfx.image.new("images/game/player-frown.png") --[[@as PlaydateGraphicsImage]] +local GrassBackground = gfx.image.new("images/game/grass.png") --[[@as pd_image]] +local PlayerFrown = gfx.image.new("images/game/player-frown.png") --[[@as pd_image]] -local ScoreFont = gfx.font.new("fonts/Full Circle/font-full-circle.pft") +local ScoreFont = gfx.font.new("fonts/font-full-circle.pft") local PlayerImageBlipper = blipper.new(100, "images/game/player.png", "images/game/player-lowhat.png") @@ -57,8 +58,8 @@ local batTip = xy(0, 0) local TagDistance = 20 local ball = { - x = Center.x, - y = Center.y, + x = Center.x --[[@as number]], + y = Center.y --[[@as number]], size = 6, heldBy = nil --[[@type Runner | nil]], } @@ -237,11 +238,15 @@ local outs = 0 local homeScore = 0 local awayScore = 0 +function updateForcedRunners() end + function outRunner(runnerIndex) outs = math.min(3, outs + 1) outRunners[#outRunners + 1] = runners[runnerIndex] table.remove(runners, runnerIndex) FielderDanceAnimator:reset() + updateForcedRunners() + announcer:say("YOU'RE OUT!") end -- TODO: Away score @@ -249,6 +254,7 @@ function score(runnerIndex) outRunners[#outRunners + 1] = runners[runnerIndex] table.remove(runners, runnerIndex) homeScore = homeScore + 1 + announcer:say("SCORE!") end function updateFielders() @@ -335,7 +341,7 @@ function updateRunners() end -- TODO: Also move if forced to 😅 - local autoRun = nearestBaseDistance > 40 and mult * autoRunSpeed + local autoRun = (nearestBaseDistance > 40 or runner.forcedTo) and mult * autoRunSpeed or nearestBaseDistance < 5 and 0 or (nearestBase == runner.nextBase and autoRunSpeed or -1 * autoRunSpeed) mult = autoRun + (appliedSpeed / 20) @@ -562,11 +568,11 @@ function drawScoreboard() gfx.drawText("HOME ", x - 7, y - 38) local homeScoreText = homeScore > 9 and homeScore or " " .. homeScore - gfx.drawText(homeScoreText, x - 7 + numOffsetX, y - 38) + gfx.drawText("" .. homeScoreText, x - 7 + numOffsetX, y - 38) gfx.drawText("AWAY ", x - 7, y - 22) local awayScoreText = awayScore > 9 and awayScore or " " .. awayScore - gfx.drawText(awayScoreText, x - 7 + numOffsetX, y - 22) + gfx.drawText("" .. awayScoreText, x - 7 + numOffsetX, y - 22) gfx.setImageDrawMode(originalDrawMode) end @@ -574,6 +580,7 @@ end function playdate.update() updateGameState() playdate.graphics.animation.blinker.updateAll() + playdate.timer.updateTimers() gfx.clear() @@ -614,6 +621,7 @@ function playdate.update() end drawScoreboard() + announcer:draw(Center.x, 10) end init() diff --git a/src/utils.lua b/src/utils.lua index 749132e..6476029 100644 --- a/src/utils.lua +++ b/src/utils.lua @@ -132,3 +132,23 @@ function buildCache(fetcher) end, } end + +local AnnouncementFont = playdate.graphics.font.new("fonts/Roobert-20-Medium.pft") + +-- selene: allow(unscoped_variables) +announcer = {} + +function announcer.say(self, text, durationMs) + self.text = text + durationMs = durationMs and durationMs or 3000 + playdate.timer.new(durationMs, function() + self.text = nil + end) +end + +function announcer.draw(self, x, y) + if not self.text then + return + end + AnnouncementFont:drawTextAligned(self.text, x, y, kTextAlignment.center) +end