Esempio n. 1
0
 //------------------------------------------------AWAKE--------------------------------------
 void Awake()
 {
     if (m_instance == null)
         m_instance = this;
     else
         Destroy(gameObject);
 }
Esempio n. 2
0
        public Bot(string channel, string token, BotSettings botSettings)
        {
            commandManager = new ();
            pointsManager  = new ();
            settings       = botSettings;

            ConnectionCredentials credentials = new ConnectionCredentials(channel, token);
            var clientOptions = new ClientOptions
            {
                MessagesAllowedInPeriod = 750,
                ThrottlingPeriod        = TimeSpan.FromSeconds(1)
            };
            WebSocketClient customClient = new WebSocketClient(clientOptions);

            client = new TwitchClient(customClient);
            client.Initialize(credentials, channel);

            client.OnLog             += Client_OnLog;
            client.OnJoinedChannel   += Client_OnJoinedChannel;
            client.OnMessageReceived += Client_OnMessageReceived;
            client.OnWhisperReceived += Client_OnWhisperReceived;
            client.OnNewSubscriber   += Client_OnNewSubscriber;
            client.OnConnected       += Client_OnConnected;

            client.Connect();
        }
Esempio n. 3
0
    /*
     * Sets the value for dead to true
     * Gets the ZombieFSM and calls the Die method on it
     * Increase the points by the zombies point value
     * Andre Redid the die method so that it fits the boss.
     */
    void Die()
    {
        dead = true;
        Debug.Log("isDead");
        //  checks if the boss is dead
        if (isBoss)
        {
            Debug.Log("bossisDead");
            PointsManager.AddPoint(pointsValue * 10);                                                            // Add boss points

            SurvivalInstint.AddPoints();                                                                         // Add skill points
            GameObject.FindGameObjectWithTag("Vic").gameObject.transform.GetChild(0).gameObject.SetActive(true); // Display victory sign
        }
        else
        {
            PointsManager.AddPoint(pointsValue);

            GetComponent <ZombieFSM>().Die();
        }

        animator.SetTrigger("isDead");
        Debug.Log("animationisDead");
        Debug.Log("Destroy");
        Destroy(this.gameObject, 0.5f);
    }
Esempio n. 4
0
    public static void getPoints()
    {
        count = ScoreSystem.getPoints();

        points.text = count;
        PointsManager.setPoints(count);
    }
    public override void OnInspectorGUI()
    {
        _base = (PointsManager)target;

        if (GUILayout.Button("Create Points"))
        {
            _base.OnButtonClick();
            SceneView.RepaintAll();
        }

        if (GUILayout.Button("UpdateHull"))
        {
            _base.OnUpdateHull();
            SceneView.RepaintAll();
        }

        if (GUILayout.Button("Triangulation"))
        {
            _base.OnTriangulate();
            SceneView.RepaintAll();
        }

        if (GUILayout.Button("CheckDelaunayValidity"))
        {
            _base.CheckDelaunayValidity();
            SceneView.RepaintAll();
        }

        base.OnInspectorGUI();
    }
Esempio n. 6
0
        public override void LoadContent()
        {
            CurrGame     = (PathDefenceGame)ScreenManager.Game;
            LevelManager = new LevelManager(CurrGame, this, levelName);
            LevelManager.Initialize();
            WaveManager = new WaveManager(CurrGame, this, levelName);
            WaveManager.Initialize();
            Background = new BackgroundGamePlayScreen(CurrGame, levelName);
            Background.Initialize();
            TowerManager = new TowerManager(CurrGame, this);
            TowerManager.Initialize();
            MoneyManager = new MoneyManager(CurrGame, this);
            MoneyManager.Initialize();
            LiveManager = new LiveManager(CurrGame, this);
            LiveManager.Initialize();
            PointsManager = new PointsManager();
            PointsManager.Initialize();

            GuiManager = new GuiManager(CurrGame, this);
            GuiManager.Initialize();
            CreepDeleteList.AddRange(CreepList);

            AddCreepList.Clear();

            CreepTimer.Start();

            gameState = EGameState.Running;
            CurrGame.IsMouseVisible = true;
            base.LoadContent();
        }
Esempio n. 7
0
 private void OnDestroy()
 {
     if (this == Instance)
     {
         Instance = null;
     }
 }
Esempio n. 8
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.tag == "Player")
     {
         PointsManager.AddPoints(amount: -250);
     }
 }
 void Start()
 {
     base.Start();
     PointsManager.addPointTrigger("==", winConditionPoints, "onWinConditionPointsReached");
     PointsManager.addPointTrigger("==", 1, "onFirstPointReached");
     spawnPlane();
 }
Esempio n. 10
0
    void Update()
    {
        float scoreUpdateDelay = .5f / (startScoreUpdateDelay + speed - startScoopSpeed);

        if (spawning && !board.gameFrozen)
        {
            if (timeUntilNextSpawn <= 0)
            {
                timeUntilNextSpawn = spawnDelay;
                scoopsSpawned++;
                if (scoopsSpawned % 15 == 0)
                {
                    speed += .33f;
                    speed  = Mathf.Clamp(speed, startScoopSpeed, startScoopSpeed * 2f);
                }
                if (scoopsSpawned % 20 == 0)
                {
                    spawnDelay -= .33f;
                    spawnDelay  = Mathf.Clamp(spawnDelay, 1.5f, startSpawnDelay);
                }
                SpawnRandomScoop(InstantiateScoop());
            }
            timeUntilNextSpawn -= Time.deltaTime;
            if (timeUntilScoreUpdate <= 0)
            {
                PointsManager.AddPoints(1);
                timeUntilScoreUpdate = scoreUpdateDelay;
            }
            timeUntilScoreUpdate -= Time.deltaTime;
        }
    }
        public void TestIsIntersect()
        {
            //Not itersected path
            List <PointDir> List1  = new List <PointDir>();
            List <PointDir> List2  = new List <PointDir>();
            PointDir        point1 = new PointDir(1, 2, PointDir.PointDirection.N);
            PointDir        point2 = new PointDir(1, 3, PointDir.PointDirection.E);
            PointDir        point3 = new PointDir(2, 2, PointDir.PointDirection.S);
            PointDir        point4 = new PointDir(3, 2, PointDir.PointDirection.N);

            List1.Add(point1);
            List1.Add(point2);
            List2.Add(point3);
            List2.Add(point4);
            //Intersected path
            List <PointDir> List3  = new List <PointDir>();
            List <PointDir> List4  = new List <PointDir>();
            PointDir        point5 = new PointDir(1, 2, PointDir.PointDirection.N);
            PointDir        point6 = new PointDir(1, 3, PointDir.PointDirection.E);
            PointDir        point7 = new PointDir(1, 2, PointDir.PointDirection.S);
            PointDir        point8 = new PointDir(2, 2, PointDir.PointDirection.N);

            List3.Add(point5);
            List3.Add(point6);
            List4.Add(point7);
            List4.Add(point7);

            Assert.IsFalse(PointsManager.IsIntersect(List1, List2));
            Assert.IsTrue(PointsManager.IsIntersect(List3, List4));
        }
Esempio n. 12
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Esempio n. 13
0
 // Start is called before the first frame update
 void Start()
 {
     rb                  = GetComponent <Rigidbody>();         //intialise RigidBody
     hPManager           = GetComponent <HPManager>();         //initialise hp manager
     pointsManager       = GetComponent <PointsManager>();     //initialise points manager
     gyroscopeController = GetComponent <GyroscopeMovement>(); //initialise gyroscope controller manager
 }
Esempio n. 14
0
    public void UpdatePositions(PointType removeAllFromType = PointType.None)
    {
        int       points = 0;
        PointType pt     = removeAllFromType;

        for (int i = 0; i < boardSize.y; i++)
        {
            for (int l = 0; l < boardSize.x; l++)
            {
                if (removeAllFromType != PointType.None)
                {
                    if (boardDots[i, l].GetComponent <InitializeDot>().dotType.pointType == removeAllFromType)
                    {
                        ProcessDot(i, l);
                        points++;
                    }
                }
                else if (!boardDots[i, l].activeSelf)
                {
                    pt = boardDots[i, l].GetComponent <InitializeDot>().dotType.pointType;
                    ProcessDot(i, l);
                    points++;
                }
            }
        }
        if (pt != PointType.None)
        {
            PointsManager.GetInstance().UpdatePoints(pt, points, levelGoal);
        }
    }
Esempio n. 15
0
    // Update is called once per frame
    void Update()
    {
        if (Input.mouseScrollDelta.y > 0)
        {
            cam.orthographicSize *= 1 - ZoomSpeed;
        }
        else if (Input.mouseScrollDelta.y < 0)
        {
            cam.orthographicSize *= 1 + ZoomSpeed;
        }
        cam.orthographicSize = Mathf.Clamp(cam.orthographicSize, 1f, 10000f);

        if (Input.mouseScrollDelta != Vector2.zero)
        {
            updateSizes(PointsManager.get());
        }


        if (Input.GetMouseButtonDown(2))
        {
            prevMousePos = Input.mousePosition;
        }

        if (Input.GetMouseButton(2))
        {
            Vector2 mouseDelta = new Vector2(Input.mousePosition.x - prevMousePos.x, Input.mousePosition.y - prevMousePos.y) * -moveSpeed;

            cam.transform.Translate(mouseDelta * Time.deltaTime * cam.orthographicSize);

            prevMousePos = Input.mousePosition;
        }
    }
Esempio n. 16
0
    public bool testEquality()
    {
        bool passes = false;

        switch (equality)
        {
        case "<":
            passes = PointsManager.getPoints() < points;
            break;

        case "<=":
            passes = PointsManager.getPoints() <= points;
            break;

        case "==":
            passes = PointsManager.getPoints() == points;
            break;

        case "!=":
            passes = PointsManager.getPoints() != points;
            break;

        case ">=":
            passes = PointsManager.getPoints() >= points;
            break;

        case ">":
            passes = PointsManager.getPoints() > points;
            break;
        }
        return(passes);
    }
Esempio n. 17
0
        public void Setup()
        {
            m_PointOne = new Point3D(1,
                                     1.0,
                                     1.0,
                                     1.0,
                                     "Point One");


            m_PointTwo = new Point3D(2,
                                     2.0,
                                     2.0,
                                     2.0,
                                     "Point Two");

            m_ShiftByPoint = new Point3D(-1,
                                         1.0,
                                         1.0,
                                         1.0,
                                         "Shift By Point");

            m_Points = new[]
            {
                m_PointOne,
                m_PointTwo
            };

            m_Repository = Substitute.For <IPointsRepository>();
            m_Shifter    = Substitute.For <IRepositoryPointsShifter>();

            m_Sut = new PointsManager(m_Repository,
                                      m_Shifter);
        }
Esempio n. 18
0
    void Awake()
    {
        //Check if instance already exists
        if (instance == null)
        {
            //if not, set instance to this
            instance = this;
            points   = 0;
        }

        //If instance already exists and it's not this:
        else if (instance != this)
        {
            //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
            Destroy(gameObject);
        }

        //Sets this to not be destroyed when reloading scene
        DontDestroyOnLoad(gameObject);

        string selectedCharacter = DataController.GetCharacter();

        if (selectedCharacter == "boy")
        {
            GameObject boyPlayer = GameObject.Find("Player");
            player = boyPlayer.GetComponent <Player>();
        }
        else
        {
            GameObject girlPlayer = GameObject.Find("Player_Girl");
            player = girlPlayer.GetComponent <Player>();
        }

        InitCoins();
    }
Esempio n. 19
0
 public void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Plane")
     {
         PointsManager.addPoints(1);
     }
 }
Esempio n. 20
0
    public float currentTimeInCombo         = 0;    // timer actual

    // Start is called before the first frame update
    void Awake()
    {
        if (current == null)
        {
            current = this;
        }
    }
Esempio n. 21
0
        public void AlwaysHaveOnlyOneInstance()
        {
            PointsManager firstPointsManager  = PointsManager.GetInstance();
            PointsManager secondPointsManager = PointsManager.GetInstance();

            Assert.AreSame(firstPointsManager, secondPointsManager);
        }
Esempio n. 22
0
        void Carrega(Principal _principal, PropietarisManager _propietaris_manager, PointsManager _points_manager,
                     ServerManager _server_manager, UIManager _ui_manager)
        {
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize          = new System.Drawing.Size(970, 465);
            this.Name = "Adobs";
            this.Text = this.Name;
            this.ResumeLayout(false);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox     = false;
            this.MinimizeBox     = false;
            this.Load           += new System.EventHandler(this.LoadF);

            // Set Managers ----------------------
            propietaris_manager = _propietaris_manager;
            point_manager       = _points_manager;
            server_manager      = _server_manager;
            ui_manager          = _ui_manager;
            principal           = _principal;
            // -----------------------------------

            // UI --------------------------------
            LoadUI();
            // -----------------------------------
        }
Esempio n. 23
0
        public void HaveEmptyBlackListAnd150MoneyToPointsConversion()
        {
            PointsManager newPointsManager = PointsManager.GetInstance();

            Assert.AreEqual(150, newPointsManager.MoneyPerPoint);
            Assert.AreEqual(0, newPointsManager.Blacklist.Count);
        }
 public void ShotFromSky()
 {
     StartCoroutine(DestroyBehaviour());
     if (PointsManager.AddScoreEvent != null)
     {
         PointsManager.AddScoreEvent(pointScore);
     }
 }
Esempio n. 25
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.CompareTag("Player"))
     {
         PointsManager.GetCookie();
         Destroy(gameObject);
     }
 }
Esempio n. 26
0
 private void Start()
 {
     //TODO cast list of all situation and min point values -> currentlyAvailableSituations
     pointsManager = GetComponent <PointsManager>();
     LoadSituations();
     DisableAllUIElements();
     StartCoroutine(SituationTimer());
 }
Esempio n. 27
0
 // Use this for initialization
 void Awake()
 {
     cam = Camera.main;
     for (int i = 0; i < PointsManager.get().pointsTr.Count; i++)
     {
         PointsManager.get().pointsTr[i].localScale = Vector3.one * cam.orthographicSize / pointsSizeRatio;
     }
 }
Esempio n. 28
0
 void Update()
 {
     MoveEnemies();
     MoveBullets();
     EnemiesAndBulletsPooling();
     CheckHitByBullet();
     PointsManager.AddPoints((int)Time.realtimeSinceStartup * 1 / 100);
 }
Esempio n. 29
0
        public void FailWithArgumentExceptionIfToBeRemovedBlacklistedProviderIsNotInBlacklist()
        {
            PointsManager newPointsManager = PointsManager.GetInstance();

            Provider newProvider = new Provider("Antel", 10, new List <IField>());

            newPointsManager.RemoveProviderFromBlacklist(newProvider);
        }
Esempio n. 30
0
    public static PointsManager GetInstance()
    {
        if (_instance == null)
        {
            _instance = new PointsManager();
        }

        return(_instance);
    }
Esempio n. 31
0
    private void Start()
    {
        sphereBody   = GetComponent <Rigidbody>();
        pView        = GetComponent <PhotonView>();
        pacData      = GetComponent <PacmanData>();
        audioManager = GameObject.Find("AudioObject").GetComponent <AudioManager>();

        pointsManager = GameObject.Find("CanvasPitStops").GetComponent <PointsManager>();        // Aquí hay problemas
    }
Esempio n. 32
0
 void Awake()
 {
     DontDestroyOnLoad(gameObject);
     instance = this;
 }
Esempio n. 33
0
 void Start()
 {
     manager = PointsManager.getInstance();
 }
Esempio n. 34
0
 void Start()
 {
     LineDrawer = GetComponent<LineRenderer>();
     manager = PointsManager.getInstance();
 }