Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2013, 4:28:22 PM (11 years ago)
Author:
zifloria
Message:

fail

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/invaders/src/modules/invader/InvaderEnemy.cc

    r9858 r9859  
    5656        if (player != NULL)
    5757        {
    58             float newZ = player->getPosition().z - getPosition().z;
    59             if (newZ < 0)
    60                 newZ = (-100 < newZ)?-100:newZ;
    61             else
    62                 newZ = (100 > newZ)?100:newZ;
     58            float newZ = abs(getPosition().x - player->getPosition().x) * (player->getPosition().z - getPosition().z);
     59            // if (newZ < 0)
     60            //     newZ = (-100 < newZ)?-100:newZ;
     61            // else
     62            //     newZ = (100 > newZ)?100:newZ;
    6363            setVelocity(Vector3(1000 - level * 100 , 0, newZ));
    6464        }
Note: See TracChangeset for help on using the changeset viewer.