This program simulates gravity and the electromagnetic force. When the green flag is clicked, it asks for the strength of each force, relative to the default strength, then it asks questions to determine the properties of the first object to be created. Pressing 'd' for any question before object type will set it to a default. An Overview of each parameter: 1. density exponent: this determines how close each particle is to each other. Not used for "big bang" or "satellite" settings. d=9 2. x: horizontal distance from origin. d=0 3. y: vertical distance from origin. d=0 4. vx: horizontal velocity. d=0 5. vy: vertical velocity. d=0 6. mass exponent: determines mass of particles, a difference of 1 equates to a mass difference of 10 fold. Not used for "big bang" setting. d=16 7. create ___: This determines what kind of object it creates, the options are object, satellite, star system, random, big bang, and random universe. Entering n will cancel. object creates a particle with your desired properties. satellite creates an object that orbits another. star system creates a star that is orbited by several planets that may each be orbited by moons. random creates a bunch of objects randomly. big bang creates a bunch of low mass particles close together. random universe combines the other options randomly. setting determines what objects are used. 1 or more creates objects, 2 or more creates satellites, 3 or more creates star systems, 4 or more creates randoms, and 5 or more will create big bangs. Button controls: w and s to zoom in and out, a and d slows down and speeds up the simulation, arrow keys move the screen*, p pauses or unpauses, y reveals the variables and h hides them, z will scale it so that all particles are visible, and space will allow you to create a new object, q and e change the centered objects. *doesn't work if centered on an object. Slider toggles: shatter will allow particles to burst into several smaller particles when they collide. center? will center on a particle. no show will hide all the particles. (so it can run slightly faster) wait? slows down each frame by 0.01 seconds trails will allow particles to leave trails the delete button will delete the centered particle variables: the variable in the top right corner is frames per second, the top of the variables above SCALE is the number identity for the centered particle, the qualities of the particle are down the side ending in x and y, time is the number of seconds that have past in the simulation, years is the time in earth years that has past, the variable in the bottom left corner is the number of particles, and the SCALE is how zoomed in or out you are, -2 is 10 times zoomed out than -1.
If you have any suggestions or notice any bugs, please comment. This was somewhat inspired by Orbit Simulator (https://scratch.mit.edu/projects/368598316) and I referred to the code to help me in a few places. All the code was done by me, based on physical laws discovered by a variety of scientists. Special credit goes to Sir Isaac Newton for the discovery of the laws of momentum and gravity. 2020, aug, 5 v1: initial release