Files
Basalt2/node_modules/shiki/samples/lua.sample
Robert Jelic 31787b0e9b Fix
2025-02-16 18:04:24 +01:00

19 lines
384 B
Plaintext

ball = {
xpos = 60,
ypos = 60,
-- without the colon syntax, must mention self argument explicitly
move = function(self, newx, newy)
self.xpos = newx
self.ypos = newy
end
}
-- using the colon, ball is passed as self automatically
ball:move(100, 120)
-- using the dot, must pass self explicitly
ball.move(ball, 100, 120)
-- From https://pico-8.fandom.com/wiki/Lua