Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+2)

I made a TIC-80 port of Squashy for you

-- title:  Squashy port
-- author: Nesbox
-- desc:   port of Squashy game from picozine
-- script: lua
-- input:  gamepad -- paddle
padx=108
pady=122
padw=24
padh=4 -- ball
ballx=120
bally=68
ballsize=3
ballxdir=2
ballydir=-2 score=0
lives=3

function movepaddle()
 if btn(2) then
padx=padx-3
 elseif btn(3) then
  padx=padx+3
 end
end function moveball()
 ballx=ballx+ballxdir
 bally=bally+ballydir
end function bounceball()
 -- left
 if ballx < ballsize then
  ballxdir=-ballxdir
sfx(0)
 end  -- right
 if ballx > 240-ballsize then
ballxdir=-ballxdir
  sfx(0)
 end  -- top
 if bally < ballsize then
ballydir=-ballydir
  sfx(0)
 end
end -- bounce the ball off the paddle
function bouncepaddle()
 if ballx>=padx and
ballx<=padx+padw and
  bally>pady then
sfx(0)
  score=score+10 -- increase the score on a hit!
ballydir=-ballydir
 end
end function losedeadball()
 if bally>136-ballsize then
  if lives>0 then
  -- next life
sfx(3)
  bally=24
  lives=lives-1
else
  -- game over
ballydir=0
ballxdir=0
  bally=68
end
 end
end

function update()
 movepaddle()
bounceball()
bouncepaddle()
moveball()
losedeadball()
end function TIC()
update()

 -- clear the screen
 cls(3)

-- draw the lives
 for i=1,lives do
  spr(4,200+i*8,4,0)
 end

-- draw the score
print(score, 12, 6, 15)

 -- draw the paddle
 rect(padx,pady,padw,padh, 15)

-- draw the ball
circ(ballx,bally,ballsize,15)
end

and uploaded cart to website https://tic.computer/play?cart...

try to learn and find the difference

Thank you so much!