-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmove&shoot.cpp
More file actions
51 lines (37 loc) · 929 Bytes
/
move&shoot.cpp
File metadata and controls
51 lines (37 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "enemy.h"
#include"bullet.h"
#include"fly.h"
#include<QPixmap>
#include<config.h>
#include<bullet.h>
void move_enemy1(){
d++;
for(int i=shoot_temp;i<MAX_SHOOT;++i){
e_b[i]->x=x;e_b[i]->y=y;
}
if(xleft()<-Width||xright()>GM_WIDTH+Width||yup()<-Height||ydown()>GM_HEIGHT+Height){
Health=0;
}
}
void shoot(){
++nowCD;
if(nowCD<CD){
return;
}
nowCD=0;
if(shoot_temp<MAX_SHOOT-1){
e_b[shoot_temp].xspeed=((shoot_temp%3)-1)*3;//shoot模式 周期化改变子弹xspeed达到多方向shoot效果
e_b[shoot_temp++]->Health=(1<<22);
}
}
void shoot(){
++nowCD;
if(nowCD<CD){
return;
}
nowCD=0;
if(shoot_temp<MAX_SHOOT-1){
e_b[shoot_temp].xspeed=((shoot_temp%3)-1)*3;//shoot模式 周期化改变子弹xspeed达到多方向shoot效果
e_b[shoot_temp++]->Health=(1<<22);
}
}