public GetDamage(ITankLogic pLogic) : base(pLogic) { _basePolygon = new Polygon(0,0, 50,0, 50,50, 0,50); Tank.AddCollider(new PolygonCollider(_basePolygon, CollidableTags.Tank)); Tank.Collider.CenterOrigin(); }
public ControlNetwork(ITankLogic pLogic) : base(pLogic) { if(Program.GameMode.Mode != GameModes.Network) throw new NotSupportedException("The gamemode must be network multiplayer for this to work!"); if(Program.GameMode is NetworkMultiplayer) ((NetworkMultiplayer) Program.GameMode).OnClientData += CommandHandler; }
public ControlNetworkHook(ITankLogic pLogic) : base(pLogic) { if(Program.GameMode.Mode != GameModes.Network) throw new NotSupportedException("The gamemode must be network multiplayer for this to work!"); //at this point we are f****d if the gamemode isnt a client if (Program.GameMode is NetworkMultiplayer) _client = ((NetworkMultiplayer) Program.GameMode).Client; }
public ControlNetwork(ITankLogic pLogic) : base(pLogic) { if (Program.GameMode.Mode != GameModes.Network) { throw new NotSupportedException("The gamemode must be network multiplayer for this to work!"); } if (Program.GameMode is NetworkMultiplayer) { ((NetworkMultiplayer)Program.GameMode).OnClientData += CommandHandler; } }
public ControlNetworkHook(ITankLogic pLogic) : base(pLogic) { if (Program.GameMode.Mode != GameModes.Network) { throw new NotSupportedException("The gamemode must be network multiplayer for this to work!"); } //at this point we are f****d if the gamemode isnt a client if (Program.GameMode is NetworkMultiplayer) { _client = ((NetworkMultiplayer)Program.GameMode).Client; } }
public void AddDecorator(Decorators deco) { switch (deco) { case Decorators.ControlArrow: Logic = new ControlArrow(Logic); break; case Decorators.ControlJoy: Logic = new ControlJoy(Logic); break; case Decorators.ControlSimpleKi: Logic = new ControlSimpleKI(Logic); break; case Decorators.ControlWasd: Logic = new ControlWasd(Logic); break; case Decorators.GetDamage: Logic = new GetDamage(Logic); break; case Decorators.SpeedUp: Logic = new SpeedUp(Logic); break; case Decorators.WallCollider: Logic = new WallCollider(Logic); break; case Decorators.ControlNetwork: Logic = new ControlNetwork(Logic); break; case Decorators.UsePowerUps: Logic = new UsePowerUps(Logic); break; case Decorators.ControlNetworkHook: NetworkHook = new ControlNetworkHook(Logic); Logic = NetworkHook; break; default: throw new ArgumentOutOfRangeException(nameof(deco), deco, null); } }
public Tank(float xPos, float yPos) : base(xPos, yPos) { Console.WriteLine("simpleTank"); _image = new Image("Resources/tank.png"); _image.CenterOrigin(); AddGraphic(_image); Weapon = new Weapon(this); Weapon.addDecorator(ProjectileDecorators.TestBullet); Weapon.addDecorator(ProjectileDecorators.BulletWallCollider); //define this entity as part of the game pause group Group = (int)PauseGroups.NotMenu; //logic can now be instantiated here already Logic = new ProtoLogic(this); }
public ControlArrow(ITankLogic pLogic) : base(pLogic) { }
public ControlSimpleKI(ITankLogic pLogic) : base(pLogic) { }
public ControlWasd(ITankLogic pLogic) : base(pLogic) { }
public WallCollider(ITankLogic pLogic) : base(pLogic) { }
public ControlJoy(ITankLogic pLogic) : base(pLogic) { }
public LogicDecorator(ITankLogic pLogic) { Logic = pLogic; _uppermostLogic = (ProtoLogic)Logic.getUpperMost(); Tank = _uppermostLogic.Tank; }
public GetDamage(ITankLogic pLogic) : base(pLogic) { _basePolygon = new Polygon(0, 0, 50, 0, 50, 50, 0, 50); Tank.AddCollider(new PolygonCollider(_basePolygon, CollidableTags.Tank)); Tank.Collider.CenterOrigin(); }
public UsePowerUps(ITankLogic pLogic) : base(pLogic) { }
public SpeedUp(ITankLogic pLogic) : base(pLogic) { Tank._speed += 5; }