Skip to content

Examples

Shapes and Colors

Animations and Variables

  • Doodle Draw - Create a basic drawing program tracking mouse movements
  • Drawing Lines - A drawing program demonstrating HSB colorMode
  • Animation with Events - Pause and resume animation.
  • Conditions - Use if and else statements to make decisions while your sketch runs.
  • Basic Pong - A simple program demonstrating a basic implementation of pong with enemy AI player
  • Walking Lines - Animated intersecting lines
  • 10Print - An implementation of the classic maze-drawing algorithm
  • Conway's Game Of Life - An implementation of the zero-player game and simulation formulated by mathematician John Conway
  • Minimum Spanning Tree - An example of implementing Prim's algorithm for finding the shortest lengths to connect all randomly placed dots
  • Easing - Smooth animation with easing as a shape follows the mouse
  • Clock - Display the current time as an analog clock
  • Milliseconds - Create time-based color patterns using elapsed milliseconds

Input and Interaction

Mouse Input

  • Mouse 1D - Use horizontal mouse position to shift the balance between two rectangles
  • Mouse 2D - Control position and size of boxes using two-dimensional mouse movement
  • Mouse Press - Create a crosshair that changes color when the mouse button is pressed
  • Mouse Functions - Click and drag a box around the screen
  • Mouse Signals - Visualize mouse input signals as real-time waveforms
  • Storing Input - Record and display mouse position trails over time

Keyboard Input

  • Keyboard - Press letter keys to create forms in different positions
  • Keyboard Functions - Interactive color typewriter with different output for uppercase and lowercase letters

Constraints and Movement

  • Constrain - Limit a shape's movement within a bounded area

Imported Media

Object-Orientation

  • Random Robot Objects - Demonstrates two different Lua patterns - classes with metatables and simple table objects