flash - ROCK-PAPER-SCISSORS ActionScript 3.0 -


I am making a rock paper scissor game. This is what I have so far. I am having problems with the function. Make sure disable I'm trying to get results to return the result of the computer to rock, paper or scissors I random number (), 1, 2 or 3 not. I really appreciate your help. This is my code:

  btnPlay.addEventListener (MouseEvent.CLICK, playGame); BtnNewGame.addEventListener (MouseEvent.CLICK, newGame); Var Relationship: int = 0; Var wins: int = 0; Var loss: int = 0; Function Play Game (E: Mouse Event): Zero {var userThrow: int; Var ComputerTro: Int. Var Results: string; UserThrow = int (radRock.group.selectedData); ComputerThrow = Random Number (3,1); Result = Determine Disabled (Userre, ComputerTro); LblOutcome.text = Results; LblScore.text = "wins:" + live .stustring () + "loss:" + loss .string (+) "relationship:" + relationship String (); } Function newGame (e: MouseEvent): Zero {//} Function Random WholeNumber (highNumber: int, lowNumber: int): int {return Math.floor ((highNumber - lowNumber + 1) * Math.random () + lowNumber); } Define the function translation (U: int, c: et): string {if (u == 2 and ac == 1} {return "the computer threw a rock and covered your paper.} And if (u == 3 & amp; amp; amp; c == 2) {Return "The computer threw the paper and your scissor cut the paper. You Win! "} And if (U == 1 & amp; amp; c == 3) {Return" The computer threw the scissor and your rock wiped it. You Win! "} And if (u == C) {return" you tied to the computer "} and if (u == 1 & amp; amp; amp; c = c == 2) {return "You threw a rock and covered the computer paper. Lose: ("}" and if (u == 2 & amp; amp; c == 3) {return "You threw the paper and the computer scissor cut your paper, you lose :("} and If you (U == 3 & amp; Amp; C == 1) "back" you threw a scissor and the computer's rock wiped it. "" Itemprop = "text"> 

This function returns a compiler error Throw it because it does not return a value by default. I mean that there is no return statement outside the conditional. You always have a return statement Mr. Require did not match any circumstances out of position. In the end, just "tap" back lands; or withdrawal;

Comments

Popular posts from this blog

c# - Textbox not clickable but editable -

Matlab transpose a table vector -

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -