Devlog 5
Yesterday, I hoped to finish the configuration tabs of the last chemistry simulations but guess what? I didn’t finish them. You might be asking yourself: “Why?”
Well, I decided to start working on the simulations in Pygame rather than spending more time on the last 4 configuration tabs; I think that it is more efficient and less time consuming. In fact, I’ve finished the 2 first physics simulations (for reference, the Projectile and Pendulum simulations) and the result is actually pretty neat; the simulations are based on real physical properties and they seem to work really good. If you want to see the things that I’ve done in detail today, here is, as always, the list:
-
created a new folder in the GitHub repository for the physics simulations
-
created an “init.py” file to be able to access the functions of the physics simulations from the launcher
-
finished the Projectile and Pendulum simulations by defining some physical variables whose values will be extracted from the launcher
-
calculated some physics formulae (x and y components for the velocities, drag force formula based on the air density, surface area, drag coefficient and the total velocity of the projectile squared by using Euler’s Method to integrate these values numerically for both the Projectile and Pendulum simulations in order to update their respective x and y positions but also the angular velocity and angle of the pendulum by using the same method previously mentioned)
-
created some functions to draw the projectile and the pendulum mass (or bob)
-
added labels to track the values of the physical properties for the simulations mentioned above
-
changed the position of these labels as well as their font weight (actually their size) to make everything look more uniform
-
added the color palette of the launcher to the simulations
I have to admit that I stumbled across a lot of bugs today when trying to implement the 2D vectors for the first simulation (velocity, gravity, total force which is equal to the sum of the gravity and drag force) so I decided to use another method without these vectors. However, I will probably implement the vectors in the future (as you can see on a comment of the code) because they are simpler to use.
Finally, I will continue working on the simulations and after finishing them, the 4 configuration tabs left will be done.
I really appreciate the support received by reading the devlogs that I post and liking them; I hope that you, the person reading this, know that it means a lot for me.