public override void Active() { base.Active(); //TODO 更新コンテナに自分を入れる hintArea = new C_Collider_PointInHintArea(imgName, areaCentre, areaSize); hintArea.Active(); TaskManager.AddTask(hintArea); }
public override void Active() { base.Active(); //TODO 更新コンテナに自分を入れる draw = new C_DrawIceRoute(startPosition, endPosition); childRightStop = new C_Collider_PointInHintArea("childRightStop", endPosition - Vector2.One * 20, Vector2.One * 100); childLeftStop = new C_Collider_PointInHintArea("childLeftStop", startPosition - new Vector2(-20, 20), Vector2.One * 100); draw.Active(); childRightStop.Active(); childLeftStop.Active(); TaskManager.AddTask(draw); TaskManager.AddTask(childRightStop); TaskManager.AddTask(childLeftStop); }
public override void Active() { base.Active(); //TODO 更新コンテナに自分を入れる //DamageAreaの設置 startPosition = BezierStage.GetControllPointPosition(startPoint_LB[0], startPoint_LB[1] + 1); endPosition = BezierStage.GetControllPointPosition(startPoint_LB[0], startPoint_LB[1] + 7); Vector2 damageAreaRY = BezierStage.GetControllPointPosition(startPoint_LB[0], startPoint_LB[1] + 4); Vector2 damageAreaSize = new Vector2( endPosition.X - startPosition.X, damageAreaRY.Y - startPosition.Y); damageArea = new C_Collider_PointInHintArea("WastelandDamage", startPosition + damageAreaSize / 2, damageAreaSize); damageArea.Active(); TaskManager.AddTask(damageArea); //Route生成用エリアの設置 Vector2 createRouteAreaLT = BezierStage.GetControllPointPosition(startPoint_LB[0], startPoint_LB[1] + 1); Vector2 createRouteAreaRB = BezierStage.GetControllPointPosition(startPoint_LB[0], startPoint_LB[1] + 7); createRouteAreaLT.Y -= 50; Vector2 createRouteAreaSize = createRouteAreaRB - createRouteAreaLT; createRouteArea = new C_Collider_Square("CanCreateRoute", createRouteAreaLT + createRouteAreaSize / 2, createRouteAreaSize); createRouteArea.Active(); TaskManager.AddTask(createRouteArea); //ChildControll用エリア設置 C_Collider_PointInHintArea childJump1 = new C_Collider_PointInHintArea("ChildJump", startPosition, Vector2.One * 60); C_Collider_PointInHintArea childJump2 = new C_Collider_PointInHintArea("ChildJump", endPosition, Vector2.One * 60); childJump1.Active(); childJump2.Active(); TaskManager.AddTask(childJump1); TaskManager.AddTask(childJump2); stopRight = new C_Collider_PointInHintArea("ChildStopR", startPosition, Vector2.One * 100); stopLeft = new C_Collider_PointInHintArea("ChildStopL", endPosition, Vector2.One * 100); stopRight.Active(); stopLeft.Active(); TaskManager.AddTask(stopRight); TaskManager.AddTask(stopLeft); }
protected override eStateTrans UpdateAction(Entity entity, ref IState <Entity> nextState) { //下ジャンプに遷移 if (JumpDownCheck(entity)) { routeEffect.Sleep(); float nowSpeed = moveComp.speed; entity.RemoveComponent(moveComp); nextState = new JumpState_Com_Player(gameDevice, eJumpType.Down, nowSpeed); return(eStateTrans.ToNext); } //落下に遷移 if (state.IsJump) { routeEffect.Sleep(); float nowSpeed = moveComp.speed; entity.RemoveComponent(moveComp); nextState = new JumpState_Com_Player(gameDevice, eJumpType.Fall, nowSpeed); return(eStateTrans.ToNext); } //Jumpに遷移 if (inputState.WasDown(Keys.Space, Buttons.A)) { //子生物誘導ヒントを作る C_Collider_PointInHintArea hint = new C_Collider_PointInHintArea("ChildJump", entity.transform.Position, Vector2.One * 40); hint.Active(); hint.Destroy(2); TaskManager.AddTask(hint); routeEffect.Sleep(); float nowSpeed = moveComp.speed; entity.RemoveComponent(moveComp); nextState = new JumpState_Com_Player(gameDevice, eJumpType.Up, nowSpeed); return(eStateTrans.ToNext); } //攻撃 if (inputState.IsDown(Keys.F, Buttons.B)) { routeEffect.Sleep(); entity.RemoveComponent(moveComp); nextState = new AttackState_Com_Player(gameDevice); return(eStateTrans.ToNext); } //Skill選択に遷移 if (inputState.WasDown(Keys.Z, Buttons.LeftShoulder)) { routeEffect.Sleep(); entity.RemoveComponent(moveComp); nextState = new SkillSelect_Com(gameDevice); return(eStateTrans.ToNext); } //Damage判定 if (CollitionCheck(entity)) { entity.RemoveComponent(moveComp); collider.DeActive(); nextState = new DeathState_Com("Bom", gameDevice); return(eStateTrans.ToNext); } //Skill発動 if (seasonState.IsCanSkill() && inputState.WasDown(Keys.X, Buttons.RightShoulder)) { DrawComponent drawSkill = new C_DrawSkillCircle(true, 100); entity.RegisterComponent(drawSkill); ColliderComponent skillCollider = new C_Collider_Circle("PlayerSkill", new Vector2(0, -120), 400); entity.RegisterComponent(skillCollider); skillCollider.Destroy(3); seasonState.CoolingSkill(); } nextState = this; return(eStateTrans.ToThis); }