Blackberry Messenger Manual de usuario Pagina 10

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 11
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 9
http://cmer.uoguelph.ca 10
if(triesCounter%5==0)
{
var itemText = "Has tried to beat the unbeatable Tic Tac
Toe game "+triesCounter+" times since opening the
application!";
var itemIcon = "local:///exclaim.jpg";
var itemOptions = { text: itemText, icon: itemIcon };
blackberry.bbm.platform.self.profilebox.addItem
(itemOptions);
}
After all the changes, the entire alertWinner function should look like the following.
function alertWinner()
{
//if winner == 1, player X won. If winner == 2, player O won. if winner
== 3, game was tied
if(winner==1)
{
alert("You beat the unbeatable Tic Tac Toe game! Impressive!");
document.getElementById("infomessages").innerHTML = "You beat the
unbeatable Tic Tac Toe game! Impressive!";
var itemText = "Beat the unbeatable Tic Tac Toe game!";
var itemIcon = "local:///thumbsup.jpg";
var itemOptions = { text: itemText, icon: itemIcon };
blackberry.bbm.platform.self.profilebox.addItem(itemOptions);
userWins++;
}
else if(winner==2)
{
alert("You lost the game!");
document.getElementById("infomessages").innerHTML = "You lost the
game!";
var itemText = "Failed to beat the unbeatable Tic Tac Toe game!";
var itemIcon = "local:///thumbsdown.jpg";
var itemOptions = { text: itemText, icon: itemIcon };
blackberry.bbm.platform.self.profilebox.addItem(itemOptions);
userLoses++;
}
else
{
alert("Tie game! Keep trying!");
document.getElementById("infomessages").innerHTML = "Tie game!
Keep trying!";
var itemText = "Was so close to beating the unbeatable Tic Tac Toe
game, but sadly the game was tied!";
var itemIcon = "local:///thumbsdown.jpg";
var itemOptions = { text: itemText, icon: itemIcon };
blackberry.bbm.platform.self.profilebox.addItem(itemOptions);
userTies++;
}
triesCounter++;
gameover = true;
gameInProgress = false;
if(triesCounter%5==0)
{
var itemText = "Has tried to beat the unbeatable Tic Tac Toe game
"+triesCounter+" times since opening the application!";
var itemIcon = "local:///exclaim.jpg";
var itemOptions = { text: itemText, icon: itemIcon };
blackberry.bbm.platform.self.profilebox.addItem(itemOptions);
Vista de pagina 9
1 2 ... 5 6 7 8 9 10 11

Comentarios a estos manuales

Sin comentarios