You are browsing as a guest. Sign up (or log in) to start making projects!

4h 58m 54s logged

Devlog 1

I’ve just finished the main part of this project: the interactive nucleus. It didn’t come without its headaches, though.

In essence, the way it works is that when you press the up button, it adds a proton to the nucleus at a random position. When you press the down button, it removes the proton. Same thing for neutrons, except you use the right and left buttons, respectively. I wanted the nucleus to be relatively circular while still keeping the random positions for the subatomic particles. Eventually, I figured I could do that by forcing every particle to overlap with two other particles when they were randomly generating a position. However, this led to the particles not instantly showing up after you pressed either the up or right button, so I’ll have to make the algorithm that generates the particles more efficient.

Additionally, many errors arose from pressing the add and remove buttons simultaneously for both of the particles. These were easily fixed in two ways. One was adding the await keyword before the methods in the functions that added and removed the particles. The second was adding booleans that restricted the remove function from being called while a particle was being added. These fixes took me a while to figure out, though.

Moving on, I need to make the whole simulator look a bit better, and I also need to add labels for the number of particles there are and the names of the various isotopes.

0
9

Comments 0

No comments yet. Be the first!