Play game
Pico1k Contract Offender's itch.io pageCharacters/Bytes used
1024
Source Code
웃=63⌂=129a=1x=63y=63f=99g=53h=53j=40k=80s=0d=0e={}v=btn
b=1u=1q="\ace#g"i=rnd
❎=nil
function _update60()n=i(126)function c(x,y,a,b,c)return(a-x)^2+(b-y)^2<(2+c)^2end
if(v(0))x-=1
if(v(1))x+=1
if(v(2))y-=1
if(v(3))y+=1
if(c(g,h,x,y,2)and b==1)f+=1b=❎?q
if(t()%2==0and not b)g,h=n,n b=1
if(j<⌂)j+=.4else u=❎
if(c(j,k,x,y,2)and u and f>0)f-=1u=❎ s+=1?q
if(t()%2==0and i(2)>1and not u)j,k=-4,n u=1
if i(2)>(1.98-f*.01)then
add(e,{x=0,y=0,m=i(2)>1and-2or ⌂,g=i(⌂),w=i(⌂),e=i(⌂),t=0,u=function(l)
if(l.t<1)l.t+=0.008l.x,l.y=l.m*(1-l.t)^2+2*l.t*l.w*(1-l.t)+웃*l.t^2,l.g*(1-l.t)^2+2*l.t*l.e*(1-l.t)+웃*l.t^2
if(c(l.x,l.y,x,y,2))del(e,l)?"\ag-e..#"
if c(l.x,l.y,웃,웃,8)then del(e,l)?"\a-2d#2de#"
if(f<1)d+=1else f-=1end
end,d=function(l)?"★",l.x-3,l.y-2,0
end})end
for o in all(e)do o:u()end
if(s>9or d>s)a=2e=❎
end
function _draw()cls(3)?"♥"..f,5,2,7
circfill(웃,웃,8,4)
?"🐱"..s.."\n".."★"..d,58,58,15
if(b)?"♥",g-3,h-2,8
if(u)?"🐱",j-3,k-2,10
for o in all(e)do o:d()end?"웃",x-3,y-2,1
if(a>1)cls(0)?"★",웃-3,웃,웃
if(a>1and s>9)?"🐱"..s-d
end
Pico1k *Contract Offender*
Controls: 4 Arrowkeys to move (p1 left/right/up/down);ctrl+r to retry
Mission: Hq has ordered you hire 10 local caitsith to diversify the outpost while it is still under your control. They didn't really specify much else about the job, and you didn't ask. 10 furry employees, past or present, need to be in that outpost before it falls or you don't get paid. Hq has sent over a big box of 99 fish hearts to help you woo the natives with. Unsurprising, the smell seems to have also wooed the wrong type of native. Thankfully they seem more interested in the fish hearts than your own. You have programmed the outpost to handout the treats like its halloween to anything that makes it inside. Failing that, each cait you recruit will be able to provide buffet service for a guest. Dump these smelly hearts as soon as you can, and make 10 furry friends!
To encourage your moral compass, your final score is the number of cait left alive (🐱1->🐱10). The contract must be completed in order to receive a score (▼へ▼メ).
Some tips:┌(▀Ĺ̯ ▀-͠ )┐
1. Food>0 is required to recruit cait (yellow kitties).
2. The more food you hoard the more enemies will attack.
3. Food is automatically traded to defeat attackers hitting the base.
4. Don't automatically go for any spawning food/cait. Wait until the base is clear.
5. Game ends if base overrun (has more enemies than cait on it).
6. Victory achieved if you recruit 10 cait to the base. Final score is cait-enemies_on_base. A max score of 10 can be achieved.
The score to beat is 7. Post your best score in the comments. If you see any other ways to save characters that I missed let me know, i.e. circfill line can be combined with another.
Leave a comment
Log in with itch.io to leave a comment.
Comments
I can see a couple spots where some characters could be saved, though maybe not enough to add back in anything.
You've got 4 lines for movement, each costing 13 character, plus the base cost of using substitution on the function, for 57 total. Compare that to using btn with bitmasking: "v=btn()x+=(v&2)/2-(v&1)y+=(v&8)/8-(v&4)/4" is only 41 characters. This assumes you aren't preventing the player from going offscreen of course, but I don't think your game needs that.
Your conditions seem inefficient as well in a couple places. I'm not confident, but I think "t()%2" can only have 0 or 1 as a result, so rather than "==0" you could use "<1". Also there's a "b==1" and I'm not sure where b could be given a value that isn't either 1 or nil. If those are the only values, "==1" is redundant.
Other than that, I think there's a few places you could save a character or two by re-ordering the statements that don't depend on each other. "g,h=n,n b=1" could eliminate the space by putting "b=1" in front. Similarly, "j,k=-4,n u=1" could be "u=1j=-4k=n" to save 2 characters.