Tap the arrow keys to move the sixteen ellipses left to right.

A fork of Unit 3, Lab 2 - Moving Wave by Michael Condiracci

CC Attribution ShareAlike

Unit 3, Lab 2 - Moving Wave - Changes

Just follow the funky flow!
Tap the arrow keys to move the sixteen ellipses left to right.
e.g., mouse, keyboard
e.g., visualization, fractal, mouse
Learn more about Creative Commons
Join Plus+ to change privacy settings
  • A Couple Changes to Smooth Things Out

    Hi Michael, thought I'd make this a tutorial so I could walk through a couple changes. First, you don't need to use `translate` to achieve the change—you can simply change the `xStart` variable (which you're already doing, just within the context of `translate`). Specifically, I can change:

    to...


  • Moving the Code Into `draw`

    The code that is inside `keyPressed()` can be put inside of an `if` statement inside of the draw function, using `keyIsPressed`. So this:


    becomes this:

    Which allows for smoother movement because it's being checked every frame, instead of just the frame in which the key goes from up to down.

1/2
  • mySketch
Select mode or a template
Centers sketch and matches the background color.
Prevents infinite loops that may freeze the sketch.
This will be the default layout for your sketches
Easy on the eyes
It will show up when there is an error or print() in code
Potential warnings will be displayed as you type
Closes parenthesis-like characters automatically as you type

Controls
Play
Ctrl+Enter
Code
Ctrl+Shift+Enter
Save
Ctrl+S
Interface
Fullscreen
Ctrl+Alt+F
Switch Layout
Ctrl+Alt+L
Settings
Ctrl+Alt+.
Editor
Tidy Code
Ctrl+B
Multiple Cursors
Ctrl+Click
Duplicate Line/Selection
Ctrl+Shift+D
Move Line
Alt+↑/↓
Select Multiple
Ctrl+D
Find in Code
Ctrl+F
Find Next
Ctrl+G
Find Previous
Ctrl+Shift+G

See More Shortcuts

Join Plus+ for private sketches, version history, 1GB space, custom embeds, and more!