Skip to content

Instantly share code, notes, and snippets.

@jankeesvw
Created May 15, 2010 13:21
Show Gist options
  • Save jankeesvw/402189 to your computer and use it in GitHub Desktop.
Save jankeesvw/402189 to your computer and use it in GitHub Desktop.
private function getWinner():String {
var to:String = String(_battleData.strategy_to[_currentVideoNumber]).charAt(0);
var from:String = String(_battleData.strategy_from[_currentVideoNumber]).charAt(0);
var result:String = "";
if(from == "r") from = "l";
if(from == "l") from = "r";
if(_currentVideoNumber + 1 < 4) {
// 1 2 en 3
if(to == from) {
result = "to";
} else {
result = "from";
}
} else {
// 4 5 en 6
if(to == from) {
result = "from";
} else {
result = "to";
}
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment