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

47m 20s logged

Welcome!

Today, I fully migrated to the object-oriented programming architecture. Earlier, the class wasn’t really full OOP; it was just a hidden list factory that appended the stuff via a class instead of doing it manually. I wanted to change that because this is going to be a refactor in an OOP perspective, and that’s what I did.I made sure that all the formulas used the latest changes:1. Earlier, they would use the index of the objects inside the objs list of lists. It would be something like object1 and the index of whichever element it wants to access, like mass, radius, velocity, or coordinates. It was very sloppy, and you had to keep up with what each index meant.2. With an OOP version, you just write object1.mass, object1.x, or object1.vx. Each and every line is more intuitive.I also worked more on the planet spawning. Remember, this is a new file with a different perspective of trying to remake this in an OOP sense, using classes and the benefits that ensue from them.Additionally, today I implemented the balancing of the canvas differences in Tkinter and Turtle:- In Turtle, the (0, 0) coordinate is directly in the middle of the screen.- In Tkinter, it’s at the absolute top left of the screen.You have to make sure that all the formulas and all the logic get the correct version, which in my project is the Turtle version. I added and worked out the logic that would make sure that balance is kept.

0
3

Comments 0

No comments yet. Be the first!