How to calculate scores on an archery board? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

How to calculate scores on an archery board?

The link below is a part of my game code about the archery board and how I put it in the main game loop. I tried searching online and I found that I most possibly need to use get_rect() of the circle to find the rect bounding the circle but I don't know how. I also found some online examples of using graphwin for the board so I kind of know what I need to code which is to find the mouse position, find the distance using math.hypot(x, y) but the thing is I'm not using graphwin so how do I apply these things to just pygame? I kind of know what I need but at the same time, don't as well. So I would really appreciate any advice/suggestion, it would be even better if you show me a sample code in the code playground. https://code.sololearn.com/cr6A6YDJtfXi/?ref=app

13th May 2019, 12:56 AM
Sharon Chua
Sharon Chua - avatar
5 Answers
+ 2
I might be able to help. First question: Is it a 2D or 3D game?
15th May 2019, 7:48 AM
Seb TheS
Seb TheS - avatar
+ 2
I have a solution. May I spoil it?
15th May 2019, 8:08 AM
Seb TheS
Seb TheS - avatar
+ 2
Chua Yee Tong, Sharon , Sharon I thought that you'd make few lines to represent the board. And the program would work by mathematically forecasting the arrow trajectory to the board and the forecasting would tell where the arrow stops and when the arrow should stop. There are different lines, and if the arrow get shot on the board it'll hit one of the lines. And different lines adds different amount of scores to a variable.
15th May 2019, 9:18 AM
Seb TheS
Seb TheS - avatar
0
Seb TheS It's a 2D game
15th May 2019, 7:57 AM
Sharon Chua
Sharon Chua - avatar
0
Yep
15th May 2019, 9:03 AM
Sharon Chua
Sharon Chua - avatar