Start() private méthode

private Start ( ) : void
Résultat void
Exemple #1
0
 private void Start()
 {
     // CreateGapPipes(6f, 1f, 1f);
     Bird.GetInstance().OnDied         += Bird_OnDied;
     Bird.GetInstance().OnStartPlaying += Bird_OnStartPlaying;
     Score.Start();
 }
Exemple #2
0
        public void Load(string filePath)
        {
            var text = File.ReadAllText(filePath);

            //Remove \r to fix OS compatibility
            text = text.Replace("\r", "");
            var list = text.Split('\n');


            for (var y = 0; y < YSize; y++)
            {
                var line = list[y];
                for (var x = 0; x < XSize; x++)
                {
                    var character  = line[x];
                    var linkedList = new LinkedList <EntityBase>();
                    Grid[y, x] = linkedList;

                    linkedList.AddFirst(new Space());

                    var point = new Point(x, y);
                    switch (character)
                    {
                    case Constant.PlayerChar:
                    {
                        var p = new Player();
                        p.Start(this, point);
                        linkedList.AddFirst(p);
                        break;
                    }

                    case Constant.GhostChar:
                    {
                        var p = new Ghost();
                        p.Start(this, point);
                        linkedList.AddFirst(p);
                        break;
                    }

                    case Constant.WallChar:
                    {
                        var p = new Wall();
                        p.Start(this, point);
                        linkedList.AddFirst(p);
                        break;
                    }

                    case Constant.ScoreChar:
                    {
                        var p = new Score();
                        p.Start(this, point);
                        linkedList.AddFirst(p);
                        _scoreInMap++;
                        break;
                    }
                    }
                }
            }
        }
Exemple #3
0
    // Start is called before the first frame update
    private void Start()
    {
        Debug.Log("GameHandler.Start");

        // GameObject gameObject = new GameObject("Pipe", typeof(SpriteRenderer));
        // gameObject.GetComponent<SpriteRenderer>().sprite = GameAssets.GetInstance().pipeHeadSprite;
        Score.Start();
    }
    void Start()
    {
        if (firstTime)
        {
            Score.ResetHighscore();
            firstTime = false;
        }

        Score.Start();
    }
Exemple #5
0
    private void Start()
    {
        Debug.Log("GameHandler.Start");

        Score.Start();

        if (SceneManager.GetActiveScene().name == "GameScene")
        {
            SoundManager.PlaySound(SoundManager.Sound.Background);
        }
    }
Exemple #6
0
 // Start is called before the first frame update
 private void Start()
 {
     Debug.Log("GameHandler.Start");
     Score.Start();
 }
Exemple #7
0
 // Start is called before the first frame update
 void Start()
 {
     Debug.Log("GameHandler.Start");
     //Score.ResetHighScore();
     Score.Start();
 }
Exemple #8
0
 void Start()
 {
     Score.Start();
 }
        private void FadeCoversInAndOut(List<ClutterFlowBaseActor> old_covers,
                                        List<ClutterFlowBaseActor> persistent_covers,
                                        List<ClutterFlowBaseActor> new_covers,
		                                EventHandler on_completed, double new_progress)
        {
            //Console.WriteLine ("FADE COVERS IN AND OUT");

            if (old_covers==null || persistent_covers==null || new_covers==null) return;
            if (TransitionAnimationBusy) {
                transition_queue.Enqueue(new TransitionStruct(old_covers, persistent_covers, new_covers, new_progress, on_completed));
            }
            if (fadeOutAnim!=null) { fadeOutAnim.CompleteAnimation (); fadeOutAnim = null; }
            if (fadeInAnim!=null) { fadeInAnim.CompleteAnimation (); fadeInAnim = null; }
            if (t_slide!=null) { t_slide.Advance(t_slide.Duration); t_slide = null; }

            #region fade out of removed covers
            foreach (ClutterFlowBaseActor cover in old_covers) {
                if (cover!=null) {
                    FadeOutActor (cover);
                    fadeOutAnim.Timeline.Pause ();
                }
            }
            #endregion

            #region sliding of persistent covers
            foreach (ClutterFlowBaseActor cover in persistent_covers) {
                if (cover!=null) {
                    cover.Data["alpha_ini"] = cover.Data["last_alpha"];
                    cover.Data["alpha_end"] = AlphaFunc(cover, new_progress);
                }
            }
            t_slide = new Timeline (CoverManager.MaxAnimationSpan*fade_slow);
            t_slide.NewFrame += delegate (object o, NewFrameArgs args) {
                foreach (ClutterFlowBaseActor cover in persistent_covers) {
                    if (cover!=null && cover.Data.ContainsKey ("alpha_ini") && cover.Data.ContainsKey ("alpha_end")) {
                        double alpha_end = (double) cover.Data["alpha_end"];
                        double alpha_ini = (double) cover.Data["alpha_ini"];
                        UpdateActorWithAlpha (cover, alpha_ini + (alpha_end - alpha_ini) * t_slide.Progress);
                    }
                }
            };
            #endregion

            #region fade in of new covers
            foreach (ClutterFlowBaseActor cover in new_covers) {
                if (cover!=null) {
                    UpdateActorWithAlpha (cover, AlphaFunc(cover));
                    FadeInActor (cover);
                    fadeInAnim.Timeline.Pause ();
                }
            }
            #endregion

            #region clearing, setting and playing of transition score:
            if (transition_score!=null) {
                GC.SuppressFinalize (transition_score);
                transition_score.Completed -= HandleScoreCompleted;
                /*if (transition_score.IsPlaying) {
                    transition_score.Completed
                }
                transition_score = null;*/
            }
            transition_score = new Score();
            transition_score.Completed += HandleScoreCompleted;

            Timeline parent = null;
            if (fadeOutAnim!=null && fadeOutAnim.Timeline!=null) {
                transition_score.Append(parent, fadeOutAnim.Timeline);
                parent = fadeOutAnim.Timeline;
            }
            if (t_slide!=null) {
                transition_score.Append(parent, t_slide);
                parent = t_slide;
            }
            if (fadeInAnim!=null && fadeInAnim.Timeline!=null) {
                transition_score.Append(parent, fadeInAnim.Timeline);
                parent = fadeInAnim.Timeline;
            }

            SetPreviousBounds (new_progress);
            CoverManager.SortDepthOrder ();
            if (parent!=null) {
                transition_score.Completed += on_completed;
                transition_score.Start ();
            } else {
                on_completed (this, EventArgs.Empty);
            }
            #endregion
        }
        private void FadeCoversInAndOut(List <ClutterFlowBaseActor> old_covers,
                                        List <ClutterFlowBaseActor> persistent_covers,
                                        List <ClutterFlowBaseActor> new_covers,
                                        EventHandler on_completed, double new_progress)
        {
            //Console.WriteLine ("FADE COVERS IN AND OUT");

            if (old_covers == null || persistent_covers == null || new_covers == null)
            {
                return;
            }
            if (TransitionAnimationBusy)
            {
                transition_queue.Enqueue(new TransitionStruct(old_covers, persistent_covers, new_covers, new_progress, on_completed));
            }
            if (fadeOutAnim != null)
            {
                fadeOutAnim.CompleteAnimation();
                fadeOutAnim = null;
            }
            if (fadeInAnim != null)
            {
                fadeInAnim.CompleteAnimation();
                fadeInAnim = null;
            }
            if (t_slide != null)
            {
                t_slide.Advance(t_slide.Duration);
                t_slide = null;
            }

            #region fade out of removed covers
            foreach (ClutterFlowBaseActor cover in old_covers)
            {
                if (cover != null)
                {
                    FadeOutActor(cover);
                    fadeOutAnim.Timeline.Pause();
                }
            }
            #endregion

            #region sliding of persistent covers
            foreach (ClutterFlowBaseActor cover in persistent_covers)
            {
                if (cover != null)
                {
                    cover.Data["alpha_ini"] = cover.Data["last_alpha"];
                    cover.Data["alpha_end"] = AlphaFunc(cover, new_progress);
                }
            }
            t_slide           = new Timeline(CoverManager.MaxAnimationSpan * fade_slow);
            t_slide.NewFrame += delegate(object o, NewFrameArgs args) {
                foreach (ClutterFlowBaseActor cover in persistent_covers)
                {
                    if (cover != null && cover.Data.ContainsKey("alpha_ini") && cover.Data.ContainsKey("alpha_end"))
                    {
                        double alpha_end = (double)cover.Data["alpha_end"];
                        double alpha_ini = (double)cover.Data["alpha_ini"];
                        UpdateActorWithAlpha(cover, alpha_ini + (alpha_end - alpha_ini) * t_slide.Progress);
                    }
                }
            };
            #endregion

            #region fade in of new covers
            foreach (ClutterFlowBaseActor cover in new_covers)
            {
                if (cover != null)
                {
                    UpdateActorWithAlpha(cover, AlphaFunc(cover));
                    FadeInActor(cover);
                    fadeInAnim.Timeline.Pause();
                }
            }
            #endregion

            #region clearing, setting and playing of transition score:
            if (transition_score != null)
            {
                GC.SuppressFinalize(transition_score);
                transition_score.Completed -= HandleScoreCompleted;

                /*if (transition_score.IsPlaying) {
                 *  transition_score.Completed
                 * }
                 * transition_score = null;*/
            }
            transition_score            = new Score();
            transition_score.Completed += HandleScoreCompleted;

            Timeline parent = null;
            if (fadeOutAnim != null && fadeOutAnim.Timeline != null)
            {
                transition_score.Append(parent, fadeOutAnim.Timeline);
                parent = fadeOutAnim.Timeline;
            }
            if (t_slide != null)
            {
                transition_score.Append(parent, t_slide);
                parent = t_slide;
            }
            if (fadeInAnim != null && fadeInAnim.Timeline != null)
            {
                transition_score.Append(parent, fadeInAnim.Timeline);
                parent = fadeInAnim.Timeline;
            }

            SetPreviousBounds(new_progress);
            CoverManager.SortDepthOrder();
            if (parent != null)
            {
                transition_score.Completed += on_completed;
                transition_score.Start();
            }
            else
            {
                on_completed(this, EventArgs.Empty);
            }
            #endregion
        }
    // Start is called before the first frame update
    void Start()
    {
        Debug.Log("GameManager.Start");

        Score.Start();
    }
 public void Start()
 {
     //Debug.Log("Gamemanager Started!");
     Score.Start();
 }
Exemple #13
0
 // Start is called before the first frame update
 void Start()
 {
     //Score.ResetHighscore();
     Score.Start();
 }