Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

TIC-80

Fantasy computer for making, playing and sharing tiny games. · By Nesbox

From PICO-8 to TIC-80 ) Another port of nice mini-demo )

A topic by alrado created Mar 24, 2017 Views: 738 Replies: 1
Viewing posts 1 to 2

Thanks zep@lexaloffle for great examples!

Pico-8 Lua code by zep@lexaloffle:

r=64
t=0
::a::
cls()
for y=-r,r,3 do 
  for x=-r,r,2 do
    z=cos(sqrt(x*x+y*y*2)/40-t)*6
    pset(r+x,r+y-z,6)
  end
end 
flip()
t+=2/r 
goto a

TIC-80 Lua code by me:

-- title:  `ripples` demo by zep@lexaloffle 
-- author: Al Rado 24.03.2017
-- desc:   ported from Pico-8 =)
-- script: lua
-- pal:    PICO8

r=120
t=0

function TIC()
  cls()
  for y=-r,r,3 do 
    for x=-r,r,2 do
      z=cos(math.sqrt(x*x+y*y*2)/40-t)*6
      pix(r+x,r+y-z-52,10)
    end
  end 
    t=t+2/r 
end

-- PICO-8 cos
function cos(a)
  return math.cos(2*math.pi*a)
end

zep@lexaloffle is the creator of pico-8! I am not sure porting his code is the best idea. Example ports are awesome and helpful, so thanks! Stick with a different author next time though, unless he said he is OK with it.