Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        GameObject moleMan = GameObject.FindWithTag("man");      //Creates an instance of mole manager so that the component spawner can be used
        gamelogic  game    = moleMan.GetComponent <gamelogic>(); //Creates an instance of the spawner script so that score can be accessed

        text.text = "Score: " + game.score;
    }
Esempio n. 2
0
        public static Task SpinRoulette(IOwinContext ctx)
        {
            //if (!Authentication.Check(ctx))
            //{
            //    return ctx.Error(403);
            //}
            var       args = ctx.Parse();
            gamelogic bll  = new gamelogic();
            var       data = JsonConvert.DeserializeObject <RootObject>(args.ToString());

            int amount      = data.must_bet;
            int totalamount = 0;
            int betamount   = 0;

            foreach (var item in data.myArray)
            {
                string bet = item.bet_pos.ToString();
                if (item.bet_pos.GetType() == typeof(JArray))
                {
                    bet = String.Join(",", ((JArray)item.bet_pos).Select(x => (string)x));
                }


                betamount   = betamount + item.coin;
                totalamount = totalamount + bll.WiningLogic(item.coin, bet, data.must_bet);
            }

            var userid = args["userid"].ToString();

            database.Games.UpdateWiningPoints(totalamount, userid);
            return(ctx.JSON(totalamount));
        }
Esempio n. 3
0
    void OnMouseDown()
    {
        GameObject moleMan = GameObject.FindWithTag("man");      //Creates an instance of mole manager so that the component gamelogic can be used
        gamelogic  game    = moleMan.GetComponent <gamelogic>(); //Creates an instance of the gamelogic script so that score can be accessed

        //missed = false;
        poof.GetComponent <enablepoof>().start_anim();

        game.score++;
        whacked = true;


        //Need to override default spawn system and just make a new mole
    }
Esempio n. 4
0
    // Use this for initialization
    void Start()
    {
        previousCube = CubeType.none;
        gameLogicScript = GameObject.Find("GameLogic").GetComponent<gamelogic>();

        if(isAINgram){
            ngramPredictor = new NGramPredictor();
            ngramPredictor.Start();
            ngramPredictor.nValue = NgramWindowSize + 1;
            ngramPredictor.doDebugLogs = doDebugLogs;
            ngramPredictor.playerThisNgramPredictorBelongsTo = this.gameObject.ToString();
        }

        otherPlayerScript = gameLogicScript.returnOtherPlayer(this);
        //track previous actions if other player uses ngrams
        if(otherPlayerScript.isAINgram){
            previousCubePicks = new CubeType[otherPlayerScript.NgramWindowSize + 1];

            for (int i = 0; i < previousCubePicks.Length; i++)
                previousCubePicks[i] = CubeType.none;
        }
    }
Esempio n. 5
0
 // Use this for initialization
 void Start()
 {
     gameLogicScript = GameObject.Find("GameLogic").GetComponent<gamelogic>();
     originalScale=transform.localScale;
 }