CodingTrain / Directional-Boring

Horizontal Directional Drilling Simulation
MIT License
46 stars 21 forks source link

adding scoring system #7

Closed kfahn22 closed 2 years ago

kfahn22 commented 2 years ago

I have added a scoring system with some booleans for whether the player is still drilling or has failed. ( I found some code on stackoverflow to check for collision with the water.) If player goes out of bounds or hits water fail is updated and play is over. It will be relatively easy to add additional obstacles to code. If player succeeds they get a congratulatory message and their score. I weighted the total length of path by the half perimeter of an ellipse a = 300, b = 100 (based on formula I found on web--- approx. 670), figuring that it would be a good proxy for the most efficient path.

FYI, I changed the starting y position of vector by 1 to avoid starting off with a fail. (You probably have some better way of dealing with this).

Sorry, I just realized that I added my font color settings for VSC (BLACK), which you probably don't want.

shiffman commented 2 years ago

Oh hi @kfahn22! I've started this as well and went in a slightly different direction take a look at what I have in #8

image

shiffman commented 2 years ago

I'll merge mine as it stands now and continue from there in case you want to incorporate any of your ideas into where I am with this. (But you should also feel free to just make your own version and submit as part of the showcase!)