Gabe C.

asked • 10/17/21

Python animation game

Using python, if I wanted to make two shapes interact with each other, how would I do that?

I am trying to make a simple game from scratch using if/elif/else.


What I have done so far is created a mouse that will move randomly across the panel to try to get to the other side. On the opposite side of the screen, I have created a box to try and block the mouse from reaching the other side.


What I am trying to do is when the mouse runs into the box, it will deflect and head in a random opposite direction. I can't figure out how to get the mouse to deflect and run away. The mouse always runs right through my box.


1 Expert Answer

By:

Noah H. answered • 10/29/21

Tutor
4.8 (50)

AP Computer Science and College Level Computer Science and Math Tutor

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.