Log In  

I'm going to post my entries for TweetTweetJam 4 in this thread.

Let's start with something easy:

1. Avoid the worms

Cart #avoid_the_worms-0 | 2020-05-05 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

A game in 560 characters of code​ for TweetTweetJam 4
Avoid the hungry worms and collect as many hearts as you can. Your score is the number of hearts you get.

_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 _
P#75857 2020-05-05 17:05 ( Edited 2020-05-05 21:06)

2. You shall not pass through the tunnel

A game in 560 characters of code​ for TweetTweetJam 4
How far will you go through the tunnel before crashing?

Cart #through_the_tunnel-0 | 2020-05-05 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

_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 _
P#75884 2020-05-05 21:04

Oh, I didn't know another one of these was starting. I've been working on a version of Tetris made to fit in two tweets, but I'm at about 600 chars right now with no score display. I'll try and cram things tighter!

Your games look pretty slick, btw ;)

P#75907 2020-05-05 23:30 ( Edited 2020-05-06 00:07)

3. Invert gravity

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

Cart #invert_gravity-0 | 2020-05-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

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 _
P#75985 2020-05-06 19:24
1

4. Don't fall into the water

Jump from a floating log to another, avoid falling into the water and collect stars. It's easy ;)

Cart #floating_log_jump-0 | 2020-05-08 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

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 _
P#76189 2020-05-08 18:42 ( Edited 2020-05-08 18:42)

5. The lightsaber guy

Test your lightsaber skills with this fast paced action game!

Cart #the_lightsaber_guy-0 | 2020-05-09 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

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 _
P#76229 2020-05-09 12:10
1

6. Bouncing Balls

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

Cart #bouncing_balls-0 | 2020-05-09 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

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 _
P#76245 2020-05-09 17:00

7. Math Quiz

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

Cart #math_quiz-0 | 2020-05-10 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

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 _
P#76302 2020-05-10 10:17
1

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.

Cart #reach_top_left-0 | 2020-05-10 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

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 _
P#76312 2020-05-10 13:32
1

9. ​Driving Simulator 560

Keep your car on track and try to get as far as possible before time is over.​ When time is over, the car stops. Use left/right to steer, one button for brake and the other one to restart.

I had a lot of features in my mind for this game. But the 560 characters of code limit nearly kills them all.

Cart #driving_simulator_560-0 | 2020-05-10 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

Source code:

_set_fps(60)n,x,y,a,b,r,m,l,g,h,p=64,0,0,0,0,20,15,20,btn,mid,{}for i=1,2000 do
p[i]={x=x,y=y}c,d=cos(a),sin(a)
x+=m*c
y+=m*d
a+=b
if(l<i)l+=20 b=(rnd(2)-1)*.01
end
x,y,z,a,w,b,t=-n,-n,0,0,0,.005,3000::_::cls(3)t-=1
if(g(0))a+=b
if(g(1))a-=b
if(g(4) or t<0)w-=.04
if(g(5))run()
w=h(w+.02,4)c,d=cos(a),sin(a)
x+=w*c
y+=w*d
z+=w
for i=1,#p do
q=p[i]e,f=q.x-x,q.y-y
if h(-r,e,128+r)==e and h(-r,f,128+r)==f then
circfill(e,f,r,2)
if(i>2 and i%4<1)o=p[i-2]line(o.x-x,o.y-y,e,f,7)
end
end
if(pget(n,n)==3)w=.1*w+.1
line(n,n,n+5*c,n+5*d,10)
?t.." "..z
flip()goto _
P#76330 2020-05-10 18:53

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2021-06-12 17:44:49 | 0.024s | Q:48