Github Copilot

https://www.youtube.com/watch?v=IP_zm1EWiP8

To open the Solar2D simulator from your terminal, navigate to a Solar2D project folder that contains a main.lua file and run:

open -a "Corona Simulator" main.lua

Alternatively, use the Run Terminal Command feature in VSCode.

To use Corona’s sample code as a reference for Copilot, create a symbolic link from /Applications/Corona/SampleCode to your project’s workspace. Open your terminal and run:

ln -s /Applications/Corona/SampleCode ../
  1. Run your Kwik project in the Solar2D simulator.

    In this example, the balloon layer in App/{Book}/components/{PAGE}/ballon_mask.lua has been replaced with a mask layer in the Kwik editor.

  2. In the Kwik editor, right-click a layer/class and select “In vscode” from the context menu.

  3. The file will open in VSCode. Add it to Copilot Edits. In this case, App/replacement/components/mask/layers/balloon_mask.lua is added.

  4. To use a sample file as a guide, open Graphics/Flashlight/main.lua from the CoronaSampleCode folder and add it to Copilot Edits as well.

  5. Write a prompt for Copilot. Here is a simple example:

    modify M:didShow function in ballon_mask.lua to make a obj.group animate randomly
    to new position smoothly, referencing how to move it in main.lua
  6. Accept the changes to finish editing.