Sunday, 29 April 2012

Gotcha!

OK, so a little bit of coding before bed. Now the harpoon responds appropriately when it has caught a fish, retracting at a fairly nippy speed back to the boat, carrying the fish.

The main challenge here was getting the harpoon and fish to communicate with each other. They're separate objects which don't share scope. I solved it by making the harpoon do all the work. It detects the fish, tells the fish it has been caught, then tells it to track it all the way back. It even tells the fish when they have reached the boat, so the fish knows when to disappear. Stupid fish.


Updated Source Code (wave9.py)

No comments:

Post a Comment