new example: draw and update callbacks

akkartik
Nov 22, 2023, 5:24 AM
J6O7HP7J75LI6ACR7T4VRJOSEFA6FWATXSJO6YCDS3I4W62OKPPAC

Dependencies

  • [2] OOSUBWKX subject people to a tutorial

Change contents

  • edit in 0078-Example_panes at line 40
    [2.1197]
    [2.1197]
    'end',
    },
    {
    '-- For animations and interactivity, 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, love.keypressed, etc.',
    "-- You can't define those directly because Carousel Shell needs to define them, 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)",
  • edit in 0078-Example_panes at line 52
    [2.1206]
    [2.1206]
    '',
    'function car.update(dt)',
    ' Radius = Radius+dRadius',
    ' if Radius > 500 then dRadius = -dRadius end',
    ' if Radius < 30 then dRadius = -dRadius end',
    'end',
  • edit in 0078-Example_panes at line 68
    [2.1601]
    [2.1601]
    '-- once you load this pane, the abbreviations here will be available in any other pane',