1 00:00:00,000 --> 00:00:04,660 [MUSIC] 2 00:00:04,660 --> 00:00:06,740 Welcome to the final stage of this course. 3 00:00:06,740 --> 00:00:09,580 At this point, we've built out most of our classes. 4 00:00:09,580 --> 00:00:12,833 We've created several objects that are all working together and 5 00:00:12,833 --> 00:00:14,380 interacting with each other. 6 00:00:14,380 --> 00:00:17,766 We've rendered our visual components and added interactivity so 7 00:00:17,766 --> 00:00:21,522 a player can move their tokens around the board and drop them into spaces. 8 00:00:21,522 --> 00:00:22,742 But now what? 9 00:00:22,742 --> 00:00:25,022 A turn isn't just dropping a token. 10 00:00:25,022 --> 00:00:26,101 In a real life game, 11 00:00:26,101 --> 00:00:30,242 a lot of the synthesis that happens after someone drops a token is automatic. 12 00:00:30,242 --> 00:00:33,172 We can clearly see a space is filled with a token. 13 00:00:33,172 --> 00:00:35,141 It's obvious whose turn it is, and 14 00:00:35,141 --> 00:00:37,712 a winning move is visible right in front of us. 15 00:00:37,712 --> 00:00:42,032 In our game, though, we have to write the logic for the series of calculations. 16 00:00:42,032 --> 00:00:43,344 So throughout this stage, 17 00:00:43,344 --> 00:00:46,032 you'll be creating new methods to handle these tasks. 18 00:00:46,032 --> 00:00:48,740 At the conclusion of this course, you will write 19 00:00:48,740 --> 00:00:53,313 a final method called update game state, that calls them all in a specific order. 20 00:00:54,623 --> 00:00:58,015 This update game state method is the callback function that was 21 00:00:58,015 --> 00:00:59,873 mentioned earlier in the course. 22 00:00:59,873 --> 00:01:03,312 This function is passed as an argument to the drop animation, and 23 00:01:03,312 --> 00:01:05,573 is called once the animation is complete. 24 00:01:05,573 --> 00:01:09,953 Calling the update games state callback will trigger the following events. 25 00:01:09,953 --> 00:01:14,519 Filling the target space with the active token, checking for a winning move, and 26 00:01:14,519 --> 00:01:16,253 switching the active player. 27 00:01:16,253 --> 00:01:20,232 You'll tackle each of these steps one by one and then together, we'll 28 00:01:20,232 --> 00:01:24,693 come together for a solution video for the completed update game state method. 29 00:01:24,693 --> 00:01:27,593 That will be followed by a final demo of the game. 30 00:01:27,593 --> 00:01:29,748 Good luck, and see you soon.