Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Monster::moveTowardsTarget() {
- if(affliction != SHEEPED) {
- sf::Vector2<float> * start, * finish;
- start = finish = 0;
- start = this->getPosition();
- if(target) {
- finish = target->getPosition();
- }
- if(start && finish) {
- sf::Vector2<float> * movementVector = MATHER::makeUnitVector(start, finish);
- float movementDistance = calculateMovementDistance();
- MATHER::increaseVectorDistance(movementVector, movementDistance);
- this->setPosition(movementVector)
- }
- }
- }
Add Comment
Please, Sign In to add comment