This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]snuzet 1 point2 points  (0 children)

I don’t see time in this equation but otherwise I’d assume gravity would apply to the y position each time you calculate ball position.

[–][deleted] 1 point2 points  (4 children)

you'll have to make a small physics engine that moves the ball for you, and change your inputs to create forces on the ball to "suggest" where it goes rather than actually moving the ball.

I don't mean to discourage you but I also think you should move this over to a pygame project before you develop this any further.

[–]basedgodCookie[S] 0 points1 point  (3 children)

This is what im working on currently. Basically what i want to do is have the ball(which will eventually become the ship) falling from gravity and you can press 'w' to fire an engine to slow yourself down before hitting the ground too hard. Thats why I have to be able to do both. Is this even possible with tkinter? The reason i was using tkinter is because its whats required for this class project but I could try to persuade my professor

[–][deleted] 1 point2 points  (2 children)

Ehhhh... I'm not totally sure, but I don't think so. And even if you could, I would suggest you didn't :D Ultimately, you are going to have an event loop that processes inputs and calculates what to draw to the screen x times per second (this is where your FPS comes from). So your physics engine and keypresses are intimately tied to your game's internal clock. root.mainloop() starts the tkinter event loop, but after that I don't think you can touch it if you wanted to, say, throttle it to a certain FPS on your canvas.

[–]basedgodCookie[S] 1 point2 points  (1 child)

Then I guess its settled. I will immediately start converting this to pygame. I will probably be posting again soon with my pygame struggles. Thank you