Ejemplo n.º 1
0
        public CoinEndLayer(MainLayer mainLayer, int time, int coin1, int coin2, int id, NetworkStream serverStream)
        {
            _mainLayer    = mainLayer;
            _serverStream = serverStream;
            Button backGround = new Button("vs");

            backGround.Position = new CCPoint(192, 120);
            AddChild(backGround);
            if ((id == 0) && (coin1 > coin2) || (id == 1) && (coin2 > coin1))
            {
                grat          = new CCLabel("Congratulations you won!", "fonts/MarkerFelt", 22, CCLabelFormat.SpriteFont);
                grat.Color    = new CCColor3B(0, 0, 0);
                grat.Position = new CCPoint(192, 210);
                AddChild(grat);
            }
            else
            {
                grat          = new CCLabel("You lost!", "fonts/MarkerFelt", 22, CCLabelFormat.SpriteFont);
                grat.Color    = new CCColor3B(0, 0, 0);
                grat.Position = new CCPoint(192, 210);
                AddChild(grat);
            }

            coin1_label          = new CCLabel(coin1.ToString(), "fonts/MarkerFelt", 22, CCLabelFormat.SpriteFont);
            coin1_label.Color    = new CCColor3B(0, 0, 0);
            coin1_label.Position = new CCPoint(60, 115);
            AddChild(coin1_label);
            coin2_label          = new CCLabel(coin2.ToString(), "fonts/MarkerFelt", 22, CCLabelFormat.SpriteFont);
            coin2_label.Color    = new CCColor3B(0, 0, 0);
            coin2_label.Position = new CCPoint(324, 115);
            AddChild(coin2_label);
        }
Ejemplo n.º 2
0
        public GoldRushLayer(MainLayer mainLayer, NetworkStream serverStream)
        {
            _mainLayer    = mainLayer;
            _serverStream = serverStream;

            backGround          = new Button("background.png");
            backGround.Position = new CCPoint(192, 120);
            AddChild(backGround);

            level_List = new List <String>();
            level_List.Add("Level 1");
            level_List.Add("Level 2");
            actual_level = 0;

            level_left          = new Button("arrow_left.png");
            level_left.Position = new CCPoint(130, 170);
            AddChild(level_left);

            level          = new CCLabel("Level 1", "fonts/MarkerFelt", 22, CCLabelFormat.SpriteFont);
            level.Color    = new CCColor3B(0, 0, 0);
            level.Position = new CCPoint(200, 170);
            AddChild(level);

            level_right          = new Button("arrow_right.png");
            level_right.Position = new CCPoint(270, 170);
            AddChild(level_right);

            start          = new Button("continue.png");
            start.Scale    = 1.5f;
            start.Position = new CCPoint(200, 30);
            AddChild(start);
        }
Ejemplo n.º 3
0
        public YouDiedLayer(MainLayer mainLayer)
        {
            _mainLayer = mainLayer;
            Button backGround = new Button("youdied.jpg");

            backGround.Position = new CCPoint(192, 120);
            AddChild(backGround);
        }
Ejemplo n.º 4
0
        public MultiPlayerLayer(MainLayer mainLayer, NetworkStream serverStream)
        {
            _mainLayer    = mainLayer;
            _serverStream = serverStream;

            backGround          = new Button("background.png");
            backGround.Position = new CCPoint(192, 120);
            AddChild(backGround);

            level_List = new List <String>();
            level_List.Add("Level 1");
            level_List.Add("Level 2");
            level_List.Add("Level 3");
            level_List.Add("Level 4");
            level_List.Add("Level 5");
            level_List.Add("Level 6");
            level_List.Add("Level 7");
            level_List.Add("Level 8");
            level_List.Add("Level 9");
            actual_level = 0;

            maxplayer_List = new List <int>();
            maxplayer_List.Add(1);
            maxplayer_List.Add(2);
            actual_maxplayer = 1;

            level_left          = new Button("arrow_left.png");
            level_left.Position = new CCPoint(130, 170);
            AddChild(level_left);

            level          = new CCLabel("Level 1", "fonts/MarkerFelt", 22, CCLabelFormat.SpriteFont);
            level.Color    = new CCColor3B(0, 0, 0);
            level.Position = new CCPoint(200, 170);
            AddChild(level);

            level_right          = new Button("arrow_right.png");
            level_right.Position = new CCPoint(270, 170);
            AddChild(level_right);

            maxPlayer_left          = new Button("arrow_left.png");
            maxPlayer_left.Position = new CCPoint(130, 120);
            AddChild(maxPlayer_left);

            maxplayer          = new CCLabel(maxplayer_List[actual_maxplayer].ToString(), "fonts/MarkerFelt", 22, CCLabelFormat.SpriteFont);
            maxplayer.Color    = new CCColor3B(0, 0, 0);
            maxplayer.Position = new CCPoint(200, 120);
            AddChild(maxplayer);

            maxPlayer_right          = new Button("arrow_right.png");
            maxPlayer_right.Position = new CCPoint(270, 120);
            AddChild(maxPlayer_right);

            start          = new Button("continue.png");
            start.Scale    = 1.5f;
            start.Position = new CCPoint(200, 30);
            AddChild(start);
        }
Ejemplo n.º 5
0
        public GoldRushLoadingLayer(MainLayer mainLayer, NetworkStream serverStream)
        {
            _mainLayer    = mainLayer;
            _serverStream = serverStream;

            backGround          = new Button("WaitingScreen.png");
            backGround.Position = new CCPoint(192, 120);
            AddChild(backGround);
        }
Ejemplo n.º 6
0
        public YouDiedLayer(MainLayer mainLayer, NetworkStream serverStream)
        {
            _serverStream = serverStream;
            _mainLayer    = mainLayer;
            Button backGround = new Button("youdied.jpg");

            backGround.Position = new CCPoint(192, 120);
            AddChild(backGround);
        }
Ejemplo n.º 7
0
 public HowToPlayLayer(MainLayer mainLayer)
 {
     _mainLayer          = mainLayer;
     page                = 0;
     backGround          = new Button("howtoplay_1.png");
     backGround.Position = new CCPoint(192, 120);
     AddChild(backGround);
     continue_button          = new Button("continue.png");
     continue_button.Scale    = 1.5f;
     continue_button.Position = new CCPoint(330, 20);
     AddChild(continue_button);
 }
Ejemplo n.º 8
0
        public VictoryLayer(MainLayer mainLayer, String time, String level, int missed_coins, int lost_lives, NetworkStream serverStream)
        {
            _mainLayer    = mainLayer;
            _serverStream = serverStream;
            Button backGround = new Button("victory.jpg");

            backGround.Position = new CCPoint(192, 120);
            AddChild(backGround);
            grat          = new CCLabel("Congratulations!", "fonts/MarkerFelt", 22, CCLabelFormat.SpriteFont);
            grat.Color    = new CCColor3B(0, 0, 0);
            grat.Position = new CCPoint(192, 210);
            AddChild(grat);

            int min = Int32.Parse(time.Split(':')[0]);
            int sec = Int32.Parse(time.Split(':')[1]);

            sec = sec + missed_coins * 5 + lost_lives * 10;
            if (sec > 60)
            {
                min += sec / 60;
                sec -= 60;
            }

            time_label          = new CCLabel("Your time was: " + min + ":" + sec, "fonts/MarkerFelt", 22, CCLabelFormat.SpriteFont);
            time_label.Color    = new CCColor3B(255, 255, 255);
            time_label.Position = new CCPoint(192, 60);
            AddChild(time_label);
            best_time_label          = new CCLabel("Best time was: " + CCUserDefault.SharedUserDefault.GetStringForKey("level_" + level, "-"), "fonts/MarkerFelt", 22, CCLabelFormat.SpriteFont);
            best_time_label.Color    = new CCColor3B(255, 255, 255);
            best_time_label.Position = new CCPoint(192, 30);
            AddChild(best_time_label);

            if (CCUserDefault.SharedUserDefault.GetStringForKey("level_" + level, "-") != "-")
            {
                /*int now_min = Int32.Parse(time.Split(':')[0]);
                *  int now_sec = Int32.Parse(time.Split(':')[1]);*/

                int best_min = Int32.Parse(CCUserDefault.SharedUserDefault.GetStringForKey("level_" + level, "-").Split(':')[0]);
                int best_sec = Int32.Parse(CCUserDefault.SharedUserDefault.GetStringForKey("level_" + level, "-").Split(':')[1]);

                if (best_min * 60 + best_sec > min * 60 + sec)
                {
                    CCUserDefault.SharedUserDefault.SetStringForKey("level_" + level, min + ":" + sec);
                    CCUserDefault.SharedUserDefault.Flush();
                }
            }
            else
            {
                CCUserDefault.SharedUserDefault.SetStringForKey("level_" + level, min + ":" + sec);
                CCUserDefault.SharedUserDefault.Flush();
            }
        }
Ejemplo n.º 9
0
        public PlayMenuLayer(MainLayer mainLayer)
        {
            _mainLayer = mainLayer;

            backGround = new Button("background_1")
            {
                Position = new CCPoint(192, 120)
            };
            AddChild(backGround);

            Single_player = new Button("SinglePlayer") // Single Player létrehozása
            {
                Scale    = 2,
                Position = new CCPoint(192, 150)
            };
            AddChild(Single_player);

            Multi_player = new Button("MultiPlayer") // Multi Player létrehozása
            {
                Scale    = 2,
                Position = new CCPoint(192, 90)
            };
            AddChild(Multi_player);
        }
Ejemplo n.º 10
0
        public LevelSelectorLayer(MainLayer mainLayer)
        {
            _mainLayer = mainLayer;

            backGround          = new Button("background.png");
            backGround.Position = new CCPoint(192, 120);
            AddChild(backGround);

            level_List = new List <String>();
            level_List.Add("Level 1");
            level_List.Add("Level 2");
            level_List.Add("Level 3");
            level_List.Add("Level 4");
            level_List.Add("Level 5");
            level_List.Add("Level 6");
            level_List.Add("Level 7");
            level_List.Add("Level 8");
            level_List.Add("Level 9");
            actual_level = 0;

            difficulty_List = new List <String>();
            difficulty_List.Add("easy");
            difficulty_List.Add("normal");
            difficulty_List.Add("hard");
            difficulty_List.Add("realistic");
            actual_difficulty = 1;

            speed_List = new List <String>();
            speed_List.Add("slow");
            speed_List.Add("normal");
            speed_List.Add("fast");
            actual_speed = 1;

            level_left          = new Button("arrow_left.png");
            level_left.Position = new CCPoint(130, 170);
            AddChild(level_left);

            level          = new CCLabel("Level 1", "fonts/MarkerFelt", 22, CCLabelFormat.SpriteFont);
            level.Color    = new CCColor3B(0, 0, 0);
            level.Position = new CCPoint(200, 170);
            AddChild(level);

            level_right          = new Button("arrow_right.png");
            level_right.Position = new CCPoint(270, 170);
            AddChild(level_right);

            difficulty_left          = new Button("arrow_left.png");
            difficulty_left.Position = new CCPoint(130, 120);
            AddChild(difficulty_left);

            difficulty          = new CCLabel(difficulty_List[actual_difficulty], "fonts/MarkerFelt", 22, CCLabelFormat.SpriteFont);
            difficulty.Color    = new CCColor3B(0, 0, 0);
            difficulty.Position = new CCPoint(200, 120);
            AddChild(difficulty);

            difficulty_right          = new Button("arrow_right.png");
            difficulty_right.Position = new CCPoint(270, 120);
            AddChild(difficulty_right);

            speed_left          = new Button("arrow_left.png");
            speed_left.Position = new CCPoint(130, 70);
            AddChild(speed_left);

            speed          = new CCLabel(speed_List[actual_speed], "fonts/MarkerFelt", 22, CCLabelFormat.SpriteFont);
            speed.Color    = new CCColor3B(0, 0, 0);
            speed.Position = new CCPoint(200, 70);
            AddChild(speed);

            speed_right          = new Button("arrow_right.png");
            speed_right.Position = new CCPoint(270, 70);
            AddChild(speed_right);

            start          = new Button("continue.png");
            start.Scale    = 1.5f;
            start.Position = new CCPoint(200, 30);
            AddChild(start);
        }
Ejemplo n.º 11
0
 public HighScoreLayer(MainLayer mainLayer)
 {
     _mainLayer = mainLayer;
 }