-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upload tonights work. Added in mController (the old frmController.frm
- Loading branch information
Showing
4 changed files
with
173 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
#include<string> | ||
#include<iostream> | ||
#include"GlobalVariables.h" | ||
#include"mFunctions.h" | ||
#include"mMoveCharacters.h" | ||
#include"mController.h" | ||
|
||
bool UnLoadMe{ false }; | ||
|
||
void mController_Show() { | ||
MsgBox("Make your move: ", "MsgBox0"); | ||
std::string sNowInput{ "" }; | ||
do | ||
{ | ||
std::cin >> sNowInput; | ||
if (sNowInput=="0") | ||
{ | ||
CommandButton0_Click(); | ||
} | ||
else if (sNowInput == "1") | ||
{ | ||
CommandButton1_Click(); | ||
} | ||
else if (sNowInput == "2") | ||
{ | ||
CommandButton2_Click(); | ||
} | ||
else if (sNowInput == "3") | ||
{ | ||
CommandButton3_Click(); | ||
} | ||
else if (sNowInput == "4") | ||
{ | ||
CommandButton4_Click(); | ||
} | ||
else if (sNowInput == "5") | ||
{ | ||
CommandButton5_Click(); | ||
} | ||
else if (sNowInput == "6") | ||
{ | ||
CommandButton6_Click(); | ||
} | ||
else if (sNowInput == "7") | ||
{ | ||
CommandButton7_Click(); | ||
} | ||
else if (sNowInput == "8") | ||
{ | ||
CommandButton8_Click(); | ||
} | ||
else if (sNowInput == "9") | ||
{ | ||
CommandButton9_Click(); | ||
} | ||
else if (sNowInput == "q" || sNowInput == "x") | ||
{ | ||
CommandButtonExit_Click(); | ||
} | ||
else | ||
{ | ||
//do nothing | ||
MsgBox("I don't understand.", "MsgBox0"); | ||
} | ||
} while (UnLoadMe==false); | ||
} | ||
|
||
|
||
|
||
void CommandButton0_Click() { | ||
int iRow{ ((rand() % iMazeRows) + 1) - cActivePlayer.Row }; | ||
int iColumn{ ((rand() % iMazeCols) + 1) - cActivePlayer.Column }; | ||
MsgBox("Super Jump!!!", "MsgBox0"); | ||
MovePlayer(iRow, iColumn); | ||
MoveInterceptors; | ||
WhoIsAlive(); | ||
} | ||
|
||
void CommandButton1_Click(){ | ||
MovePlayer(1, -1); | ||
MoveInterceptors; | ||
WhoIsAlive(); | ||
} | ||
|
||
void CommandButton2_Click() { | ||
MovePlayer(1, 0); | ||
MoveInterceptors; | ||
WhoIsAlive; | ||
} | ||
|
||
void CommandButton3_Click() { | ||
MovePlayer(1, 1); | ||
MoveInterceptors; | ||
WhoIsAlive; | ||
} | ||
|
||
void CommandButton4_Click() { | ||
MovePlayer(0, -1); | ||
MoveInterceptors; | ||
WhoIsAlive; | ||
} | ||
|
||
void CommandButton5_Click() { | ||
MovePlayer(0, 0); | ||
MoveInterceptors; | ||
WhoIsAlive; | ||
} | ||
|
||
void CommandButton6_Click() { | ||
MovePlayer(0, 1); | ||
MoveInterceptors; | ||
WhoIsAlive; | ||
} | ||
|
||
void CommandButton7_Click() { | ||
MovePlayer(-1, -1); | ||
MoveInterceptors; | ||
WhoIsAlive; | ||
} | ||
|
||
void CommandButton8_Click() { | ||
MovePlayer(-1, 0); | ||
MoveInterceptors; | ||
WhoIsAlive; | ||
} | ||
|
||
void CommandButton9_Click() { | ||
MovePlayer(-1, 1); | ||
MoveInterceptors; | ||
WhoIsAlive; | ||
} | ||
|
||
void CommandButtonExit_Click(){ | ||
//Call Unload(Me) | ||
UnLoadMe = true; | ||
} | ||
|
||
void WhoIsAlive(){ | ||
|
||
if (cActivePlayer.Alive == false) { | ||
MsgBox("You are dead. You lose.", "nMsgbox2"); | ||
//Call Unload(Me) | ||
UnLoadMe = true; | ||
} | ||
else if (CheckInterceptorsAlive() == false) { | ||
MsgBox("All the interceptors are dead. You win.", "nMsgbox2"); | ||
//Call Unload(Me) | ||
UnLoadMe = true; | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
#ifndef mController_H | ||
#define mController_H | ||
void mController_Show(); | ||
void CommandButton0_Click(); | ||
void CommandButton1_Click(); | ||
void CommandButton2_Click(); | ||
void CommandButton3_Click(); | ||
void CommandButton4_Click(); | ||
void CommandButton5_Click(); | ||
void CommandButton6_Click(); | ||
void CommandButton7_Click(); | ||
void CommandButton8_Click(); | ||
void CommandButton9_Click(); | ||
void CommandButtonExit_Click(); | ||
void WhoIsAlive(); | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters