[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Enigma-cvs] enigma/src world.cc,1.76,1.77
From: |
Daniel Heck <address@hidden> |
Subject: |
[Enigma-cvs] enigma/src world.cc,1.76,1.77 |
Date: |
Mon, 27 Oct 2003 22:18:53 +0000 |
Update of /cvsroot/enigma/enigma/src
In directory subversions:/tmp/cvs-serv8385/src
Modified Files:
world.cc
Log Message:
* Handle drunken actors
* Fixed behaviour of actors with pins
Index: world.cc
===================================================================
RCS file: /cvsroot/enigma/enigma/src/world.cc,v
retrieving revision 1.76
retrieving revision 1.77
diff -C2 -d -r1.76 -r1.77
*** world.cc 22 Oct 2003 10:30:10 -0000 1.76
--- world.cc 27 Oct 2003 22:18:51 -0000 1.77
***************
*** 38,41 ****
--- 38,42 ----
#include <numeric>
#include <cassert>
+ #include <cmath>
// remove comment from define below to switch on verbose messaging
***************
*** 381,397 ****
if (a->is_on_floor()) {
if (Floor *floor = GetFloor(p)) {
- double friction;
// Mouse force
! if (a->has_spikes()) {
! f += level->mouseforce.get_force(a) * 1.0;
! friction = 1.0;
! }
! else {
! f += floor->process_mouseforce(a,
level->mouseforce.get_force(a));
! friction = floor->friction();
}
// Friction
double vv=length(v);
if (vv > 0) {
--- 382,402 ----
if (a->is_on_floor()) {
if (Floor *floor = GetFloor(p)) {
// Mouse force
! V2 mousef (floor->process_mouseforce(a,
level->mouseforce.get_force(a)));
! if (a->is_drunken()) {
! // rotate mouse force by random angle
! double maxangle = M_PI * 0.7;
! double angle = DoubleRand (-maxangle, maxangle);
! mousef = V2(mousef[0]*cos(angle) - mousef[1]*sin(angle),
! mousef[0]*sin(angle) + mousef[1]*cos(angle));
}
+ f += mousef;
// Friction
+ double friction = floor->friction();
+ if (a->has_spikes())
+ friction += 7.0;
+
double vv=length(v);
if (vv > 0) {
***************
*** 1096,1102 ****
}
}
-
-
-
namespace
--- 1101,1104 ----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Enigma-cvs] enigma/src world.cc,1.76,1.77,
Daniel Heck <address@hidden> <=