Nature of Code: Chapters 3 & 4
This exercise combines 3.1 & 3.2, handling angular velocity and rotation. Within this sketch I have a spinning "baton" which starts out with no velocity. By pressing the Spacebar, you can accelerate the baton over time in a clockwise direction. You can also grab the baton and spin it as though spinning a wheel, with the angular momentum being calculated by the motion imparted. Over time, the baton slows as though via a universal drag force.
This sketch is a macroquad friendly interpretation of Exercise 3.5. As macroquad is geared more towards 2D game development, rather than a focus on artistic 'sketches' and creative coding in general like processing and p5.js, I have had to tweak the exercise a bit to instead create a spiral which has a long, but not permanent tail.
This sketch is a simple emitter which is tied to the mouse location. When the mouse is within the area of the sketch, the emitter will move to the mouse location, continuing to emite a steady stream of particles as it goes. There is constant 'gravity' which pulls the particles towards the bottom of the screen.
This sketch combines Exercises 4.2, 4.3, and 4.4, iterating on a previous example from Chapter 1. This showcases a custom emitter system which has been attached to the 'Mover' object from Exercise 1.5. The ship now creates a fiery trail of short lived particles which fade and disappear as the simulation runs.
Controls
- Up - Accelerate
- Right/Left - Turn
- Down - Brakes