MJ6KKFVTYJDUPLERQZ7B7TU2N6VEMIR7AOUY6R46A6VVAFTVA5VAC
X7MRZ5CL2SWEFF3Q5RENSFN3WLCRDDKMUF4JZDYPGTMG746XVFFQC
NV4WC3K4KQMF4NSGAKJG7JMN3WNDWPIA7NVYVZUOWFUKZ4562UEQC
OOSUBWKXQ3UAQOXDKBVBXHBZPTU2OVGFXZHBEXDEICFDHRGQIALQC
J6O7HP7J75LI6ACR7T4VRJOSEFA6FWATXSJO6YCDS3I4W62OKPPAC
5RUFNRJOK3PXQKJTPDEN5K5PI67MGB25QUA44WOCCH2O5KHXT45QC
ZM7NOBRMD5HHA35Y4JDC76EOA2RD4KQOQCPURXYKXA6ABMKOJIGQC
VUF2SX7BSB6DYFUCIS24UAMIQB4F3FLYSDLS5UXDCKIKPTWH4WWQC
"-- Some examples; feel free to delete them and they'll never return.",
'-- First example: you can perform simple calculations.',
'-- (scroll down..)',
"-- Try hitting the 'run' button above.",
"-- When you're done, tap on the right margin to go to the next example.",
'2+3'
name='expr',
lines={
"-- Some examples; feel free to delete them and they'll never return.",
'-- First example: you can perform simple calculations.',
"-- (scroll down if you're on a small screen..)",
"-- Try hitting the 'run' button above.",
"-- When you're done, tap on the right margin to go to the next example.",
'2+3',
}
'-- print() calls show up in the area below.',
"-- Hit 'run' and then scroll through the results.",
'for i=1,20 do print(i) end',
name='print',
lines={
'-- print() calls show up in the area below.',
"-- Hit 'run' and then scroll through the results.",
'for i=1,20 do print(i) end',
},
'-- You can draw on the screen.',
"-- After you hit 'run', try hitting 'hide'.",
'love.graphics.line(100,100, 200,300)'
name='draw',
lines={
'-- You can draw on the screen.',
"-- After you hit 'run', try hitting 'hide'.",
'love.graphics.line(100,100, 200,300)',
},
'-- A checkerboard',
'-- Notice Safe_width and Safe_height for the bounds of the screen.',
'n = 100',
'for x=0,Safe_width,n do',
' for y=0,Safe_height,n do',
' if (x+y)/n%2 == 0 then',
' love.graphics.setColor(0.9, 0.7, 0.7)',
' else',
' love.graphics.setColor(0.7, 0.7, 0.9)',
' end',
" love.graphics.rectangle('fill', x,y, n,n)",
' end',
'end',
name='pattern',
lines={
'-- A checkerboard',
'-- Notice Safe_width and Safe_height for the bounds of the screen.',
'n = 100',
'for x=0,Safe_width,n do',
' for y=0,Safe_height,n do',
' if (x+y)/n%2 == 0 then',
' love.graphics.setColor(0.9, 0.7, 0.7)',
' else',
' love.graphics.setColor(0.7, 0.7, 0.9)',
' end',
" love.graphics.rectangle('fill', x,y, n,n)",
' end',
'end',
},
'-- For animations, you can define various functions that will get called for you.',
'-- LÖVE supports functions of the form love.*,',
'-- for example, love.draw, love.update, etc.',
"-- You can't define those directly because Carousel Shell needs to define them for its UI, but you can define your own under car.*,",
'-- for example, car.draw, car.update, etc.',
'Radius, dRadius = 100, 10',
'function car.draw()',
" love.graphics.circle('fill', 100,100, Radius)",
'end',
'',
'function car.update(dt)',
' Radius = Radius+dRadius',
' if Radius > 500 then dRadius = -dRadius end',
' if Radius < 30 then dRadius = -dRadius end',
'end',
name='animation',
lines={
'-- For animations, you can define various functions that will get called for you.',
'-- LÖVE supports functions of the form love.*,',
'-- for example, love.draw, love.update, etc.',
"-- You can't define those directly because Carousel Shell needs to define them for its UI, but you can define your own under car.*,",
'-- for example, car.draw, car.update, etc.',
'Radius, dRadius = 100, 10',
'function car.draw()',
" love.graphics.circle('fill', 100,100, Radius)",
'end',
'',
'function car.update(dt)',
' Radius = Radius+dRadius',
' if Radius > 500 then dRadius = -dRadius end',
' if Radius < 30 then dRadius = -dRadius end',
'end',
},
'-- For interactivity, LÖVE provides functions like love.keypressed, love.mousepressed, etc.',
'-- As before, define the corresponding car.keypressed, car.mousepressed, etc.',
"-- A pane's interactive events only activate when the editor is hidden using the 'hide' button above.",
"-- Try running this example and then pressing and holding the mouse and pressing and releasing keys.",
'-- Then try hiding the editor and again pressing and holding the mouse and pressing and releasing keys',
'X, Y, dX = 100, 0, 10',
"Log = ''",
'',
'function car.draw()',
' love.graphics.line(X,Y, X,Y+300)',
' love.graphics.print(Log, 50,50)',
'end',
'',
'function car.update(dt)',
' if X > 500 then dX = -dX end',
' if X < 100 then dX = -dX end',
' X = X+dX',
'end',
'',
'function car.mousepressed(x,y, button)',
' Y = y',
'end',
'',
'function car.mousereleased(x,y, button)',
' Y = 0',
'end',
'',
'function car.keypressed(key)',
' Log = Log..key',
'end',
name='interactive',
lines={
'-- For interactivity, LÖVE provides functions like love.keypressed, love.mousepressed, etc.',
'-- As before, define the corresponding car.keypressed, car.mousepressed, etc.',
"-- A pane's interactive events only activate when the editor is hidden using the 'hide' button above.",
"-- Try running this example and then pressing and holding the mouse and pressing and releasing keys.",
'-- Then try hiding the editor and again pressing and holding the mouse and pressing and releasing keys',
'X, Y, dX = 100, 0, 10',
"Log = ''",
'',
'function car.draw()',
' love.graphics.line(X,Y, X,Y+300)',
' love.graphics.print(Log, 50,50)',
'end',
'',
'function car.update(dt)',
' if X > 500 then dX = -dX end',
' if X < 100 then dX = -dX end',
' X = X+dX',
'end',
'',
'function car.mousepressed(x,y, button)',
' Y = y',
'end',
'',
'function car.mousereleased(x,y, button)',
' Y = 0',
'end',
'',
'function car.keypressed(key)',
' Log = Log..key',
'end',
},
'-- Some abbreviations to reduce typing.',
'g = love.graphics',
'points, line, rectangle, polygon, circle, arc, ellipse = g.points, g.line, g.rectangle, g.polygon, g.circle, g.arc, g.ellipse',
'color, bgColor = g.setColor, g.setBackgroundColor',
"-- Enough abbreviations, let's draw.",
'color(1,0,0) bgColor(0,1,0)',
'line(100,100, 200,300)',
"circle('fill', 200,100, 30)",
'-- once you load this pane, the abbreviations here will be available in any other pane',
name='abbreviations',
lines={
'-- Some abbreviations to reduce typing.',
'g = love.graphics',
'points, line, rectangle, polygon, circle, arc, ellipse = g.points, g.line, g.rectangle, g.polygon, g.circle, g.arc, g.ellipse',
'color, bgColor = g.setColor, g.setBackgroundColor',
"-- Enough abbreviations, let's draw.",
'color(1,0,0) bgColor(0,1,0)',
'line(100,100, 200,300)',
"circle('fill', 200,100, 30)",
'-- once you load this pane, the abbreviations here will be available in any other pane',
},