Coding Challenge #4 Lightning Effect



In this coding challenge I created a lightning effect.

This effect uses both object oriented program along with recursion. Each fork of lightning is its own object and is recursively updated and displayed.

Recursion is essentially just a function that calls itself until some base condition is met. In this case, when each branch of lightning is updated, it also updates its children. The base condition is that the branch is the last one (the lightning is given a ‘maximum level’ which indicates how many layers of branching to produce.

Hope you enjoy the episode!

Make sure to check out the links below, they’ve got everything you need to get started!

Check out the files from this challenge on github: https://github.com/BarneyWhiteman/CodingChallenges

Vote for new topics here: http://barneyw.net/youtube.html

Get Processing from here: https://processing.org/ Check out the rest of the Coding Challenges here:

Help support my channel:
buymeacoff.ee/Barney

source

Reply


Build A Site Info