CodingTrain / CodingTrain/Suggestion-Box
Particle life
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 570
- Fork
- 85
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
As Conway's game of life, particle life also takes place on 2d grid, but there are no cells. In this version, instead of cells being dead or alive, you have n amont of particles. They move freely in plane, but follow some rules.
1. There are multiple different types (like red, yellow...). These different types can attract or repell each other. Physics law of each reaction has an equal and opposite reaction does not apply. Red can attract blue to itself but blue can repell red away from itself.
2. Each type has a repelling force to all types no matter what if points are closer than 'point a'. Point a is chosen randomly, but works best if it is between the radius of a particle and 3 radiuses. From point a to point b (approx. 4 radiuses - 7 radiuses), there is a random force (rule 1), but it does not fade with distance.
3. Points have drag. Otherwise they could accelerate infinetly.
To recap random forces, as it may have been confusing.
At start of the program, a random number of types are generated (if less than 5, it isn't interesting, more than 12 gives you mess)
Then you create 2d array. In this case there will only be red and green type, so array is 2 by 2. Red has an index 0 and green has index 1. Loop through every slot. If index from main array == index from subarray, the program only chooses point a (distance for repelling force to prevent particle overlapping)at a random distance and point b with the same distance as point a. That means force in area b cannot be applied as it is either a or out of range for b. We want that, because a red can't add force to another red particle (remember: this is only for index from main array == index from subarray case) If index from main array! = index from subarray that means we are looking at two different colors. Array[0 (red) ] [1 (green) ] for instance means the program has to choose what force red particle will add to green particle, if it comes inside a certain radius. Again, distance a is randomly selected and distance b as well, this time not the same as distance a. For that object in that array[0][1] the program also randomly picks a force (lets say betwen - 5 and 5). That means red particle can either attract or repell green particle, and at different forces as well (it only changes once the game is restarted and new values are picked. Throughout the game, particle can add force to another particle, but it can recive comletly different force back from that particle or even no force, if other particle is inside this's b radius and this isn't inside other's b radius. At the end of the tick, they are slown down (drag)
This gives you even more alive forms than Conway's game of life.
If this wasn't clear, check out CodeParade's video about this: https://youtu.be/Z_zmZ23grXE
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Non vengono menzionati file del repository, test o punti di ingresso. Esamina prima il suggerimento e il video CodeParade collegato, quindi determina se questo repository dispone di un processo definito per trasformare idee di argomenti in progetti; il lavoro sarebbe completato quando fossero stati concordati l’ambito di implementazione e il percorso di contribuzione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Ambito
- game-dev
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 20/100