Changeset c76134b in network-game for common


Ignore:
Timestamp:
Jun 18, 2013, 11:16:21 PM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
66c4ec4
Parents:
1d0ede1
Message:

A player respawns at their flag 10 seconds after dying

Location:
common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • common/Player.cpp

    r1d0ede1 rc76134b  
    1717   this->timeLastUpdated = 0;
    1818   this->timeAttackStarted = 0;
     19   this->timeDied = 0;
    1920   this->isChasing = false;
    2021   this->isAttacking = false;
     22   this->isDead = false;
    2123
    2224   this->playerClass = CLASS_NONE;
     
    4446   this->timeLastUpdated = p.timeLastUpdated;
    4547   this->timeAttackStarted = p.timeAttackStarted;
     48   this->timeDied = p.timeDied;
    4649   this->isChasing = p.isChasing;
    4750   this->isAttacking = p.isAttacking;
     51   this->isDead = p.isDead;
    4852
    4953   this->playerClass = p.playerClass;
     
    6973   this->timeLastUpdated = 0;
    7074   this->timeAttackStarted = 0;
     75   this->timeDied = 0;
    7176   this->isChasing = false;
    7277   this->isAttacking = false;
     78   this->isDead = false;
    7379
    7480   this->playerClass = CLASS_NONE;
  • common/Player.h

    r1d0ede1 rc76134b  
    6161   unsigned long long timeLastUpdated;
    6262   unsigned long long timeAttackStarted;
     63   unsigned long long timeDied;
    6364   bool isChasing;
    6465   bool isAttacking;
    6566   int targetPlayer;
     67   bool isDead;
    6668
    6769   int playerClass;
  • common/Projectile.cpp

    r1d0ede1 rc76134b  
    7474   // if the current target logs off, this method will run into problems
    7575
    76    //cout << "Inside projectile move" << endl;
     76   cout << "Inside projectile move" << endl;
    7777
    7878   unsigned long long curTime = getCurrentMillis();
     79   cout << "Got current time" << endl;
     80
    7981   Player targetP = mapPlayers[target];
     82   cout << "Got target" << endl;
    8083
    8184   if (timeLastUpdated == 0) {
     
    8992   float dist = sqrt(pow(targetP.pos.x-pos.x, 2) + pow(targetP.pos.y-pos.y, 2));
    9093
    91    //cout << "About to finish projectile move" << endl;
     94   cout << "About to finish projectile move" << endl;
    9295
    9396   if (dist <= pixels) {
Note: See TracChangeset for help on using the changeset viewer.