예제 #1
0
    private void Start()
    {
        PlayerBackground background = GameManager.instance.player.playerBackground;

        playerSprite.sprite = background.sprite;
        switch (background.backgroundType)
        {
        case (BackgroundType.HUE):
            currDialogue = hueDialogue;
            break;

        case (BackgroundType.RENEGADE):
            currDialogue = renegadeDialogue;
            break;

        case (BackgroundType.MERE):
            currDialogue = mereDialogue;
            break;

        default:
            currDialogue = hueDialogue;
            break;
        }
        guidanceText.SetActive(false);
        _dialogueActive = false;
        _dialogueIndex  = 0;
        StartCoroutine(StartDialogue());
    }
예제 #2
0
    public void StartGame()
    {
        // TODO // Jam code: scroll to top now that market is initialized and the layout is rebuilt
        market.ScrollToTop();

        _playerBackground = player.playerBackground;
        gameStatus        = GameStatus.PLAYING;
        StartDay();
    }
예제 #3
0
 public OptionBackgroundForm(PlayerBackground bg)
 {
     this.InitializeComponent();
     this.fBackground     = bg.Copy();
     this.NameBox.Text    = this.fBackground.Name;
     this.SkillBox.Text   = this.fBackground.AssociatedSkills;
     this.FeatBox.Text    = this.fBackground.RecommendedFeats;
     this.DetailsBox.Text = this.fBackground.Details;
 }
예제 #4
0
        public OptionBackgroundForm(PlayerBackground bg)
        {
            InitializeComponent();

            fBackground = bg.Copy();

            NameBox.Text    = fBackground.Name;
            SkillBox.Text   = fBackground.AssociatedSkills;
            FeatBox.Text    = fBackground.RecommendedFeats;
            DetailsBox.Text = fBackground.Details;
        }
예제 #5
0
파일: Key.cs 프로젝트: KotomiNagata/SHA
    string prevState;         // 前の状態を保存
    //state = "KeyUsually";

    void Start()
    {
        this.animator = GetComponent <Animator>();
        if (playerBackgroundScript)
        {
            player1 = FindObjectOfType <PlayerBackground>();
        }
        if (playerBossScript)
        {
            playerB = FindObjectOfType <PlayerBoss>();
        }
        if (playerFreeScript)
        {
            playerF = FindObjectOfType <PlayerFree>();
        }
        state = "KeyUsually";
    }
예제 #6
0
파일: Game1.cs 프로젝트: trnktms/ScarFly
        public Game1()
        {
            //NOTE: Init
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            // Frame rate is 30 fps by default for Windows Phone.
            TargetElapsedTime = TimeSpan.FromTicks(333333);
            // Extend battery life under lock.
            this.Deactivated += Game1_Deactivated;
            InactiveSleepTime = TimeSpan.FromSeconds(1);
            graphics.SupportedOrientations     = DisplayOrientation.LandscapeLeft;
            graphics.IsFullScreen              = true;
            graphics.PreferredBackBufferHeight = 480;
            graphics.PreferredBackBufferWidth  = 800;
            Consts.PhoneWidth  = graphics.PreferredBackBufferWidth;
            Consts.PhoneHeight = graphics.PreferredBackBufferHeight;
            firstEntry         = true;
            gameState          = GameState.InMainMenu;

            //NOTE: MENU
            mainButtons = new List <MenuButton>();
            mainButtons.Add(new MenuButton("Main_Start", Consts.P_StartButton, (Consts.PhoneWidth / 2) + 20, (Consts.PhoneHeight / 2) - 220));
            mainButtons.Add(new MenuButton("Main_Help", Consts.P_HelpButton, (Consts.PhoneWidth / 2) + 20, (Consts.PhoneHeight / 2) - 220 + 100));
            mainButtons.Add(new MenuButton("Main_About", Consts.P_AboutButton, (Consts.PhoneWidth / 2) + 20, (Consts.PhoneHeight / 2) - 220 + 200));
            mainButtons.Add(new MenuButton("Main_Vibrate", Consts.P_VibrateButton, (Consts.PhoneWidth) - 100, (Consts.PhoneHeight) - 100));
            mainMenu = new Menu(mainButtons);

            pauseButtons = new List <MenuButton>();
            pauseButtons.Add(new MenuButton("Pause_Resume", Consts.P_ResumeButton, (Consts.PhoneWidth / 2) - 166, (Consts.PhoneHeight / 2) - 200));
            pauseMenu = new Menu(pauseButtons);

            tutorialButtons = new List <MenuButton>();
            tutorialButtons.Add(new MenuButton("Tutorial", Consts.P_Tutorial, 0, 0));
            tutorialMenu = new Menu(tutorialButtons);

            aboutButtons = new List <MenuButton>();
            aboutButtons.Add(new MenuButton("About_Rate", Consts.P_RateButton, (Consts.PhoneWidth / 2) - 166, (Consts.PhoneHeight / 2) - 50));
            aboutMenu = new Menu(aboutButtons);

            //NOTE: GAMING
            player         = new Player("Player1", 4, 100, 340, Consts.P_Player, 1);
            backBackground = new PlayerBackground(Consts.P_Backgrond, 1);
            foreBackground = new PlayerBackground(Consts.P_ForeBackground, 2);
            walkPlace      = new PlayerBackground(Consts.P_Walkplace, 4);

            string level = LevelHelper.SelectLevel();

            barriers  = new Barriers(level, 4);
            moneys    = new Moneys(level, 4);
            modifiers = new Modifiers(level, 4);

            backgroundList = new List <PlayerBackground>();
            backgroundList.Add(backBackground);
            backgroundList.Add(foreBackground);
            backgroundList.Add(walkPlace);

            collosion = new Collosion(barriers, player, moneys, modifiers, backgroundList);

            if (!MenuHelper.FirstStart())
            {
                gameState = GameState.InTutorial;
            }
        }
예제 #7
0
    void Update()
    {
        //player select
        if (p1.GetButtonDown("Select") && p1Drop && !p1CharSelected)
        {
            PB = p1Background.GetComponent <PlayerBackground>();
            PB.selectChar();
            p1CharSelected = true;
            p1Cursor.SetActive(false);
        }
        if (p2.GetButtonDown("Select") && p2Drop && !p2CharSelected)
        {
            PB = p2Background.GetComponent <PlayerBackground>();
            PB.selectChar();
            p2CharSelected = true;
            p2Cursor.SetActive(false);
        }
        if (p3.GetButtonDown("Select") && p3Drop && !p3CharSelected)
        {
            PB = p3Background.GetComponent <PlayerBackground>();
            PB.selectChar();
            p3CharSelected = true;
            p3Cursor.SetActive(false);
        }
        if (p4.GetButtonDown("Select") && p4Drop && !p4CharSelected)
        {
            PB = p4Background.GetComponent <PlayerBackground>();
            PB.selectChar();
            p4CharSelected = true;
            p4Cursor.SetActive(false);
        }
        //player selection cancel
        if (p1.GetButtonDown("Cancel") && p1Drop && p1CharSelected)
        {
            p1CharSelected = false;
            //PB = p1Background.GetComponent<PlayerBackground>();
            //PB.CancelSelection();
            p1Cursor.SetActive(true);
        }
        if (p2.GetButtonDown("Cancel") && p2Drop && p2CharSelected)
        {
            p2CharSelected = false;
            //PB = p2Background.GetComponent<PlayerBackground>();
            //PB.CancelSelection();
            p2Cursor.SetActive(true);
        }
        if (p3.GetButtonDown("Cancel") && p3Drop && p3CharSelected)
        {
            p3CharSelected = false;
            //PB = p3Background.GetComponent<PlayerBackground>();
            //PB.CancelSelection();
            p3Cursor.SetActive(true);
        }
        if (p4.GetButtonDown("Cancel") && p4Drop && p4CharSelected)
        {
            p4CharSelected = false;
            p4Cursor.SetActive(true);
        }
        //player drop
        if (p1.GetButtonDown("Select") && !p1Drop)
        {
            Spawn(1, p1Background);
        }
        if (p2.GetButtonDown("Select") && !p2Drop)
        {
            Spawn(2, p2Background);
        }
        if (p3.GetButtonDown("Select") && !p3Drop)
        {
            Spawn(3, p3Background);
        }
        if (p4.GetButtonDown("Select") && !p4Drop)
        {
            Spawn(4, p4Background);
        }
        #region
        //if (p1.GetAxis("Horizontal") >= -1 || p1.GetAxis("Vertical") >= -1 )
        //{
        //    if (!p1CharSelected)
        //    {
        //      p1curButt = (myEventSystem.GetComponent<EventSystem>().currentSelectedGameObject).ToString();
        //      CharHover();
        //    }
        //}
        #endregion


        //if (p1CharSelected && p1.GetButtonDown("Cancel"))
        //{
        //    CharacterDeselected();
        //}
    }
예제 #8
0
 void Start()
 {
     PB = this.gameObject.GetComponentInParent <PlayerBackground>();
 }
예제 #9
0
    void OnTriggerEnter2D(Collider2D col)
    {
        if (col.gameObject.tag == "CharacterIcon")
        {
            switch (this.gameObject.name)
            {
            case "p1Cursor":
                col.gameObject.GetComponent <Image>().sprite = p1h;
                PB = p1bkg.GetComponent <PlayerBackground>();
                PB.switchChar(col);
                //Hover(col);
                break;

            case "p2Cursor":
                col.gameObject.GetComponent <Image>().sprite = p2h;
                PB = p2bkg.GetComponent <PlayerBackground>();
                PB.switchChar(col);
                //Hover(col);
                break;

            case "p3Cursor":
                col.gameObject.GetComponent <Image>().sprite = p3h;
                PB = p3bkg.GetComponent <PlayerBackground>();
                PB.switchChar(col);
                //Hover(col);
                break;

            case "p4Cursor":
                col.gameObject.GetComponent <Image>().sprite = p4h;
                PB = p4bkg.GetComponent <PlayerBackground>();
                PB.switchChar(col);
                //Hover(col);
                break;
            }
            #region
            //switch (col.name)
            //{
            //    case "CenterDiamond":
            //        TextObject.GetComponent<Text>().text = "Mercy";
            //        break;
            //    case "NorthDiamond":
            //        TextObject.GetComponent<Text>().text = "Torb";
            //        break;
            //    case "NorthEastDiamond":
            //        TextObject.GetComponent<Text>().text = "Widow";
            //        break;
            //    case "EastDiamond":
            //        TextObject.GetComponent<Text>().text = "McCree";
            //        break;
            //    case "SouthEastDiamond":
            //        TextObject.GetComponent<Text>().text = "Tracer";
            //        break;
            //    case "SouthDiamond":
            //        TextObject.GetComponent<Text>().text = "Mei";
            //        break;
            //    case "SouthWestDiamond":
            //        TextObject.GetComponent<Text>().text = "D.Va";
            //        break;
            //    case "WestDiamond":
            //        TextObject.GetComponent<Text>().text = "Hanjo";
            //        break;
            //    case "NorthWestDiamond":
            //        TextObject.GetComponent<Text>().text = "Genji";
            //        break;
            //    default:
            //        break;
            //}
            #endregion
        }
    }
예제 #10
0
 void Start()
 {
     this.rb = GetComponent <Rigidbody2D>();
     player  = FindObjectOfType <PlayerBackground>();
 }
예제 #11
0
 public void SetBackground(PlayerBackground background)
 {
     icon.sprite        = background.sprite;
     tooltip.background = background;
 }