Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jiahan Cao
Aircraft-Battle
Commits
cf5c1bd7
Commit
cf5c1bd7
authored
May 29, 2019
by
CjhGm
Browse files
TODO: destroy enemy
parent
ca62fce8
Changes
3
Hide whitespace changes
Inline
Side-by-side
PlaneWar-MFC/PlaneWar/PlaneWarView.cpp
View file @
cf5c1bd7
...
...
@@ -370,7 +370,7 @@ void CPlaneWarView::OnLButtonDown(UINT nFlags, CPoint point)
isStarted
=
TRUE
;
}
else
if
(
myplane
!=
NULL
)
{
// 按
空格
键发射子弹
// 按
鼠标左
键发射子弹
CBullet
*
bullet
=
new
CBullet
(
myplane
->
GetPoint
().
x
+
PLANE_WIDTH
/
2
-
BULLET_WIDTH
/
2
,
myplane
->
GetPoint
().
y
);
bulletList
.
AddTail
(
bullet
);
}
...
...
@@ -381,7 +381,10 @@ void CPlaneWarView::OnLButtonDown(UINT nFlags, CPoint point)
//鼠标右键监听
void
CPlaneWarView
::
OnRButtonUp
(
UINT
/* nFlags */
,
CPoint
point
)
{
// MyTODO
if
(
isStarted
==
TRUE
&&
myplane
!=
NULL
)
{
// 按鼠标右键发射炮弹
// MyTODO
}
}
//生命周期
...
...
PlaneWar-MFC/PlaneWar/Scene.cpp
View file @
cf5c1bd7
...
...
@@ -12,10 +12,6 @@ CScene::~CScene(void)
//初始化场景
bool
CScene
::
InitScene
()
{
/*this->images[0].Load(L"image\\background1.bmp");
this->images[1].Load(L"image\\background2.bmp");
this->images[2].Load(L"image\\background3.bmp");
*/
//加载开始图片
this
->
images
[
0
].
Load
(
_T
(
"image
\\
start.bmp"
));
CString
str
;
...
...
@@ -28,7 +24,7 @@ bool CScene::InitScene()
}
//开始为真, 背景起始坐标为0
this
->
isStart
=
true
;
this
->
isStart
=
TRUE
;
this
->
beginY
=
0
;
//播放背景音乐
...
...
@@ -53,7 +49,7 @@ void CScene::StickScene(CDC* pDC,int index, CRect rClient)
beginY
=
0
;
if
(
isStart
)
isStart
=
false
;
isStart
=
FALSE
;
}
//客户区高度
...
...
PlaneWar-MFC/PlaneWar/Scene.h
View file @
cf5c1bd7
...
...
@@ -11,7 +11,7 @@ private:
CImage
images
[
8
];
//滚动背景,0位为开始图片,1-7为七张不同的背景
int
beginY
;
//背景的Y坐标
bool
isStart
;
//是否开始
BOOL
isStart
;
//是否开始
//成员函数
public:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment