Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /************************************************************************/
- // Task P13.1a: Fill out this function
- // Write the result to output->linear
- // You can get the AI's position using character->Position
- /************************************************************************/
- Kore::vec2 direction = *target - character->Position;
- direction.normalize();
- output->linear = direction * maxAcceleration;
- /************************************************************************/
- // Task P13.1b: Fill out this function
- // Write the result to output->linear
- // You can get the AI's position using character->Position
- /************************************************************************/
- Kore::vec2 direction = *target - character->Position;
- direction.normalize();
- output->linear = -(direction * maxAcceleration);
- /************************************************************************/
- // Task 13.2a: Complete this class so that it correctly returns
- // Checks if the moon is closer or further away from the specified distance
- /************************************************************************/
- class MoonCondition : public Condition {
- public:
- /**
- * Performs the test for this condition.
- */
- virtual bool test() {
- if (moon->Position.distance(earth->Position) < 1) {
- return true;
- }
- return false;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement