Skip to content

Latest commit

 

History

History
9 lines (8 loc) · 2.12 KB

README.md

File metadata and controls

9 lines (8 loc) · 2.12 KB

Fun-Simulations

Here I will be making some cool and fun simulations using python programming language and few libraries like pygame.

Content Present:

  • FallingSand: This comes in the cellular automaton logic where I have coded a basic cellular automaton particles like sand, water, stone and gas. These have their appropriate physics like sinking, floating, etc. To draw press mouse button. To change materials, use keyboard keys: Sand (s), Stone (b), Water(w) and Gas(g)
  • SortingAlgorithmViz: Here I have made a small GUI for various sorting algorithms like: Bubble Sort, Selection Sort, Insertion Sort, Quick Sort, Merge Sort, Comb Sort and Shell Sort. You can start the app and then select on the desired method and press start to see the simulation run and show how it sorts the randomly generated array.
  • Boids: This is use to show the behavior of flocks of birds. It consists of 3 basic rules: Separation (S), Alignment (A) and Cohesion (C). If you wish to alter the parameter of their ratio press the appropiate key EX: s for Separation and then use Arrow keys (Up and Down) to alter their value. This is a beautiful simualtion to show how a group of artificial life interact with each other.
  • Terrain Generation: This is used to procedurally generate terrain (Can be used in games to create game map). This uses the Perlin noise to create a height map and then based on it, the simulation will display the terrain. It currently has Deep ocean(Dark blue), ocean (Blue), Beach (yellow), land (Green), Mountain (Brown), Snow / Mountain peek (White). You can use arrow keys to move around. This requires Noise library installed. Use pip install noise.
  • Perlin Noise Flow Field: This is another Perlin noise simulation where I have used Perlin noise to give direction to various particles like they are present in a field of forces. The Perlin noise decides the direction (angle) of a vector at a point and then when even a particle in near that point that force acts on it to give it a force. This causes the particles to move in a specific path. Now I just keep drawing a line as the particle moves which causes this amazing patterns.