My brother needed to figure out how to create some toggle switches for a school project, so I figured I'd help him out a bit by coding a version of my own in parallel with his. This is what I came up with, and while I wasn't originally planning on sharing it, I assume someone out there needs to know how to make something similar, so why not help them? So what does it do? Well, the project has one transparent sprite which draws whatever switches you need using the pen extension. There is a procedure with 3 parameters, 'x position', 'y position', and 'index'. 'x position' and 'y position' are self-explanatory, determining where a given switch is drawn onscreen. 'Index' is an integer value that identifies a switch so it knows what data it is meant to use. Beyond that, just be aware that this clears the pen layer each time it runs due to how it is rendered and that the two lists used need to have at least as many items as the highest index you use. That's pretty much what you need to know if you'd like to use it, but if you want to know more about how it works, keep reading. There are 2 list variables, named position and value, which are used to store information about the state of each switch. The list item indices are what the index parameter I described before actually refers to. Each switch has an item in value describing its state, 0 for off and 1 for on. When the switch is clicked this item is set to (1 - value[index]) to toggle the state. The other list, position, stores a value between 0 and 1 describing the displacement of the knob, with 0 being all the way to the left and 1 being all the way to the right. This value is used to animate the switch turning on and off. Every time the procedure runs, the difference between value and position is halved, creating an easing effect that makes the motion far more pleasant than it would be were it simply linear.