What kind of comments do you want I have none whatsoever XD
------------------------------------------=====EDIT=======------------------------------------------------
Il post some anyway though jast ask if you want comments
Code: Select all
//This classes refresh function.//
void refresh()
{
RTSFunctions RTSFUNC;
cout<<"A 'fedships' 'refresh' Function Has Been Called.";
cout<<endl;
cout<<"The 'fgotox' Varible Inside A Instance Of 'fedship' Is Currently ";
cout<<*fgotoxp;
cout<<endl;
cout<<"The 'fgotoy' Varible Inside A Instance Of 'fedship' Is Currently ";
cout<<*fgotoyp;
cout<<endl;
float hs = 32;
RTSFUNC.RTSLeftClickCheck(*selecp, FSS, FSS.GetPosition().x, FSS.GetPosition().y, 0, hs, /*App,*/ ca.getcup().getcannotp(), false, *IDP, ca.getcup().getCSIp());
if(*selecp == true)
{
ca.getcup().getcannotp() = true;
}
cout<<"A Instance Of 'fedship''s Varible '*selecp' Is Currently "<<*selecp<<endl;
RTSFUNC.RTSSelect(*selecp, *IDP, ca.getcup().getCSIp(), *alivefsp);
cout<<"A Instance Of 'fedship''s Varible '*selecp' Is Currently "<<*selecp<<endl;
cout<<"A Instances Of 'fedship''s '*rightclkp' Varible Is Currently "<<*rightclkp<<endl;
cout<<"A Instances Of 'fedship''s '*alivefsp' Varible Is Currently "<<*alivefsp<<endl;
cout<<"Java FAILS In Comparison To C++! Mac OS(Any Version) Fails To Windows(Of Any Version)!"<<endl;
OnInput INPUT;
if(*selecp == true)
{
INPUT.OfRightClick(ca.getcup().getCursorS().GetPosition().x, ca.getcup().getCursorS().GetPosition().y, 0, *fgotoxp, *fgotoyp, 0);
}
RTSFUNC.TriggerMoveToPoint(*selecp, *alivefsp, *rightclkp, *IDP, ca.getcup().getCSIp());
RTSFUNC.RTSDestinationSetVectorCalculationAndMovement(*rightclkp, blaa, *IDP, ca.getcup().getCSIp(), *fgotoxp, *fgotoyp, *selecp, FSS, *fmovetp, *moveiskp, *alivefsp, *dirxp3, *diryp3, 0, *speedap, *calcdonep);
if(*rightclkp == false)
{
ca.getcup().getcannotp() = false;
}
//Uuuh dont even bother with this pice of code it's fine but annioing.//
float THEX = FSS.GetPosition().x;
float THEY = FSS.GetPosition().y;
///////////////// RTSFUNC.Move(*selecp, THEX, THEY, 32, *fgotoxp, *fgotoyp, true, *fpointa, *moveiskp, *paiaxp, *fspawnedp, true, FSS, true, 2);
if(getfpointap() != getfpointaap() && getdontdothat1() == false)
{
float fpointastuff();
}
if(*alivefsp == true && *inbattlep == true)
{
App.Draw(FSS);
std::cout<<"Render Complete."<<endl;
}
//So this only works if there is a battle screen open.//
cout<<"A Instance Of 'fedship's' 'x' Coordinate Is "<<FSS.GetPosition().x<<endl;
cout<<"A Instance Of 'fedship's' 'y' Coordinate Is "<<FSS.GetPosition().y<<endl;
cout<<"A Instance Of 'fedship's' 'rightclk' Varible Is "<<getrightclkp()<<endl;
cout<<"A Instance Of 'fedship's' 'IDP' Varible Is Currently "<<*IDP<<endl;
cout<<"---------------------------==========================-----------------------"<<endl;
}
This is the begining of the class that has this function
Code: Select all
class fedship : public VeiwableB//The diffrence between VeiwableA and VeiwableB is that VeiwableB inherits From ObjectFunctions.//
This is my "object functions".
Code: Select all
class ObjectFunctions
{
public:
class RTSFunctions
{
public:
int RTSSelect(bool &SelectVar, int &ID, int &MouseIDVar, bool &alive)
{
if(SelectVar == true && alive == true)
{
if(MouseIDVar > 0)
{
return 0;
}
MouseIDVar = ID;
if(ID == MouseIDVar)
{
SelectVar = true;
int C = 0;
int mrr = 10;
while(mrr > C)
{
cout<<"BLARRRG!";
cout<<endl;
cout<<"Imput Recived (Left Click).";
cout<<endl;
C++;
}
}
else
{
SelectVar = false;
}
//Oye Veh!//
}
}
void RTSLeftClickCheck(bool &SelectVar, sf::Sprite &A,const float &SpriteCenterX,const float &SpriteCenterY, float SpriteCenterZ, float &SpriteHalfSize/*, sf::RenderWindow App*/, bool &Other, bool Value, int &ID1, int &ID2)
{
if(Other == Value && Input::m_Input->IsMouseButtonDown(sf::Mouse::Left) && App.GetInput().GetMouseX() >= A.GetPosition().x - SpriteHalfSize && Input::m_Input->IsMouseButtonDown(sf::Mouse::Left) && App.GetInput().GetMouseX() <= A.GetPosition().x + SpriteHalfSize && Input::m_Input->IsMouseButtonDown(sf::Mouse::Left) || App.GetInput().GetMouseY() >= A.GetPosition().y + SpriteHalfSize && Input::m_Input->IsMouseButtonDown(sf::Mouse::Left) && App.GetInput().GetMouseY() >= A.GetPosition().y - SpriteHalfSize)
{
int C = 0;
while(C < 11)
{
cout<<"A Instance Of 'Veiwable' Has Been Left Cliked On.";
cout<<endl;
C++;
}
ID2 = ID1;
SelectVar = true;
// return &SelectVar;
}
}
void RTSDestinationSetVectorCalculationAndMovement(bool &TheTriggerTRUE, bool &TheTriggerTRUE2, int &ID, int &MouseObjectID, float &WereX, float &WereY, bool &SelectVar, sf::Sprite &A, bool &AuthMove, bool &AuthMoveTRUE2, bool &AliveTRUEInAndCondition, float &MovingX, float &MovingY, float MovingZ, int &Speed, bool &VectorCalculationCompleteVar)
{
bool calcdone = VectorCalculationCompleteVar;
bool *calcdonep = &calcdone;
if(TheTriggerTRUE == true && ID == MouseObjectID && MouseObjectID != 0)
{
//*fgotoyp = App.GetInput().GetMouseY();
//*fgotoxp = App.GetInput().GetMouseX();
// TheTriggerTRUE = false;
SelectVar = false;
AuthMove = true;
//MouseObjectID = 0;
int C = 0;
while(C < 10)
{
cout<<"A Instance Of 'Veiwable' Has Been Triggered To Move.";
cout<<endl;
C++;
}
}
if(A.GetPosition().y != WereY || A.GetPosition().x != WereX)
{
if(AuthMove == true && AliveTRUEInAndCondition == true)
{
//VECTOR FORMULA!!!!!//
int Java = 11;
int C = 0;
while(Java < C)
{
cout<<"'Veiwable' Calculating Vector";
cout<<endl;
C++;
}
// getfgotoxp() += getdirxp() = FSS.GetPosition().x;
// getfgotoyp() += getdiryp() = FSS.GetPosition().y;
MovingY = WereY;
MovingX = WereX;
WereX * MovingX;
WereX * MovingY;
//getdirxp3() += getdiryp3() = getptp();
MovingY / 0;
MovingX / 0;
cout<<"A Instance Of 'Veiwable''s Vector Calculation Has Been Completed.";
cout<<endl;
//AuthMove = false;
//AuthMove = false;
*calcdonep = true;
//getdiryp2() = getfgotoyp();
//getdirxp2() = getfgotoxp();
// *diryp2 -= FSS.GetPosition().y;
// *dirxp2 -= FSS.GetPosition().x;
MovingX -= A.GetPosition().x;
MovingY -= A.GetPosition().y;
}
if(*calcdonep == true && AliveTRUEInAndCondition == true)
{
int C = 0;
while(C < 10)
{
cout<<"A Instance Of 'Veiwable' 'Moveing'.";
cout<<endl;
C++;
}
if(WereX >= A.GetPosition().x && A.GetPosition().x < WereX)
{
// getdirxp3() -= 1;// getdirxp3();
float a;
//a = getfgotoxp();
{
float *geta = &a;
float dis = WereX;
dis -= A.GetPosition().x;
if(dis >= Speed)
{
*geta = Speed;
}
else
{
*geta = 1;
}
}
A.Move(a, 0);
}
if(WereY >= A.GetPosition().y && A.GetPosition().y < WereY)
{
// getdiryp3() -= 1;//getdiryp3();
float a;
{
float *geta = &a;
float dis = WereY;
dis += A.GetPosition().y;
if(dis >= Speed)
{
*geta = Speed;
}
else
{
*geta = 1;
}
}
//a = getfgotoyp();
//a = *speedap;
A.Move(0, a);
}
if(WereX < A.GetPosition().x && A.GetPosition().x > WereX)
{
// getdirxp2() += 1;
float a;
{
float *geta = &a;
float dis = WereX;
dis += A.GetPosition().x;
if(dis <= Speed)
{
*geta = Speed;
}
else
{
*geta = 1;
}
}
//a = getfgotoxp();
//a = *speedap;
A.Move(-a, 0);
}
if(WereY < A.GetPosition().y && A.GetPosition().y > WereY)
{
float a;
// a = getfgotoyp();
{
float *geta = &a;
float dis = Speed;
dis -= A.GetPosition().y;
if(dis >= Speed)
{
*geta = Speed;
}
else
{
*geta = 1;
}
}
// a = *speedap;
A.Move(0, -a);
// getdiryp3() += 1;
}
//FSS.Move(getdirxp3() , getdiryp3());
{
int smib = 10;
int bib = 0;
while(bib != smib)
{
cout<<"A Instance Of 'Veiwable' Moving To Destination"<<endl;
bib += 1;
}
}
if(MovingX >= 1)
{
MovingX -= Speed;// getdirxp3();
}
if(MovingY >= 1)
{
MovingY -= Speed;//getdiryp3();
}
if(MovingX < 0)
{
MovingX += Speed;
}
if(MovingY < 0)
{
MovingY += Speed;
}
if(MovingX == 0 && MovingY == 0) //&& getalivefsp() == true)
{
TheTriggerTRUE2 = false;
AuthMoveTRUE2 = false;
*calcdonep = false;
TheTriggerTRUE = false;
AuthMove = false;
//Reseting varibles.//
cout<<"A Instance Of 'Veiwable' Is Reseting Some Varibles.";
cout<<endl;
MouseObjectID = 0;
//return MouseObjectID;
}
}
}
}
void TriggerMoveToPoint(bool &SelectVarTRUE, bool &AliveTRUE, bool &TriggerTRUE, int &ID, int &MouseID)
{
if(Input::m_Input->IsMouseButtonDown(sf::Mouse::Right) && SelectVarTRUE == true && AliveTRUE == true && ID == MouseID)
{
int C = 0;
while(C < 10)
{
cout<<"Imput Recived (Right Click)";
cout<<endl;
C++;
}
TriggerTRUE = true;
//return TriggerTRUE;
}
}
void Rotate(float &WereX, float &WereY, float &Pointa, bool &OkeyToMove, bool &AtX, bool &WhileVarTrue, bool WhileVarTrueValue,sf::Sprite &A, bool OkeyToMoveValue)
{
if(WhileVarTrue == WhileVarTrueValue)
{
if(WereX > Pointa && AtX == false)
{
Pointa += 1;
}
if(WereX < Pointa && AtX == false)
{
Pointa -= 1;
}
if(Pointa == WereX && AtX == false)
{
AtX == true;
}
if(AtX == true)
{
if(WereY > Pointa)
{
A.Rotate(-1);
}
if(WereY < Pointa)
{
A.Rotate(1);
}
if(Pointa == WereY)
{
bool b = WhileVarTrue;
if(b == true)
{
WhileVarTrue = false;
}
if(b == false)
{
WhileVarTrue = true;
}
OkeyToMove = OkeyToMoveValue;
}
}
}
}
void Move(bool &GotoOrSelect, float &CenterX, float &CenterY, float SpriteHalfSize, float &WereX, float &WereY, bool GotoOrSelectValue,float &Pointa, bool &OkeyToMove, bool &AtX, bool &WhileVarTrue, bool WhileVarTrueValue,sf::Sprite &A, bool OkeyToMoveValue, int Speed)
{
if(WhileVarTrue == WhileVarTrueValue)
{
if(WereX > Pointa && AtX == false)
{
Pointa += 1;
}
if(WereX < Pointa && AtX == false)
{
Pointa -= 1;
}
if(Pointa == WereX && AtX == false)
{
AtX == true;
}
if(AtX == true)
{
if(WereY > Pointa)
{
A.Rotate(-1);
}
if(WereY < Pointa)
{
A.Rotate(1);
}
if(Pointa == WereY)
{
bool b = WhileVarTrue;
if(b == true)
{
WhileVarTrue = false;
}
if(b == false)
{
WhileVarTrue = true;
}
OkeyToMove = OkeyToMoveValue;
}
}
}
if(OkeyToMove == OkeyToMoveValue && GotoOrSelect == GotoOrSelectValue)
{
if(CenterX > WereX)
{
CenterX -= Speed;
}
if(CenterX < WereX)
{
CenterX += Speed;
}
if(CenterY > WereY)
{
CenterY += Speed;
}
if(CenterX < WereX)
{
CenterY -= Speed;
}
if(CenterX == WereX && CenterY == WereY)
{
bool a, b;
a = OkeyToMoveValue;
if(a == true)
{
a = false;
}
if(a == false)
{
a = true;
}
b = GotoOrSelectValue;
if(b == true)
{
b = false;
}
if(b == false)
{
b = true;
}
}
}
if(GotoOrSelect != GotoOrSelectValue)
{
if(Input::m_Input->IsMouseButtonDown(sf::Mouse::Left) && App.GetInput().GetMouseX() >= A.GetPosition().x - SpriteHalfSize && Input::m_Input->IsMouseButtonDown(sf::Mouse::Left) && App.GetInput().GetMouseX() <= A.GetPosition().x + SpriteHalfSize || Input::m_Input->IsMouseButtonDown(sf::Mouse::Left) && App.GetInput().GetMouseY() >= A.GetPosition().y - SpriteHalfSize && Input::m_Input->IsMouseButtonDown(sf::Mouse::Left) && App.GetInput().GetMouseY() >= A.GetPosition().y + SpriteHalfSize) //I think this may be my problem right here Iim playing around wiht it.//
{
GotoOrSelect == GotoOrSelectValue;
}
}
}
};
class OverHeadShooterFucntions
{
public:
};
class OnInput
{
public:
void OfRightClick(float SetX, float SetY, float SetZ, float &x, float &y, float z)
{
x = SetX;
y = SetY;
z = SetZ;
}
};
};