定数


4.2.4.3 定数

There are several constants that we use in this game. By using constants it is easier to change the behaviour. Even better would be to read these fields from a configuration file but that is beyond the scope of this tutorial:

ゲーム中で使用する、いくつかの定数です。定数を使用することにより、振る舞いを変更することが簡単になります。もちろん環境設定ファイルから読み込むことがより良いです。しかし、それはこのチュートリアルの範疇を超えています。

// World defines.
#define ROOM_DIMENSION 10.0
#define MAZE_DIMENSION 3

// Adversary defines.
#define ADVERSARY_DIMENSION 1
#define ADVERSARY_MOVETIME 1.0

// Explosion defines.
#define EXPLOSION_EMITTIME 2000
#define EXPLOSION_PARTTIMELOW 500
#define EXPLOSION_PARTTIMEHIGH 600
#define EXPLOSION_TIME (EXPLOSION_EMITTIME+EXPLOSION_PARTTIMEHIGH) 

// Laserbeam defines.
#define LASER_WIDTH 0.05f
#define LASER_LENGTH 100.0f
#define LASER_LIFETIME 300	// Milliseconds the laser will be visible.レーザを見ることができるミリ秒
#define LASER_FLICKTIME 20
#define LASER_OFFSET csVector3(0,-.5f,0)

// Movement defines. 移動の定義
#define MOVE_DISTANCE 5.0	// In one keypress we will move this far. 一度キーを入力すると動く距離
#define STEP_DISTANCE 1.0	// Step size for collision detection along path. パスに沿ってコリジョン衝突をするためのステップサイズ
#define MOVECAMERA_SPEED 5.0	// Speed with which we move the camera. カメラの移動するスピード
#define ROTATE_ANGLE 0.5	// How much we want to rotate in one keypress. 一度の入力で回転する量
#define ROTATECAMERA_SPEED 3.0	// Speed to rotate with. カメラの回転スピード
#define PLAYER_SIZE 2.0

// These numbers define the position of the specific portal
// for the CreateRoom() function.
// これらの数値は、CreateRoom()機能のための特別な入り口を定義します。
#define PORTAL_UP 0
#define PORTAL_DOWN 1
#define PORTAL_LEFT 2
#define PORTAL_RIGHT 3
#define PORTAL_FRONT 4
#define PORTAL_BACK 5