ShootPlane.cpp
上传用户:semy2100
上传日期:2013-01-22
资源大小:3633k
文件大小:2k
源码类别:

射击游戏

开发平台:

Visual C++

  1. /********************************************************************
  2. *                        空运爆发                                    *
  3. *                       Version 2.0                                  *
  4. * 本游戏全部代码由:                                                 *
  5. *                   冲天实验室   梁锋 编写                           *
  6. *                    邮箱:lenwine@126.com                           *
  7. *                bbs: http://free2.e-168.cn/lenwind (正在开发中...)  *
  8. **********************************************************************/
  9. #include "stdafx.h"
  10. int ShootPlane::i=0;
  11. ShootPlane::ShootPlane(Manager *mgr,int xv,int yv):MemberStatus(mgr,xv,yv)
  12. {
  13. EndShoot=0;
  14. blow_up_value=8*4;
  15. blow_up_current=-1;
  16. }
  17. void ShootPlane::Update()
  18. {
  19. MemberStatus::Update();
  20. if(Shooting)
  21. Shoot();
  22. if(alive<=0)//这里是爆炸贞
  23. {
  24. if(++blow_up_current==0)
  25. {
  26. x+=Bitlong/2-82;
  27. y+=Bittall/2-73;
  28. Bitlong=180;
  29. Bittall=135;
  30. spx=0;
  31. spy=0;
  32. bx=0;
  33. by=115;
  34. Shooting=false;
  35. }
  36. else if(blow_up_current==blow_up_value)
  37. Work=false;
  38. else
  39. {
  40. bx=180*(blow_up_current/4%4);
  41. by=115+135*(blow_up_current/4/4);
  42. }
  43. }
  44. }
  45. void ShootPlane::Update2()
  46. {
  47. MemberStatus::Update2();
  48. if(Shooting)
  49. Shoot();
  50. if(alive2<=0)//这里是爆炸贞
  51. {
  52. if(++blow_up_current==0)
  53. {
  54. x+=Bitlong/2-82;
  55. y+=Bittall/2-73;
  56. Bitlong=180;
  57. Bittall=135;
  58. spx=0;
  59. spy=0;
  60. bx=0;
  61. by=115;
  62. Shooting=false;
  63. }
  64. else if(blow_up_current==blow_up_value)
  65. Work=false;
  66. else
  67. {
  68. bx=180*(blow_up_current/4%4);
  69. by=115+135*(blow_up_current/4/4);
  70. }
  71. }
  72. }
  73. void ShootPlane::beginShoot()
  74. {
  75. Shooting=true;
  76. }
  77. void ShootPlane::stopShoot()
  78. {
  79. Shooting=false;
  80. }
  81. void ShootPlane::SetEndShoot()
  82. {
  83. EndShoot=mManager->Time-rand()%Bomb::GetShoot(bombStyle);
  84. }
  85. ShootPlane::~ShootPlane()
  86. {
  87. }