[DEVLOG][WIP] SkyBerron games for TweetTweetJam 4

Day 1 (the day TweetTweetJam 4 started):

I joined the jam. I will be using Lua & Pico 8 as it’s my favourite tool for games and it’s perfect for this kind of jams. I have got lots of ideas, but I’m afraid many of them are too ambitious to bring down to just 560 characters of code. I have decided to go Quantity over Quality (as I always do :sweat_smile:) and not spending time polishing my entries: once it “works” and it’s under 560 characters of code it’s done and I should start thinking in the next one.
At the end of the jam I’m porting every game to “C/C++” using SBDL for graphics. My goal is getting all those minigames running on Cortex M0+ in a single binary with a main menu to choose which minigame you want to play. Let’s see if I can get something done :thinking:

Day 2

I’ve got my first entry!!!
I have started with an easy one: the classic “avoid the enemy while picking up some random placed items”. The game works and it’s under 560 characters of code: done! :smiley:

Avoid the hungry worms and collect as many hearts as you can. Your score is the number of hearts you get.

Source code:

_set_fps(60)h=0
::s::s,l,p,t=0,0,{{1,1.9}},0
x,y,c,d=64,32,32,32
::_::cls()t+=.003
if(l<flr(t))p[l+2]={.2+rnd(1.2),.2+rnd(1.5)}l+=1
for j=1,#p do
color(2+j%10)q=p[j]
for i=0,.1,.01 do
k=t+i
a,b=q[1]*k,q[2]*k
r=62*sin(a)
u,v=64+r*cos(b),64+r*sin(b)
circfill(u,v,2)
end
end
if(btn(0))x-=1
if(btn(1))x+=1
if(btn(2))y-=1
if(btn(3))y+=1
x,y=mid(6,x,122),mid(6,y,122)
if(pget(x,y)!=0)h=max(h,s)cls(8)flip()flip()goto s
?"★",x-4,y-3,12
?"♥",c-4,d-3,8
if(mid(c-6,x,c+6)==x and mid(d-3,y,d+3)==y)c,d,s=6+rnd(116),6+rnd(116),s+1
?"s: "..s.." h: "..h,0,0,13
flip()goto _

ttavoidlis001_0

I have set up a thread in the Pico 8 BBS so you can play online:
https://www.lexaloffle.com/bbs/?tid=37758

It’s not AAA, but it’s a good start. :wink:

5 Likes

No pressure @SkyBerron, but we kind of do expect you to win this thing

1 Like

If making games is winning, definitely I’m winning!!!:sunglasses:
Charlie_c7a073_1860563

1 Like

I made another game! :sweat_smile:
This one was very stubborn and refused to shrink to 560 characters of code, so I had to use some tricks that impact a bit on readability… but hey, it works! :smile:

2. You shall not pass through the tunnel

How far will you go through the tunnel before crashing?

Source code:

_set_fps(60)h=0::s::p,t,m,n,l,x,y,w={},-3,64,128,60,0,0,btn
for i=1,n do
p[i]=1+rnd()+i/n
end::_::cls()t+=.01
if(w(0))x+=2
if(w(1))x-=2
if(w(2))y+=2
if(w(3))y-=2
x,y,s=mid(-l,x,l),mid(-l,y,l),flr(t)for i=0,3 do
line(m,m,x+(i%2)*n,y+flr(i/2)*n,12)end
for i=1,#p do
z=#p-i-t
if mid(z,5)==z then
k=1/(.5+z)a,b,c=m-(m-x)*k,m-(m-y)*k,n*k
d,f=c,40*k
rect(a,b,a+c,b+d,4)g,e=z<.1 and 2 or 1,(p[i]*t)%2
if(e>1)e=2-e
if i%2>0 then
a+=(c-f)*e
c=f
else
b+=(d-f)*e
d=f
end
rectfill(a,b,a+c,b+d,g)end
end
if(pget(m,m)==2)h=max(s,h)goto s
?"s: "..s.." h: "..h,6
flip()goto _

ttdstunnel004.p8_0

Play the game online here: https://www.lexaloffle.com/bbs/?tid=37758

4 Likes

Day 3

Another finished game in 560 characters of code! :smile:

3. Invert gravity

A simple endless runner. You have to invert gravity to skip the deadly spikes. Speed gets faster and faster.

Source code:

_set_fps(60)h=0::s::p,x,y,z,b,t,e,f,g,l,m={},16,64,0,0,1,1,.02,.1,0,128
for i=1,900 do
p[i]=flr(rnd(3))end
::_::cls(1)t+=f
if(btn(4) and e>0)b,y,z,e=130-b,138-y,0,0
poke(24364,b)for i=0,m do
u=t+i/64
r=(m*u)%x
if(r>8)r=x-r
q=p[flr(u)]
if(b>0 and q>0)q=3-q
v=8*(sin(u)+sin(u/2))
c,w=3,104-v
if(q%2>0)w,c=w+r,12
rect(i,w,i,m,c)
if i==x then
if y<w then
z+=g
y+=z
else
y,z,e=w,0,1
if(c==12)h=max(h,s)goto s
end
end
c,w=3,24+v
if(band(q,2)>0)w,c=w-r,12
rect(i,0,i,w,c)
end
?"웃",x,y-5,10
s=flr(t)
if(s>l)f,g,l=f+.001,g+.025,l+1
?"s: "..s.." h: "..h,0,0
flip()goto _

Notice the use of poke() to flip screen vertically. Also, it gives the code a distinct old-school look… so beautiful :wink:
Added to Pico 8 BBS thread (link in previous posts), so you can play online.
ttigrav005_1

2 Likes

This might be a dumb question but here goes … is the 560 characters an arbitrary limit you set yourself or is it a LUA / PICO8 thing?

its twitters character limit film

Right … so … I knew it was a dumb question. Tweet length. I probably should have looked a the Jam on Itch.io to see the detail.

1 Like

The idea is that ppl post their TweetTweetJam game code in Twitter, as I’m doing: https://mobile.twitter.com/skyberron

In 2018, Twitter increased max length allowed for a tweet from 140 to 280 characters. It still was not enough for a proper “game”. But if you chain 2 tweets, it gives you 2x280=560 characters, that should be enough for pretty simple minigames. I suggest you give it a try. It’s crazy.

What is “웃” character doing in the code? Which character set it belongs to?

Pico 8 has special character set, that can be used both for text printing and also directly in code that copies surprisingly well to most destinations:

https://www.lexaloffle.com/bbs/?pid=39534

39533.p8

glyphd

Day 4

I spent a long time trying to shrink a simple artillery game into 560 characters of code but failed miserably. I think I can refactor the code to shrink it further, but I’m running out of time and I’ve got other game ideas to try in the few remaining days.

Day 5

A new game is finished! :smile:

4. Don’t fall into the water

Jump from a floating log to another, avoid falling into the water and collect stars.

Source code:

_set_fps(60)::s::m,n,p,q,t=128,16,{},{},0
x,y,z,a,r,s,g,w=64,64,0,30,.01,0,btn,rnd
c,d=x,y
for i=1,m do
q[i],a={10+w(a),w(m)},40-a
p[i]=n+w(n)end
::_::cls(1)t+=r
if(g(0))x-=1
if(g(1))x+=1
if(g(2))y-=1
if(g(3))y+=1
if(z<=0 and g(4))z=.5
for i=1,9 do
o=q[i]
a,u=m+t*o[1]+o[2],14*i-8
for j=1,m do
b=p[j]
v=a-b
if(j%2<1 and a>=0 and v<m)rectfill(u,v,u+8,a,4)
a-=b
end
end
f=2-6*sin(z)
z=max(z-r)
if(z==0 and pget(x,y)<2)goto s
circfill(x,y,f,10)pset(x,y,9)
?"★"..s,c-3,d-2,12
if(mid(c-4,x,c+4)==x and mid(d-4,y,d+4)==y)c,d,s=w(m-4),w(m-4),s+1
flip()goto _

Added to Pico 8 BBS thread, so you can play it online.
ttlogjump006_0

3 Likes

Day 6

Time is running out!
A new game is finished:

5. The lightsaber guy

Test your lightsaber skills with this fast paced action game!

Source code:

_set_fps(60)s,c,m,n,x,y,z,r,f,k,b,p=0,"\n",128,64,0,0,0,0,7,0,btn,{}u=n
for i=1,m do
l,v=flr(1+rnd(3)),3*(i%2)-1.5
c="_"..c.."\\"
for j=1,l do
k+=1
u+=4p[k]={x=u*v,y=0,v=v}end
u+=4+rnd(8/i)end::_::cls()r=max(r-.6)
if(y>n)run()
if(b(0))x,f=x-1,-3
if(b(1))x,f=x+1,7
if(z>0)y,z=y+z,z+.2
if(r==0 and b(4))r=4
?"웃",n,n+y,12
if(r>1)print("-",n+f,n+y,10)
?c,-x%4,65,9
for i=1,#p do
o=p[i]
u,v=o.x-x,o.y
?"웃",n+u,n+v,8
if(v==0)o.x-=o.v
if(v>0)o.y+=2
if(r>1 and y==v and mid(f-7,u,f+5)==u)o.y,s=v+1,s+1
if(y==v and mid(-4,u,4)==u)z+=.2
end
?s,4,4,6
flip()goto _

I had a lot of fun trying to get this game under 560 characters of code. Finally, the highscore had to be removed, and most of the features I had planned.

Added to Pico 8 BBS thread, so you can play it online.
ttlightsaber004_0

3 Likes

Nice! How about making a minigame collection for Pokitto of all of these. Like wario ware. The speed is increasing in each round.

These are my current plans, as I stated in the first post. I’m making more games atm. I need to focus.

1 Like

6. Bouncing Balls

Move your robot left/right and avoid the deadly bouncing balls!

Source code

_set_fps(60)h=0::s::s,m,n=-1,128,64
k,x,y,r,g,t,l,p=.05,64,120,5,0,0,0,{}
::_::cls(1)t+=.02
if t>l then
u,v,w=rnd(m),.5,flr(32+rnd(16))
if(rnd()<.5)v=-v
o={x=m+n+u,y=k*w*w,e=u,w=w,v=v,r=8,c=#p%8+2}l+=9
s+=1
add(p,o)end
u=x
if(btn(0))x-=1
if(btn(1))x+=1
x=mid(r,x,m-r-1)g=u-x
for i=1,#p do
o=p[i]o.x=(o.x+o.v)%(2*m)
v=(o.x+o.w-o.e)%(2*o.w)-o.w
u=o.x-n
v=y-o.y-o.r+k*v*v
circfill(u,v,o.r,o.c)w=o.r+r
u-=x
v-=y-r
if(u<w and u*u+v*v<w*w)h=max(s,h)cls(8)flip()goto s
end
line(0,y,m,y,3)circfill(x,y-r,r,10)circfill(x+g,y-14,3,9)
?"s:"..s.." h:"..h,4,4
flip()goto _

This is a special game, as it’s a demake of the first game I ever made many years ago on Play My Code website, which unfortunately closed and disappeared. IIrc, @spinal had got some impressive games there. I hope he keeps somewhere the assets and source code and is able to remake them again.

Added to Pico 8 BBS thread, so you can play it online.
ttbouncing001_1

1 Like

I ment it like in wario ware. All the games are played in sequence and the points are added. Each round is faster than the previous.

1 Like

I see, I never played that game. But I’m afraid I’m not interested in Wario Ware style games.

Day 7 (last day I can submit games to the jam)

This one could be my last game for the jam:

7. Math Quiz

Test your brain multiplication speed and increase many cents your current IQ with this state-of-the-art math quiz game.

Source code:

h=0::s::r,s,t,c,l,f,g,v,w=44,0,128,0,9,flr,rnd,{-1,1,-2,2,-10,10},{2,4,1,8}::_::cls(1)t-=.1
if c==0 then
a,b,p=f(2+g(l)),f(2+g(l)),{}c,z=a*b,"⬅️ "..a.." x "..b.." = ➡️"
for i=1,#v do
d=c+v[i]
if(d>0)add(p,d)end
for i=1,#p do
j=f(1+g(#p))p[i],p[j]=p[j],p[i]end
p[f(1+g(4))]=c
end
?z,64-2*#z,61,12
?"⬆️\n\n\n⬇️",60,52
for i=1,4 do
a,d=(i-1)/4,p[i]
?d,64+r*cos(a)-2*#(d..""),61+r*sin(a)
if w[i]==btnp() then
if(c!=d)cls(8)s,c=s-1,0
if(c==d)l,s,c=l+.5,s+1,0
end
end
rectfill(0,0,t,7,8)rect(0,0,127,7,6)
?"s:"..s.." h:"..h,8,120
if(t<0)h=max(s,h)goto s
flip()goto _

Added to Pico 8 BBS thread, so you can play it online.
ttmath003.p8_1

1 Like

8. Reach Top Left Corner

Climb stairs, jump over everything that moves, reach the top left of the building… and be sent back to the starting point with foes moving faster.

Source code:

_set_fps(60)h,g,m,n,t,l=120,128,112,22,0,0
o,f,r=m+n,-1,.01::_::cls(1)t+=r
?r
if(f<0)x,y,f,z,p=56,h,h,0,{}r+=.002
if(btn(0))x-=1
if(btn(1))x+=1
x=mid(x,m)f-=n*(flr((h-f)/n)%2<1 and flr(x/m) or flr((m-x)/m))
if(btnp(4) and y==f)z=-2
y+=z
z+=.15
if(y>f)y,z=f,0
for i=0,g,2 do
a,b,v=i%n,i\n,i+16
if(a==0)line(0,v,g,v,12)
u=b%2<1 and m or 0line(u,v,u+16,v,13)end
if(t>l)add(p,t)l+=1
for i=1,#p do
k=100*(t-p[i])a,b=k%o,k\o
u,v=min(a,m),10+b*n+max(a-m)
if(b%2>0)u=m-u
?"🐱",u+5,v,8
if(mid(x-4,u,x+4)==u and mid(y-2,v,y+4)==v)run()
end
?"웃",x+5,y,10
flip()goto _

Added to Pico 8 BBS thread, so you can play it online.
ttstairjump005_0

3 Likes