⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 def.h

📁 一个3D的保龄球的源代码
💻 H
字号:
#ifndef __DEF_H__
#define __DEF_H__

#include "..\System\File.h"
#include "res.h"

/** lane width */
#define  LANE_WIDTH							117 

/** lane length */
#define  LANE_LENGTH						2000  //changed to public by Milo

//default positions that player stands
#define  PLAYER_POSITION_X					20 //LANE_WIDTH =117
#define  PLAYER_POSITION_Y					-420 
#define  PLAYER_POSITION_Z					0 //
#define  PLAYER_ROTATION_X					0  
#define  PLAYER_ROTATION_Y					0  
#define  PLAYER_ROTATION_Z					1024

// const variable in CBall
#define  DEFAULT_BALL_RADIUS				12 
#define  DEFAULT_BALL_WEIGHT				14
#define  DEFAULT_DIFFICULT_VELOCITY			1500
#define  DEFAULT_DIFFICULT_ROLLING			1000

// Fastest ball moving time
#define  BALL_MOVMENT_FASTEST_TIME			82// 73 //84
// Mapping from strength to time.
#define  BALL_MOVMENT_TIME_MODIFICATION		6

#define  MAX_VALUE							0x7fffffff

////in tenpin class
/** valid pin */
#define TENPIN_STATE_READY					11
/** standing pin */
#define  TENPIN_STATE_STAND					21
/** Moving pin */
#define  TENPIN_STATE_MOVING				31
/** pin falls and stops moving but not go outside */
#define  TENPIN_STATE_DEAD					41
/** pin falls IN GUTTER */
#define  TENPIN_STATE_GUTTER				51
/** outside pin */
#define  TENPIN_STATE_OUTSIDE				61
/** overlane pin */
#define  TENPIN_STATE_OVERLANE				71
/** out of the back */
#define	 TENPIN_STATE_BACK					81
/** OUT OF THE LEFT OR RIGHT SIDE */
#define	 TENPIN_STATE_SIDE_OUT				91



//the sub states in Game playing
#define DS_DELIVERY_INIT										0
#define DS_PLAYER_POSITION_CONFIRM								1
#define DS_GRABBING_TENPIN_ANIM									2
#define DS_CLOSE_SEE_COIN										3
#define DS_PLAYER_POWER_CONFIRM									4
#define DS_AIM_SPOT_CONFIRM										5
//#define DS_PLAYER_ACCURACY_CONFIRM							5
//#define DS_CAMERA_MOVEOUT_ANIM								6
#define DS_ROTATION_POWER_CONFIRM								7
#define DS_PLAYER_FOULS											8
#define DS_BALL_RUNNING											9
#define DS_COLLISION_FINISH										10
#define DS_COLLISION_FINISH_WITH_PLAYER_ANI						11
#define DS_PLAYER_FINISH_ANI									12
#define DS_SHOW_GRABBING_ANIMATION								13
#define DS_SHOW_GRABBING_ANIMATION_WITH_PLAYER_ANI				14
#define DS_WAITING_TEN_SECOND									15
#define DS_WAITING_FOR_NEXT										16
#define DS_DELIVERY_REPLAY										17
//#define DS_ON_VS_FINISH											18
#define DS_CAMERA_VIEW											19
#define DS_STORY_MATCHEND										20
#define DS_DELIVERY_END											21
#define DS_DELIVERY_SCOREBOARD									22
#define DS_RESULT_ANI											23
#define DS_MATCH_RESULT_SCOREBOARD								24
#define DS_STORY_PRE_TALK										25
//#define DS_TUTORIAL												26
#define DS_PLAYER_FOULS2										27
#define DS_REPUTATION_RESULT									28

/////MATCH TYPE 
#define MATCH_TYPE_FREE						0		// 1 person
#define MATCH_TYPE_VS						1		// 1v1, human vs human or human vs computer
//#define MATCH_TYPE_STORY					2		// multi vs and multi bonus
#define MATCH_TYPE_BONUS					3		// for spare special


const int HINT_SHOWING_LENGTH = 24;

#define BOARD_COLOR							0XF2AB22		
#define LINE_COLOR							0XF2AB22


//RENDER ELEMENTS IN SCENE
//O-9 IS FOR PINS 
#define  RENDER_BALL						10
//#define  RENDER_AIM_SPOT					11
#define  RENDER_FLOOR						11
#define  RENDER_SCENE						12
#define  RENDER_GRABBING_TENPIN			 	13
#define  RENDER_SETTING_TENPIN			 	14
#define  RENDER_SKYBOX						15
#define  RENDER_PLAYER						16
//#define  RENDER_LIGHT						17
//#define  RENDER_HANDS						17
#define  RENDER_FIRST_AUDIENCE				17
#define  RENDER_SECOND_AUDIENCE				18
#define  RENDER_THIRD_AUDIENCE				19
//#define  RENDER_FORTH_AUDIENCE				21
//#define  RENDER_FIFTH_AUDIENCE				22
#define  RENDER_FREEZE_AUDIENCE				20
#define  RENDER_COIN						21	// coin has 4 objects with 1 model
#define  RENDER_FURNITURE					22
#define  RENDER_PLAYER2						23
#define  RENDER_TV							24
#define  RENDER_COUNTS						25
//MODEL INDEX

#define COINS_COUNT						4

//#define  MODEL_BACKGROUND					0
#define  MODEL_TENPIN						0
//#define  MODEL_BALL							2
//#define  MODEL_PLAYER						3
//#define  MODEL_ARROW						1
//#define  MODEL_FLOOR						5
#define  MODEL_GRBBING						14
#define  MODEL_SETTING_PINS					15
#define  MODEL_2D_TENPIN					17
#define  MODEL_AUD1							19
#define  MODEL_AUD2							20
#define  MODEL_AUD3							21
#define  MODEL_COIN							22
#define  MODEL_FREEZE_AUD					26
#define  MODEL_FURNITURE					29 // Milo 01-17
#define  MODEL_TV							30 // Milo 02-24

//in CScene Class
/**
* <p>The constant's one bit stands for one bowling pin's status,
* setting 1 measns the pin is stand,
* setting 0 means the pin is falled.
* From left to right stands for #9 pin to #0 pin. </p>
*
* <p>So constant (ALL_PINS_STAND) 0x3ff stands for ten pins are all stand
* and constant (ALL_PINS_FALL) 0x0 stands none pin is stand.</p>
*/
#define  ALL_TENPINS_STAND					0x3ff// 0...0 1111111111
/**
* Constant stands for all pins are falled.
*
* ALL_PINS_STAND
*/
#define  ALL_TENPINS_FALL					0x0 // 0...0 0000000000

/** lane width */
#define TOTAL_TENPIN_NUMBER					10

/** distance between two pins nearby */
#define  PIN_DISTANCE						32 

/** lane data on heavy oil area */
#define  HEAVY_OIL_AREA						500 

/** lane data on light oil area */
#define  LIGHT_OIL_AREA						1000 

//friction modulus
/** friction modulus on light oil area */
#define  LFRICTION_MODULUS					2

/** friction modulus on unoil area */
#define  UFRICTION_MODULUS					2

//the reducing velocity of ball in gutter
#define  GUTTER_REDUCTION					70

#define  MAX_PLAYER_ROTATION				9

//in Player CLASS   
#define	 PLAYER_ANI_THROWING								0
#define	 PLAYER_ANI_CHEER1									1
#define  PLAYER_ANI_CHEER2									2
#define	 PLAYER_ANI_DEPRESSION1								3
#define	 PLAYER_ANI_DEPRESSION2								4
#define	 PLAYER_ANI_FOULS									5
#define	 PLAYER_ANI_FOR_SELECT								6
#define	 PLAYER_ANI_LEFT_MOVING								7
#define	 PLAYER_ANI_BREATH									8
#define	 PLAYER_ANI_RIGHT_MOVING							9
#define	 PLAYER_ANI_TALKING									10
#define	 PLAYER_ANI_FOUL_THROW								11
#define	 PLAYER_ANI_FOULS2									12
#define	 PLAYER_ANI_COUNT									13

//state of ball
#define  BALL_INVALID						0x00
#define  BALL_ONLANE						0x01
#define  BALL_OUTSIDE						0x02 //OUTSIDE

//Types of Ball
/** linear ball */
#define  LINEAR_BALL						0x00
/** curve ball */
#define  CURVE_BALL							0x03

#define ConvertSoundID(a)					(a - ID_SOUND_ROLL)


typedef struct _ScoreInfo
{
  /** Record the scores */
  Byte scores[21];
  /** The total scores.*/
  int totalScores[11];
  /** To record which one delivery score in the game. */
  int iScores;
  /** Need to add spare score flag. */
  bool addSpareScore;
  /** Need to add strike score flag. */
  bool addStrikeScore;
  /** Strike count. */
  int strikeCount; /** Construct the class  */
  /** To record has trun how many pages . Less than 0 is trun back, large than 0 is trun forward.*/
  int trunPageNum;  
  //this variable decides whether the second ball will be used. true: don't need or has been used
  bool m_isSecondBall;
  //Judging whether the round is strike
  bool m_isStrike;
   //Judging whether the round is strike
  bool m_isTurkey;
  //judging whether the first shot in the 10th round is strike
  int m_isBonusShot;
  //off set for Score Board
  int m_offSet;
  bool m_isScoreBoardChanged ;
  int preciseScore;
  int extraCount;
  int extraScore;
  
}ScoreInfo;


#endif	/* __DEF_H__ */	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -