Log In  

Cart #pixagon-0 | 2019-05-16 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

Info


A small demake of Super Hexagon created for TweetTweetJam 2.
Made in 555 characters from a limit of 560.
Refresh to restart.

Code


a=0t=0s=0.5r=0.005l=1
c=63h={}add(h,{r=99,a=rnd(1)})add(h,{r=99*1.5,a=rnd(1)})
z=sin
v=cos
::_::cls()x=c+15*v(a)y=c+15*z(a)circ(c, c, 5, 7)circ(x, y, 1, 8)
if(not btn(0) or not btn(1))a+=r
if(btn(0))a+=0.03
if(btn(1))a-=0.03
for i=1,#h do 
o=h[i]
q=o.r
n=o.a
k=c+q*v(n)u=c+q*z(n)
for d=1,5 do
p=c+q*v(n+d/6)j=c+q*z(n+d/6)line(k,u,p,j,7)k=p u=j 
end
o.a+=r o.r-=s
if(q<=6)o.r=99o.a=rnd(1)
end 
if(pget(x,y)==7 or pget(x+v(a),y+z(a))==7 or pget(x-v(a),y-z(a))==7)l=_
t+=1/30s+=0.0005r+=0.00001*(abs(r)/r)if(rnd(1)<=0.01)r=-r
?flr(t),1,1,8
flip()
if(l)goto _

Social


Twitter - bytestats
Itch - Super Pixagon

P#64471 2019-05-16 21:50 ( Edited 2019-05-17 00:42)

1

Hey, nice job! I made a Super Hexagon tweetcart myself recently, but having just 280 characters I couldn't really do the game as much justice as you.

I noticed a couple of things in your code that could be optimized further, just in case you had to ax a really awesome feature in order to ship this:

  • PICO-8 already has a built-in function that returns the number of seconds elapsed since the game started, time(), which even has a one-letter shorthand with the same name as the variable you used for that purpose: t()
  • You don't need a 0 before the decimal in number literals
  • You don't need spaces between arguments passed to functions
  • You use pget and btn enough times that you save characters by assigning one-letter variables to them, like you did for cos and sin

If you reorder some more assignments and stuff I think it'd be doable to cram your game into 510 characters or so!

P#64520 2019-05-17 19:51

Thanks Tobi, being new to PICO-8 and tweetcarts that's some very useful info.

Your tweetcart version is incredibly impressive also, can't believe it's only in 280 chars!

P#64523 2019-05-17 22:59 ( Edited 2019-05-17 23:01)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 19:26:31 | 0.010s | Q:19