src/weapon/ninja_rope.cpp File Reference

#include "ninja_rope.h"
#include <math.h>
#include "explosion.h"
#include "../game/config.h"
#include "../game/game.h"
#include "../game/game_loop.h"
#include "../game/time.h"
#include "../include/app.h"
#include "../map/camera.h"
#include "../map/map.h"
#include "../sound/jukebox.h"
#include "../team/teams_list.h"
#include "../tool/math_tools.h"
#include "../tool/i18n.h"

Include dependency graph for ninja_rope.cpp:

Go to the source code of this file.

Functions

bool find_first_contact_point (int x1, int y1, double angle, int length, int skip, int &cx, int &cy)

Variables

const int DT_MVT = 15
const int DST_MIN = 6
const uint MAX_ROPE_LEN = 450
const uint ROPE_DRAW_SPEED = 12
const int ROPE_PUSH_FORCE = 10


Function Documentation

bool find_first_contact_point ( int  x1,
int  y1,
double  angle,
int  length,
int  skip,
int &  cx,
int &  cy 
)

Definition at line 43 of file ninja_rope.cpp.

00045 {
00046   double x, y, x_step, y_step ;
00047   int x2, y2 ;
00048 
00049   x_step = cos(angle) ;
00050   y_step = sin(angle) ;
00051 
00052   x1 += (int)(skip * x_step) ;
00053   y1 += (int)(skip * y_step) ;
00054 
00055   x = (double)x1 ;
00056   y = (double)y1 ;
00057   cx = x1 ;
00058   cy = y1 ;
00059 
00060   length -= skip;
00061 
00062   x2 = x1 + (int)(length * cos(angle));
00063   y2 = y1 + (int)(length * sin(angle));
00064 
00065   while(!world.EstHorsMondeXY(cx, cy) &&
00066         (length > 0))
00067     {
00068       if (!world.EstDansVide(cx, cy))
00069         return true ;
00070 
00071       x += x_step ;
00072       y += y_step ;
00073       cx = (int)round(x) ;
00074       cy = (int)round(y) ;
00075       length-- ;
00076     }
00077 
00078   return false ;
00079 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

const int DST_MIN = 6

Definition at line 38 of file ninja_rope.cpp.

const int DT_MVT = 15

Definition at line 37 of file ninja_rope.cpp.

const uint MAX_ROPE_LEN = 450

Definition at line 39 of file ninja_rope.cpp.

const uint ROPE_DRAW_SPEED = 12

Definition at line 40 of file ninja_rope.cpp.

const int ROPE_PUSH_FORCE = 10

Definition at line 41 of file ninja_rope.cpp.


Generated on Mon Jan 1 13:29:39 2007 for Wormux by  doxygen 1.4.7