コード例 #1
0
ファイル: Rocket.cs プロジェクト: vrtex/Astro-Monkey
        private void DealAreaDamage(Core.GameObject toIgnore)
        {
            List <BaseAlien> aliens = SceneManager.Instance.currScene.GetObjectsByClass <Assets.Objects.BaseAlien>();

            foreach (BaseAlien alien in aliens)
            {
                if (toIgnore == alien)
                {
                    continue;
                }

                float distance = (alien.transform.position - transform.position).Length();
                if (distance > areaRange)
                {
                    continue;
                }

                Gameplay.Health health = alien.GetComponent <Gameplay.Health>();
                if (health == null)
                {
                    continue;
                }


                health.DealDamage(new Gameplay.DamageInfo()
                {
                    damageDealer = Damage.damageDealer, value = (int)(Damage.value * 0.5)
                });
            }

            RocketExplosion explosion = new RocketExplosion(new Transform(transform));

            GameManager.SpawnObject(explosion);
        }
コード例 #2
0
        private void InteractHnadler(Gameplay.InteractComponent interactComponent, Core.GameObject interacting)
        {
            Core.Transform newTransofrm = new Core.Transform(transform);
            newTransofrm.position.X += 100;
            newTransofrm.position.Y += 100;
            Banana newBanana = new Banana(newTransofrm);

            Core.GameManager.SpawnObject(newBanana);
        }
コード例 #3
0
 public override void Start(Core.GameObject gameObject)
 {
     base.Start(gameObject);
     if (playOnStart)
     {
         playSound();
         pitchSound(0.92f);
         loopSound(true);
     }
 }
コード例 #4
0
 public Sprite(Core.GameObject go, string _image, List <Rectangle> _rect, float _layer = 0f) : base(go)
 {
     name        = _image;
     image       = SpriteContainer.Instance.GetImage(_image);
     rect        = _rect;
     color       = Util.Statics.Colors.WHITE_1;
     anchor      = Vector2.Zero;
     layer       = _layer;
     stackOffset = 1;
     origin      = new Vector2(rect[0].Width / 2, rect[0].Height / 2);
 }
コード例 #5
0
ファイル: InputUI.cs プロジェクト: vrtex/Astro-Monkey
        public InputUI(Core.GameObject parent) : base(parent)
        {
            ActionBinding clicked;

            clicked = InputManager.Manager.GetActionBinding("click");
            if (clicked == null)
            {
                clicked = new ActionBinding(EMouseButton.Left);
            }

            clicked.OnTrigger += OnClick;

            if (InputManager.Manager.GetActionBinding("click") == null)
            {
                InputManager.Manager.AddActionBinding("click", clicked);
            }

            InputManager.Manager.OnMouseMove += MouseMove;
        }
コード例 #6
0
ファイル: InputComponent.cs プロジェクト: vrtex/Astro-Monkey
        public InputComponent(Core.GameObject parent) : base(parent)
        {
            moveComp = parent.GetComponent <Navigation.MovementComponent>();
            gun      = Parent.GetComponent <Gameplay.Gun>();

            verticalAxis      = new AxisBinding(Keys.S, Keys.W);
            horizontalAxis    = new AxisBinding(Keys.D, Keys.A);
            shootBinding      = new ActionBinding(EMouseButton.Left);
            interactBinding   = new ActionBinding(Keys.E);
            scrollUpBinding   = new ActionBinding(EMouseButton.WheelUp);
            scrollDownBinding = new ActionBinding(EMouseButton.WheelDown);
            reloadBinding     = new ActionBinding(Keys.R);

            pistolSwapBinding   = new ActionBinding(Keys.D1);
            riffleSwapBinding   = new ActionBinding(Keys.D2);
            shotgunSwapBinding  = new ActionBinding(Keys.D3);
            launcherSwapBinding = new ActionBinding(Keys.D4);

            AttachBindings();

            InputManager.Manager.AddAxisBinding(verticalBindingName, verticalAxis);
            InputManager.Manager.AddAxisBinding(horizontalBindingName, horizontalAxis);

            InputManager.Manager.AddActionBinding(shootBindingName, shootBinding);
            InputManager.Manager.AddActionBinding(interactBindName, interactBinding);

            InputManager.Manager.AddActionBinding(scrollDownBindName, scrollDownBinding);
            InputManager.Manager.AddActionBinding(scrollUpBindName, scrollUpBinding);
            InputManager.Manager.AddActionBinding(reloadBindName, reloadBinding);

            InputManager.Manager.AddActionBinding(pistolSwapName, pistolSwapBinding);
            InputManager.Manager.AddActionBinding(riffleSwapName, riffleSwapBinding);
            InputManager.Manager.AddActionBinding(launcherSwapName, launcherSwapBinding);
            InputManager.Manager.AddActionBinding(shotgunSwapName, shotgunSwapBinding);

            moveComp.CurrentFocus             = target;
            InputManager.Manager.OnMouseMove += MoveTarget;
        }
コード例 #7
0
 public Animator(Core.GameObject go) : base(go)
 {
 }
コード例 #8
0
 public MovementComponent(Core.GameObject parent) : base(parent)
 {
 }
コード例 #9
0
 public AnimatorContainer(Core.GameObject go) : base(go)
 {
 }
コード例 #10
0
 public AIAttack(Core.GameObject parent) : base(parent)
 {
 }
コード例 #11
0
ファイル: DamageInfo.cs プロジェクト: vrtex/Astro-Monkey
 public DamageInfo(Core.GameObject damageDealer, int value)
 {
     this.damageDealer = damageDealer;
     this.value        = value;
 }