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); }
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); }
public override void Start(Core.GameObject gameObject) { base.Start(gameObject); if (playOnStart) { playSound(); pitchSound(0.92f); loopSound(true); } }
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); }
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; }
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; }
public Animator(Core.GameObject go) : base(go) { }
public MovementComponent(Core.GameObject parent) : base(parent) { }
public AnimatorContainer(Core.GameObject go) : base(go) { }
public AIAttack(Core.GameObject parent) : base(parent) { }
public DamageInfo(Core.GameObject damageDealer, int value) { this.damageDealer = damageDealer; this.value = value; }