Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Thanks! This was helpful. Now I’m currently on my v4 and used your great tips for shrinking setting the enemy positions and having them move 4-ways only. I also used your tip to set the temp vars in init too.

I updated the code above.

I’m still having some issues with the GOTO jumps after reading a bit but getting stuck on the limitations with nested functions. I only want the enemies to move only one step rather than continuously and wasn’t able to get this to work correctly.

mhm! goto has some rules about jumping into other scopes (like functions). but if you remove all the functions then it works. here’s a minimally edited version: (a lot of spaces can be removed)

r,x,y,f=rnd,3,3,1

::i::
e={}a=r(8)\1b=r(8)\1
for i=1,5do repeat g=r(8)\1v=r(8)\1until g-x|v-y!=0e[i]={x=g,y=v}end

::m::
d=16for y=0,114,d do for x=0,114,d do
fillp(r(♥))rectfill(x,y,x+d,y+d,2)end end
?"▒",a*d+4,b*d+5,9
?"🐱",x*d+4,y*d+5
?f,2,2,6
for j in all(e)do
z=r(4)\1/4
j.x+=cos(z)j.y+=sin(z)?"😐",j.x*d+4,j.y*d+5,8
if(j.x==x and j.y==y)stop()
if(x==a and y==b)f+=1goto i
end

repeat
  flip()
  v=btnp()
until v>0
x+=v\2%2-v%2
y+=v\8%2-v\4%2
goto m

I noticed that the spawn check isn’t working – the enemies won’t spawn on the player, but the enemies get to move once after spawning!

(+1)

Thanks, this helped me get down to 439 chars but I ran out of bandwidth trying to chase down a solution with all of the gotos to render spawning at the right time. might come back another time to fix that part. thanks again.