/[enigma]/enigma/src/world.cc
ViewVC logotype

Diff of /enigma/src/world.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.53 by reallysoft, Sun Jun 22 08:14:02 2003 UTC revision 1.54 by reallysoft, Mon Jun 23 22:21:01 2003 UTC
# Line 437  get_accel (Actor *a, const V2 & x, const Line 437  get_accel (Actor *a, const V2 & x, const
437      V2 f;      V2 f;
438      GridPos p((int)x[0], (int)x[1]);      GridPos p((int)x[0], (int)x[1]);
439    
440      if (a->is_on_floor())      if (a->is_on_floor()) {
441      {          if (Floor *floor = GetFloor(p)) {
442          if (Floor *floor = GetFloor(p))              double friction;
443          {  
444              // Mouse force              // Mouse force
445              f += floor->process_mouseforce(a, level->mouseforce.get_force(a));              if (a->has_spikes()) {
446                    f += level->mouseforce.get_force(a) * 1.0;
447                    friction = 1.0;
448                }
449                else {
450                    f += floor->process_mouseforce(a, level->mouseforce.get_force(a));
451                    friction = floor->friction();
452                }
453    
454              // Friction              // Friction
455              double vv=length(v);              double vv=length(v);
456              if (vv > 0) {              if (vv > 0) {
457                  V2 frictionf = v * enigma::FrictionFactor*floor->friction();                  V2 frictionf = v * enigma::FrictionFactor*friction;
458                  frictionf /= vv;                  frictionf /= vv;
459                  frictionf *= pow(vv, 0.8);                  frictionf *= pow(vv, 0.8);
460                  f -= frictionf;                  f -= frictionf;
461              }              }
462    
463              f += floor->get_force(a);              f += floor->get_force(a);
464          }          }
465    
466          if (Item *item = GetItem(p))          if (Item *item = GetItem(p)) {
         {  
467              f += item->get_force(a);              f += item->get_force(a);
468          }          }
469      }      }

Legend:
Removed from v.1.53  
changed lines
  Added in v.1.54

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26