This sketch fills the screen with ghosts! It uses the cos() function to make the ghosts go left and right, and it uses an array to hold previous values to make the tail.
This is a companion discussion topic for the original entry at https://happycoding.io/examples/p5js/creating-classes/ghosts