Play game
Gorillas.1k's itch.io pageCompressed Bytes used
1024
Source Code (OPTIONAL)
-- global vars
players = {{},{}}
curr_plr = 1
g=unpod("b64:bHo0AD4AAAA8AAAA8C1weHUAQyAHEgQAEzATQBMQJBMAFAAEIzQAEwAUIEQAEiQAIiQAIiAEEgA0EgA0AAI0ICQgJDAkMCRAJBA=")
b=unpod("b64:bHo0ABgAAAAWAAAA8AdweHUAQyAFBQQwCTAKIBoQGgQJGgQA")
--srand(19)--seed for screenshot/demo
-- game_init -------------------
function _init()
_f = 0 -- frame counter
-- init city --
city = {}
damage = {}
xpos = 1
chkpxl = 0
while xpos<482 do
w=(4+(rnd(2)))*9
add(city, {
x = xpos,
y = 30+rnd(150),
w = w
})
xpos+=w+1
end
-- init players
for playernum=1,2 do
plr=players[playernum]
if playernum==1 then
bld=city[2]
sa=0.125
else
bld=city[#city-1]
sa=0.375
end
plr.a=sa
plr.x=bld.x+bld.w/2
plr.y=270-bld.y
plr.p=5
plr.d=false
if (t()<1) plr.s=0
end
end
function _draw()
-- update -------------------
srand(0)
_f+=1
-- update positions
plr=players[curr_plr]
-- inputs
-- power
plr.p = mid(plr.p-(btn()\8%2-btn()\4%2)/10, 20)
-- adjust angle
plr.a = mid(plr.a-(btn()\2%2-btn()%2)/400, 0.5)
if btnp(5) and not banana then
-- throw banana --
banana = {
x = plr.x,
y = plr.y-20,
vx = plr.p*cos(plr.a),
vy = plr.p*sin(plr.a)
}
end
-- draw -------------------
if (_f%2==1) return -- update 60fps (better collision), but draw at 30fps
-- draw_city --
cls(1)
lastbuilding_end = 0
for b in all(city) do
-- building
rectfill(b.x,270-b.y,lastbuilding_end+b.w,270,rnd{17,24,6})
-- windows
for wy=270-b.y+2,270,6 do
for wx=b.x+2,b.x+b.w-3,4 do
?"\^x2\^y3\16",wx,wy,rnd{5,10}
end
end
lastbuilding_end = b.x+b.w
end
-- draw damage
for d in all(damage) do
circfill(d.x,d.y,d.m,1)
end
-- draw gorillas --
for playernum=1,2 do
plr=players[playernum]
if not plr.d then
-- col switch based on state/anim
pal(2,4)
pal(3,1)
if banana and playernum==curr_plr and playernum==1 or chkpxl==4 and t()*2\1%2==1 then
pal(2,1)
pal(3,4)
end
spr(g,plr.x-6,plr.y-18)
pal(2,4)
pal(3,1)
if banana and playernum==curr_plr and playernum==2 or chkpxl==4 and t()*2\1%2==0 then
pal(2,1)
pal(3,4)
end
spr(g,plr.x,plr.y-18,true)
end
-- draw_ui --
ui_x = playernum==2 and 425 or 5
?"Player "..playernum,ui_x,5,7
?"\rScore:"..plr.s
if (playernum==curr_plr) then
?"\rAngle:"..flr(plr.a*360)%360
?"\rPower:"..plr.p
end
end
-- draw moon --
?"\^w\^t\140",232,16
if (h) ?"\134",235,24,1 -- hit
if banana then
-- move banana --
banana.vy += 0.25 --gravity
banana.x += banana.vx
banana.y += banana.vy
-- check collision
chkpxl = pget(banana.x,banana.y)
if banana.y < 0 then
-- in sky, wait...
else
-- draw banana --
spr(b,banana.x,banana.y, _f\8%4>0 and _f\8%4<3, _f\8%4>1)
if chkpxl > 1 then
-- hit something
if (chkpxl==7) h=1 return
if chkpxl==4 then
-- hit self?
if (abs(banana.x-players[curr_plr].x)<100) then
-- hit self!
players[curr_plr].d=true -- self dead
players[curr_plr].s-=1
else
-- hit other player
players[3 - curr_plr].d=true -- other dead
players[curr_plr].s+=1
end
else
-- hit building
end
explode()
banana = nil
-- switch turn
curr_plr = 3-curr_plr
elseif chkpxl==0 then
-- out of bounds
banana = nil
-- switch turn
curr_plr = 3-curr_plr
end --if(chkpxl > 1) then
end -- if in sky
else -- banana
h = nil
end
if exp then
if exp.r > -100 then
exp.r -= 1
circfill(exp.x,exp.y,exp.r,8+(_f%3))
else
-- kill explosion
exp = nil
-- end of round?
if (chkpxl==4) _init()
end
end
end
function explode()
exp = {
x = banana.x,
y = banana.y,
m = chkpxl==4 and 25 or 5,
r = chkpxl==4 and 25 or 5
}
-- add damage
add(damage,exp)
end
Link to Commented Source Code (OPTIONAL)
https://gist.github.com/Liquidream/cc946e4d1e0e3285f2a5977da97d73c1
Leave a comment
Log in with itch.io to leave a comment.
Comments
Very cool picotron game. unpod looks super useful.
Do you know how many of the pico-1k jam 2024 entries were picotron?
Thanks a lot.
Yeah, it is and thankfully Picotron does it all for you - just copy the sprite to clipboard and paste in code - voila!
Yes, I believe there were only two Picotron entries - mine and this one.
(I believe 369px was also working on one, but ran out of time)
Hi Paul,
I didn’t know the original Gorillas, but in my younger years I wanted to play “Ballerburg” with friends. It has the same mechanics. It was great fun throwing bananas 😂.
I would also like to thank you for your annual efforts in organizing this game jam. It has become a real tradition for me to take part and I am already looking forward to the new games and of course to building one myself 😊
You're very welcome 👍
It's responses like this that make the effort all worth it! ❤️
Thank you for all the kind words 😊
I never played this one! We were a Scorched Earth family. Really great level of polish here.
Oh cool, glad I could introduce to the another side" of the PC artillery gaming!
I too played a fair amount of S.E. back in the day
(but TBH, ended up playing WAY more Scorched Tanks when I got an Amiga 600 - good times!)
Thanks for playing (+the kind comments) 😀
Nice. Satisfying to home in on the correct speed and angle :)
Picotron! Very cool. Looks so hi-res! 😂 Fun game, great graphics. Love the dance animation. You got a lot into 1k!
For some reason the on screen controls aren’t visible on mobile, but they still work by pressing where they would be on the pico8! Alpha problems I guess.
Thanks for playing (+for the nice words!).
Yeah, not sure what happened there (on-screen controls).
Think it might be something to do with me setting the game's viewport size in Itch, not sure.
Either way, it's now playable on mobile with the BBS version! 🤓
Thx again