public void Configure(IInputAdapter typeOfInput, ProjectileId defaultProjectile, Vector2 speed, float fireRatio) { movementController.Configure(this, speed); weaponController.Configure(this, defaultProjectile, fireRatio); _inputAdapter = typeOfInput; isConfigure = true; }
public void Configure(IShip ship, ProjectileId defaultProjectile, float fireRatio) { defauldProjectile = defaultProjectile; concurrentProjectil = defauldProjectile; this.ship = ship; fireRateInSeconds = fireRatio; fireRateDeltaTime = fireRateInSeconds; isConfigurated = true; factoryProjectiles = new FactoryProjectiles(Instantiate(factoryProjectilesConfiguration)); }
public IProjectile Spawn(ProjectileId id, Vector2f position, Vector2f velocity, int damage, float knockback) { Log.Debug("Spawning {ProjectileId} at {Position}", id, position); lock (_lock) { var projectileIndex = Terraria.Projectile.NewProjectile( position.X, position.Y, velocity.X, velocity.Y, (int)id, damage, knockback); Debug.Assert(projectileIndex >= 0 && projectileIndex < Count); return(this[projectileIndex]); } }
public ShipBuilder WithPrefabProjectile(ProjectileId projectileId) { _projectileId = projectileId; return(this); }