예제 #1
0
        public static void InitialGame_2()
        {
            Heroine h = new Heroine(0, 400, 100, 100, "唐妮");
            //Boss
            Monster boss = FactoryM.createMonster(1500, 270, "Boss");

            Goods fire   = FactoryGoods.createGoods(750, 620, "Fire");
            Goods blood  = FactoryGoods.createGoods(900, 600, "Blood");
            Goods blood1 = FactoryGoods.createGoods(750, 530, "Blood");
            Goods gold   = FactoryGoods.createGoods(760, 460, "Gold");
            Goods gold_1 = FactoryGoods.createGoods(200, 320, "Gold");
            Goods gold_2 = FactoryGoods.createGoods(230, 320, "Gold");
            Goods gold_3 = FactoryGoods.createGoods(260, 320, "Gold");
            Goods gold_4 = FactoryGoods.createGoods(290, 320, "Gold");
            Goods Door   = FactoryGoods.createGoods(2750, 270, "Door");
            Goods torch  = FactoryGoods.createGoods(150, 270, "Torch");
            Goods torch1 = FactoryGoods.createGoods(500, 270, "Torch");
            Goods foods  = FactoryGoods.createGoods(500, 320, "Foods");

            //UI
            Life     life_UI  = new Life(50, 10, 20, 20);
            Listing  list_UI  = new Listing(600, 30);
            BossLife bossLife = new BossLife(700, 20, 20, 20);

            Hero_GetGoods gold_list = new Hero_GetGoods();

            //记录窗体信息
            //加载背景图片
            //BackGround backGround = new BackGround(0, 0, 20);


            SingleObject.GetSingle().AddGameObject(new BackGround(0, 0, 20));
            //SingleObject.GetSingle().AddGameObject(backGround);
            SingleObject.GetSingle().BG.BGImage = Properties.Resources.Caverns;
            SingleObject.GetSingle().BG.BGunder = Properties.Resources.Caverns1;
            //rec = new Rectangle(form.Location, form.Size);
            SingleObject.GetSingle().BG.SetCamera(rec);
            //加载测试游戏对象
            SingleObject.GetSingle().BG.TP = h;
            //加入物品
            SingleObject.GetSingle().BG.ListMonster.Add(boss);
            SingleObject.GetSingle().BG.ListGoods.Add(fire);
            SingleObject.GetSingle().BG.ListGoods.Add(blood);
            SingleObject.GetSingle().BG.ListGoods.Add(blood1);
            SingleObject.GetSingle().BG.ListGoods.Add(gold);
            SingleObject.GetSingle().BG.ListGoods.Add(gold_1);
            SingleObject.GetSingle().BG.ListGoods.Add(gold_2);
            SingleObject.GetSingle().BG.ListGoods.Add(gold_3);
            SingleObject.GetSingle().BG.ListGoods.Add(gold_4);
            SingleObject.GetSingle().BG.ListGoods.Add(torch);
            SingleObject.GetSingle().BG.ListGoods.Add(torch1);
            SingleObject.GetSingle().BG.ListGoods.Add(Door);
            SingleObject.GetSingle().BG.ListGoods.Add(foods);
            //加载UI界面
            SingleObject.GetSingle().AddGameObject(life_UI);
            SingleObject.GetSingle().AddGameObject(list_UI);
            SingleObject.GetSingle().AddGameObject(bossLife);
            //创建金币集对象
            SingleObject.GetSingle().BG.GoldList = gold_list;
        }
예제 #2
0
 void OnEnable()
 {
     //Asign the objects to variables
     player         = GameObject.FindGameObjectWithTag("Player");
     dashDampScript = player.GetComponent <DashDamp>();
     bossLifeScript = bossContainer.GetComponent <BossLife>();
 }
예제 #3
0
    string prevState;                 // 前の状態を保存

    void Start()
    {
        this.animator = GetComponent <Animator>();
        this.rb       = GetComponent <Rigidbody2D>();
        life          = FindObjectOfType <BossLife>();
        key           = FindObjectOfType <Key>();
        sound01       = GetComponent <AudioSource>();
        state         = "USUALLY";
    }
예제 #4
0
    public CorePlayBossWar(CorePlayInputCheck inputCheck)
    {
        m_Timer = 0;
        m_CurrentSentenceIndex = 0;
        m_TapCreator           = new CorePlayBossTapCreator();
        m_VoiceCheck           = new BossWarVoiceCheck(this);
        m_BossLife             = new BossLife(CorePlayData.BossLife);

        CorePlaySceneManager.bossEnterFinishEvent.AddListener(CGFinishCallback);
        SetEventListener(BossAttackFinishEvent, BossAttackFinishCallback);
        SetEventListener(BossFinishEvent, BossFinishCallback);
        m_InputCheck = inputCheck;
        m_Status     = Status.Idle;
    }
예제 #5
0
 public void AddGameObject(GameObject go)
 {
     if (go is BackGround)
     {
         BG = go as BackGround;
     }
     if (go is Life)
     {
         life = go as Life;
     }
     if (go is Listing)
     {
         list_UI = go as Listing;
     }
     if (go is BossLife)
     {
         boss_UI = go as BossLife;
     }
 }
예제 #6
0
 void Start()
 {
     rend           = GetComponent <Renderer>();
     life           = FindObjectOfType <BossLife>();
     life.minusLife = true;
 }
예제 #7
0
	// Use this for initialization
	void Start () 
	{
		instance = this;

		level = 0;

		illusions = new List<IllusionBossCopy>();
		waypointsAlreadyChosen = new List<Vector3>();

		waypoints = new List<Vector3>();
		waypoints.Add(new Vector3(0.2f, 0.2f));//bottom left
		waypoints.Add(new Vector3(0.2f, 0.5f));//center left
		//waypoints.Add(new Vector3(0.2f, 0.8f));//top left
		waypoints.Add(new Vector3(0.8f, 0.2f));//bottom right
		waypoints.Add(new Vector3(0.8f, 0.5f));//center right
		waypoints.Add(new Vector3(0.8f, 0.8f));//top right

		//convert waypoint to world space
		for(byte i = 0; i < waypoints.Count; i++)
		{
			Vector3 waypoint = Camera.main.ViewportToWorldPoint(waypoints[i]);
			waypoint.z = transform.position.z;

			waypoints[i] = waypoint;
		}

		Vector3 pos = Camera.main.ViewportToWorldPoint(new Vector3(0.5f, 0.5f));
		pos.z = 0;
		transform.position = pos;
		transform.rotation = Quaternion.Euler(0, 0, -90f);

		mySprite = transform.FindChild("Sprite").GetComponent<SpriteRenderer>();
		myColliders = GetComponentsInChildren<Collider2D>();
		myTransform = transform;
		myRigidbody2D = GetComponent<Rigidbody2D>();
		spawnPosition = transform.FindChild("Spawn");
		bossLife = GetComponent<BossLife>();

		cameraShake = GetComponent<CameraShake>();
		totalLife = bossLife.life;
		lifePerLevel = totalLife / levels.Count;

		brilhos = new List<GameObject>();
		foreach(Transform brilho in mySprite.transform)
			brilhos.Add(brilho.gameObject);

		StartCoroutine(Appear());
	}