Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
A jam submission

WindowManager08 (Pico-8 1K Jam)View game page

Window manager for pico-8 for P8 1K jam
Submitted by Antibrain (@ulysseus04) — 20 days, 23 hours before the deadline
Add to collection

Play Tech demo?

WindowManager08 (Pico-8 1K Jam)'s itch.io page

Compressed Bytes used
997

Source Code (OPTIONAL)
bc=7
function _init()poke(0x5f2d,0x1,0x2)end
function _update60()m()uw()tbr.u()bd()end
function _draw()cls()dw()tbr.d()dm()end
function m()mx=stat(32)my=stat(33)md=stat(34)mc=stat(34)end
function uw()if wd1.v==true then wd1.wd1u()end end
function bd()if wd1.x<0 then wd1.x=0end if wd1.x+wd1.wv>128 then wd1.x=127-wd1.wv end if wd1.y<0 then wd1.y=0end if wd1.y+wd1.hv>120 then wd1.y=119-wd1.hv end end
function dm()if md<2 then circ(mx,my,-mc+1,12)else circ(mx,my,-mc+1,md)end end
function dw()if wd1.v==true then wd1.wd1draw()end end
wd1={
x=16,
y=90,
wv=40,
hv=20,
c=1,
v=true,
name="window",
wd1u=function ()
wd1.w=(wd1.x+wd1.wv)
wd1.h=(wd1.y+wd1.hv)
wd1.bh=(wd1.y+6)
if wd1.wv<20 then
wd1.wv=20
end
if wd1.hv<19 then
wd1.hv=19
end
if mx<wd1.w-2 and mx>wd1.x-2 and my>wd1.y-1 and my<wd1.y+7 then
md=3
if mc==1 then
md=19
wd1.x=mx-(wd1.w/4)
wd1.y=my-3
end
if pget(mx+1,my+1)==8 then
md=7
if mc==1 then
md=23
wd1.v=false
end
end
end
if mx>wd1.x+wd1.wv-4 and mx<wd1.x+wd1.wv+4 and not(my<wd1.y-3) and not(my>wd1.h-2) then
md=4
if mc==1 then
wd1.wv=mx-wd1.x
end
end
if my>wd1.y+wd1.hv-4 and my<wd1.y+wd1.hv+4 and not(mx<wd1.x-3) and not(mx>wd1.w-2) then
md=5
if mc==1 then
wd1.hv=my-wd1.y
end
end
end,
wd1draw=function ()
rect(
wd1.x,
wd1.y,
wd1.w,
wd1.h,
bc
)
rectfill(
wd1.x,
wd1.y,
wd1.w,
wd1.bh,
bc
)
print(
sub(wd1.name,0,flr((bnot(wd1.x-wd1.w))/4)-1),
wd1.x+1,
wd1.y+1,
wd1.c
)
circfill(
wd1.x+wd1.wv-3,
wd1.y+3,
2,
8
)
if not(wd1.h<wd1.y+8) then
print(
sub(
"x"..
wd1.x..
",y"..
wd1.y
,0,flr((bnot(wd1.x-wd1.w))/4)
)
,wd1.x+2,wd1.y+8
)
end
if not(wd1.h<wd1.y+19) then
print(
sub(
"w"..
wd1.wv..
",h"..
wd1.hv
,0,flr((bnot(wd1.x-wd1.w))/4)
)
,wd1.x+2,wd1.y+14
)
end
if not(wd1.h<wd1.y+25) then
print(
sub(
"here is sometext"
,0,flr((bnot(wd1.x-wd1.w))/4)
)
,wd1.x+2,wd1.y+20
)
if not(wd1.h<wd1.y+37) then
print(
sub(
"thank you for checking"
,0,flr((bnot(wd1.x-wd1.w))/4)
)
,wd1.x+2,wd1.y+32
)
end
if not(wd1.h<wd1.y+43) then
print(
sub(
"this windowmanager out!!"
,0,flr((bnot(wd1.x-wd1.w))/4)
)
,wd1.x+2,wd1.y+38
)
end
end
end
}
wd1i={
sx=0,
sy=24,
sw=15,
sh=7,
x=0,
y=120,
w=16,
h=8,
upd=function ()
rectfill(
wd1i.x,
wd1i.y,
wd1i.x+wd1i.sw,
wd1i.y+wd1i.sh,
5
)
print(
"win1",
wd1i.x,
wd1i.y+2,
7
)
if mx>wd1i.x+1 and mx<wd1i.x+14 and not(my<wd1i.y) and not(my>wd1i.y+wd1i.h) then
md=3
if mc==1 then
md=19
wd1.v=true
wd1.x=16
wd1.y=90
wd1.wv=40
wd1.hv=20
end
end
end
}
tbr={
x=0,
y=120,
wv=128,
hv=8,
c=6,
u=function ()
tbr.w=tbr.x+tbr.wv
tbr.h=tbr.y+tbr.hv
end,
d=function ()
rectfill(
tbr.x,
tbr.y,
tbr.w,
tbr.h,
tbr.c
)
if wd1.v==false then
wd1i.upd()
end
end
}

Leave a comment

Log in with itch.io to leave a comment.

Comments

HostSubmitted(+1)

Cool idea for an entry (even saw the extra message!).
P.S. - If you didn't already know, you can use _update60() instead of _update () to make this a bit snappier (just a suggestion tho)

DeveloperSubmitted(+1)

Thanks for the reply! I thought about using updated, but my terrible mouse overlap detection made it harder to interact with windows (at least in my testing) I also completely forgot about update60 even though I put it in all the demos I made and never upload lol 

I'll do some more testing and update it. Thanks for the feedback!

DeveloperSubmitted(+1)

I just updated it! You were right! it made it a lot more responsive and "snappier". Thank you for the suggestion!