You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

GameData.cs 4.3 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using Preparation.Utility;
  2. namespace Preparation.GameData
  3. {
  4. public static class GameData
  5. {
  6. #region 基本常数与常方法
  7. public const int numOfPosGridPerCell = 1000; // 每格的【坐标单位】数
  8. public const int numOfStepPerSecond = 20; // 每秒行走的步数
  9. public const int lengthOfMap = 50000; // 地图长度
  10. public const int rows = 50; // 行数
  11. public const int cols = 50; // 列数
  12. public const long gameDuration = 600000; // 游戏时长600000ms = 10min
  13. public const long frameDuration = 50; // 每帧时长
  14. public const int MinSpeed = 1; // 最小速度
  15. public const int MaxSpeed = int.MaxValue; // 最大速度
  16. public static XY GetCellCenterPos(int x, int y) // 求格子的中心坐标
  17. {
  18. XY ret = new((x * numOfPosGridPerCell) + (numOfPosGridPerCell / 2), (y * numOfPosGridPerCell) + (numOfPosGridPerCell / 2));
  19. return ret;
  20. }
  21. public static int PosGridToCellX(XY pos) // 求坐标所在的格子的x坐标
  22. {
  23. return pos.x / numOfPosGridPerCell;
  24. }
  25. public static int PosGridToCellY(XY pos) // 求坐标所在的格子的y坐标
  26. {
  27. return pos.y / numOfPosGridPerCell;
  28. }
  29. public static bool IsInTheSameCell(XY pos1, XY pos2)
  30. {
  31. return PosGridToCellX(pos1) == PosGridToCellX(pos2) && PosGridToCellY(pos1) == PosGridToCellY(pos2);
  32. }
  33. public static int numOfBirthPoint = 5;
  34. #endregion
  35. #region 角色相关
  36. /// <summary>
  37. /// 玩家相关
  38. /// </summary>
  39. public const int characterRadius = numOfPosGridPerCell / 2; // 人物半径
  40. public const int basicAp = 3000; // 初始攻击力
  41. public const int basicHp = 6000; // 初始血量
  42. public const int basicCD = 3000; // 初始子弹冷却
  43. public const int basicBulletNum = 3; // 基本初始子弹量
  44. public const int MinAP = 0; // 最小攻击力
  45. public const int MaxAP = int.MaxValue; // 最大攻击力
  46. public const double basicAttackRange = 9000; // 基本攻击范围
  47. public const double basicBulletBombRange = 3000; // 基本子弹爆炸范围
  48. public const int basicMoveSpeed = 3000; // 基本移动速度,单位:s-1
  49. public const int basicBulletMoveSpeed = 3000; // 基本子弹移动速度,单位:s-1
  50. public const int characterMaxSpeed = 12000; // 最大速度
  51. public const int addScoreWhenKillOneLevelPlayer = 30; // 击杀一级角色获得的加分
  52. public const int commonSkillCD = 30000; // 普通技能标准冷却时间
  53. public const int commonSkillTime = 10000; // 普通技能标准持续时间
  54. public const int bulletRadius = 200; // 默认子弹半径
  55. public const int reviveTime = 30000; // 复活时间
  56. public const int shieldTimeAtBirth = 3000; // 复活时的护盾时间
  57. public const int gemToScore = 4; // 一个宝石的标准加分
  58. /// <summary>
  59. /// 道具相关
  60. /// </summary>
  61. public const int MinPropTypeNum = 1;
  62. public const int MaxPropTypeNum = 10;
  63. public const int PropRadius = numOfPosGridPerCell / 2;
  64. public const int PropMoveSpeed = 3000;
  65. public const int PropMaxMoveDistance = 15 * numOfPosGridPerCell;
  66. public const int MaxGemSize = 5; // 随机生成的宝石最大size
  67. public const long GemProduceTime = 10000;
  68. public const long PropProduceTime = 10000;
  69. public const int PropDuration = 10000;
  70. #endregion
  71. #region 游戏帧相关
  72. public const long checkInterval = 50; // 检查位置标志、补充子弹的帧时长
  73. #endregion
  74. }
  75. }