several changes here,

first, i added a timer to hide the big card after 5 secs or until a movement is registered. 

2nd, removed the advancing of phases with flick up.

3rd added a flick left to "show/hide hand"

4th, fixed an error in the logic of "getDifficulty" part of the reason optimizedhand was not working.

finally, unrefactored the checks of optimized hand, it was FAR to difficult to see what was actually happening the way it was coded.

optimizedhand is finally working again, 
toggledifficulty and optimizedhand will again trigger and greatly improve ai vs player matches
This commit is contained in:
omegablast2002@yahoo.com
2013-02-21 00:48:39 +00:00
parent 2330e6a613
commit 9a52ae28a2
7 changed files with 78 additions and 31 deletions

View File

@@ -176,7 +176,7 @@ bool CardSelector::CheckUserInput(JButton key)
return true;
}
Target* oldactive = active;
timer = 250;
int x,y;
JGE* jge = observer->getInput();
if(!jge) return false;
@@ -304,6 +304,10 @@ switch_active:
if (active)
active->Entering();
}
else
{
timer = 250;
}
return true;
}
@@ -319,6 +323,13 @@ void CardSelector::Update(float dt)
position = CardGui::BigWidth / 2;
bigpos.x = position;
bigpos.Update(dt);
//what i really wanted for this was when you remove your finger from the screen or the pointer of your mouse from the screen area
//i wanted it to reduce the show timer to 0, which keeps the big image from displaying.
//couldn't find a method to check if the finger was still touching the screen that wouldn't break mouse support.
//so instead regitering movement resets the timer, which is set to display for about 5 secs;
//if it gets too annoying we can increase or remove this.
if(timer > 0)
timer -= 1;
}
void CardSelector::Render()
@@ -326,9 +337,10 @@ void CardSelector::Render()
if (active)
{
active->Render();
if (CardView* card = dynamic_cast<CardView*>(active))
if (CardView* card = dynamic_cast<CardView*>(active) )
{
card->DrawCard(bigpos, mDrawMode);
if(timer > 0)
card->DrawCard(bigpos, mDrawMode);
}
}
}