This is hilarious. My high score is one point. Rawr.
JimOfLeisure
Creator of
Recent community posts
Very neat game! Some polishing tips:
- The start button clickable area is too small and to the left
- After 10 minutes things go a little more crazy
- The timer wraps to a second line
- The whole screen may shake and the player may be off-center-screen
- After 15 minutes there are just huge clumps of enemies stuck out in the open. Sometimes they break loose, but a lot of them are just stuck for a while.
Thanks! This is getting more visits than anything else I’ve done, and I didn’t submit it in a jam or tell anyone I uploaded it, so I did something right here.
I want to update it so that it supports dialog choices and takes tag or markup cues from Ink to change the scene around. And maybe add some lighting to the sky and ball and some texture to the grass.
Hi, I just used Chan and Kun2 in my first visual novel, just a silly little project to mess with the VN software. https://jimofleisure.itch.io/a-bumpy-visual-novel with source code including the resized asset pngs at https://github.com/JimOfLeisure/ink-love2d-vn-test .
Thanks!
I have also stubbed my toe on the SharedArrayBuffer problem and would like a way to enable the needed headers.
However, I also have some workaround ideas for those who are encountering this issue. They may or may not work for you and may or may not cause issues especially with audio.
SharedArrayBuffer seems to be used to share data between threads in multithreaded applications, so either designing an app with no multithreading and/or disabling pthreads in the WASM exporter may avoid the error.
Things to consider trying:
- If using Emscripten or any language to web exporter, see if there is an option to disable pthreads, multithreading, or similar
- Similar to above, see if there is a “compatibility” setting for export (this worked for me in a Love2D export to web via Love.js)
- I saw one suggestion to explicitly assign SharedArrayBuffer to ArrayBuffer as such in the index.html in a script element:
SharedArrayBuffer = ArrayBuffer;
. I guess this is worth a try, but it sure looks like it would break a lot of stuff to me. - Advanced untried idea: For audio, consider signaling the browser and play audio in JavaScript instead of from WASM. This would require some non-trivial extra programming in both the JavaScript and in the WASM artifact
I got curious again and tried harder. There do not seem to be any symbols outside of ASCII values 32 through 126. There is a second set of the same but skinnier starting at 160 (32+128).
My local Lua 5.3 seems to have a utf8
module, but the Lua inside TIC-80 doesn’t.
Here’s the code to look at all the available characters in TIC-80:
cls()
first = 32
perrow = 32
for i=first,255 do
print(string.char(i), (i-first)%perrow * 7.5, (i-first)//perrow * 10)
end
-- This gives an error in TIC-80 but works in a local Lua 5.3.5 install
-- print(utf8.codepoint("웃"))
function TIC()
end
I’m new to TIC-80 (and jams and Itch…), but it looks to me like the TIC-80 font doesn’t even include symbols that aren’t on a standard US keyboard.
I used a *
and a circle to get a spiky coronavirus-looking enemy. And then a circle and line for the player’s “cell” and turret.
I toyed with trying to either poke in sprites from code or memcopy from the screen to a sprite after drawing from code. It’s doable but takes up probably too many characters for this challenge. On the other hand, it is a challenge….
But yeah it looks like Pico-8 has several advantages for a “tiny code” challenge over TIC-80. Pay to win! Pay to win! (Just kidding!)
font ref:
https://itch.io/t/80843/font-availability#post-163418
https://fontstruct.com/fontstructions/show/1388526/tic-80-wide-font
Heh, I could save 20-40 characters by altering the TIC-80 source to alter function declarations and names…hmmm…nah.
I have noticed that Pico-8 has a head start over TIC-80 for this challenge if only for the one-letter functions built in.
But one submitter managed <=560 chars in vanilla JavaScript, so I can’t complain much.
Thanks!
Yeah, I meant for the enemies to increase over time and/or direct them better, but I ran out of space. So the one enemy just gets faster each time you kill it.
I’m learning more about lua, though, and I may yet be able to improve this while staying within 560 characters. It’s a fun set of constraints!
I suppose pointing the enemy at the player might do, too, and I should be able to make that fit now….
For “zone collision” I did something like this in Virus Defender:
collision_distance=10
if math.abs(asteroid_x - player_x) < collision_distance and math.abs(asteroid_y - player_y) < collision_distance then
-- game over, man! game over!
end
Basically take the absolute value of the difference between the x’s and y’s of each center. The downside is that this is a square collision area which often doesn’t fit the need.
You could always do some trigonometry to get the direct distance. Something like if math.sqrt((ex-px)^2 + (ey-py)^2) < collision_distance
. Actually that doesn’t look as hard as I thought, but I’m doing trig from memory so I might have done it wrong.
Edit: yeah, I think I got it right, and it wasn’t as complex as I thought. I just tested against a 3-4-5 right triangle in an interactive lua session:
> print(math.sqrt(3^2+4^2)) 5.0
Formatted source. Note there are 3 ‘extra’ newlines, so this could have been 555 characters:
a=math b=240 c=138 d=120 e=69 f=0 g=0 h=0 i=.5 j=.2 k=.5
function l()m=d n=e o=0 p=0 q=0 r=0 end
l()
function TIC()t=a.sin(a.rad(f))u=-a.cos(a.rad(f))m=m+o n=n+p q=q+i r=r+j
if btnp(4)then m=d+t*9 n=e+u*9 o=t*2 p=u*2 end
if btn(2)then f=f-4 end
if btn(3)then f=f+4 end
cls()circ(d,e,7,8)print("*",(q-6)%b,(r-4)%c,6,true,2)circ(q%b,r%c,2,6)
if pix(m%b,n%c)==6 then g=g+1 k=k*1.2 i=k*t j=k*u l()end
print("SCORE "..g.." HI "..h,9,0)pix(m%b,n%c,15)line(d,e,d+t*9,e+u*9,15)
if a.abs(q%b-d)<9 and a.abs(r%c-e)<9 then h=g>h and g or h g=0 k=.5 i=.5 j=.2 l()end
end
And this is what it looks like with friendlier variables, spacing, and comments:
-- for extra manual minifying
m=math
screenwidth=240
screenheight=138
middlex=120
middley=69
-- starting turrent angle
angle=0
score=0
highscore=0
edx=.5
edy=.2
espeed=.5
function resetmovers()
-- init bullet x, y, dx, and dy (velocity)
bx=middlex
by=middley
dx=0
dy=0
-- init enemy
ex=0
ey=0
end
resetmovers()
function TIC()
x=m.sin(m.rad(angle))
-- negating Y because screen coords
-- and I want starting position up
-- and 0 is shorter than 180
-- only saving 1 char, though
y=-m.cos(m.rad(angle))
bx=bx+dx
by=by+dy
ex=ex+edx
ey=ey+edy
if btnp(4) then
-- pew pew
bx=middlex+x*9
by=middley+y*9
dx=x*2
dy=y*2
end
if btn(2) then
angle=angle-4
end
if btn(3) then
angle=angle+4
end
cls()
-- cell
circ(middlex,middley,7,8)
-- enemy
print("*", (ex-6)%screenwidth, (ey-4)%screenheight, 6, true, 2)
circ(ex%screenwidth,ey%screenheight,2,6)
-- bullet hit detect
if pix(bx%screenwidth,by%screenheight) == 6 then
score = score + 1
-- -- reset enemy
espeed=espeed*1.2
edx=espeed*x
edy=espeed*y
resetmovers()
end
-- score
print("SCORE "..score.." HI "..highscore,9,0)
-- bullet
pix(bx%screenwidth,by%screenheight,15)
-- turret
line(middlex,middley,middlex+x*9,middley+y*9,15)
if m.abs(ex%screenwidth-middlex)<9 and m.abs(ey%screenheight-middley)<9 then
-- game over! man. game over!
highscore = score > highscore and score or highscore
score=0
espeed=.5
edx=.5
edy=.2
resetmovers()
end
end
Edit: I could probably save some more characters by using radians instead of degrees. I meant to do that, but that was very early in the dev process and I forgot about it.
Here is a poked 1-pixel sprite for TIC-80. I think it’s pointless, but poking in a more complex sprite might be doable.
I just wanted to try it out and provide a working example.
-- Fill a sprite with zeroes
for i = 0,31 do
poke(0x4000+i, 0)
end
-- Poke a palette 9 pixel in the sprite
poke4(0x8000, 9)
x=50
y=50
function TIC()
y=y+1
x=x+1
cls()
-- Sprite with 0 as transparent
spr(0,x%240,y%136,0)
print("Poked sprite")
end
The jam doesn’t allow sprites,
Oh? I thought it was external sprites. If you poke a sprite in from the 560 chars of code is it still not allowed?
I don’t even know yet if that’s plausible to do in 560 chars, but I was going to try it at least once. I was going to try OP’s 1-pixel sprite example then realized there’s no advantage to doing so for a single pixel in Tic-80.
You’re welcome!
But I don’t see an advantage to using a sprite for one pixel. I’m thinking you have x & y variables, so if you’re drawing the screen every TIC()
I think you’d clear the screen and redraw everything. So draw whatever the pixel might collide with first, then use pix to read the color of where the pixel will be, and if it’s the color of the colliding object then you have a collision. Otherwise, use pix again to write the pixel orange or whatever.
I haven’t programmed a line of Tic-80 code yet, though…I’m just getting this from reading Itch and the Tic-80 wiki.
Which platform? Pico-8? Tic-80? Something else?
I was searching for a similar thing for Tic-80 and found these, but I haven’t tried it yet:
https://github.com/nesbox/TIC-80/wiki/code-examples-and-snippets#setget-spritesheet-pixel
https://github.com/nesbox/TIC-80/wiki/spr (first code example starting with -- spr demo
Hi, I'm brand new to Itch, more of a web devops prod support programmer than a game programmer, and I hadn't heard of "fantasy consoles" before today. So I have no idea what I might come up with or if I can even finish one Tic-80 game.
But I still have to ask: can we submit more than one game? (Even if they're bad?)
Thanks for hosting this and introducing me to some new stuff I hadn't heard of before. (fantasy consoles, pico-8, tic-80, etc.)
Edit: 560 characters is insane. Insane enough I had to try it.