public void CreateFriendlyProjectile(projectileType type, Vector2 location, double lifetime) { Vector2 velocity = new Vector2(0, -7); switch (type) { case projectileType.laser: Projectile newProjectile = new Projectile(textures_[type], 2, 1, location, velocity, 0f, lifetime); //Projectile newProjectile = new Projectile(textures_[type], 1, 2, location, velocity, 0f, lifetime); friendlyProjectiles.Add(newProjectile); break; default: break; } }
static public void CreateEnemyProjectile(projectileType type, Vector2 location, Vector2 velocity, double lifetime) { float angle = (float)(Math.Atan2(velocity.Y, velocity.X) + (Math.PI / 2)); //The axis is shifted 90 degrees for the sprite batches switch (type) { case projectileType.laser: Projectile newProjectile = new Projectile(textures_[type], 2, 1, location, velocity, angle, lifetime); //Projectile newProjectile = new Projectile(textures_[type], 1, 2, location, velocity, 0f, lifetime); enemyProjectiles.Add(newProjectile); break; default: break; } }
public void initialize(GameObject Owner, Transform LaunchPoint, float Damage, float initalVelocity, float angle, projectileType type, Allegiance allegiance, ProjectileName name, float DropRate) { this.gameObject.SetActive(true); this.Owner = Owner.GetComponent <CubePlayer>(); this.transform.position = LaunchPoint.position; this.transform.rotation = LaunchPoint.rotation; this.forward = LaunchPoint.forward; forward.y = 0; this.initalVelocity = initalVelocity; this.angle = angle; this.type = type; this.allegiance = allegiance; this.pName = name; this.dropRate = DropRate; Child = transform.GetChild(0).gameObject; }
public void ShowRangeItemInfo(string name, string description, float value, float weight, float amount, float usage, projectileType projectile, FiringMode firingMode, int magazineSize) { //show range item panel with info in arguments in position of cursor }
//functions public void initialize(GameObject Owner, Transform LaunchPoint, float Damage, float initalVelocity, float angle, projectileType type, Allegiance allegiance, ProjectileName name) { initialize(Owner, LaunchPoint, Damage, initalVelocity, angle, type, allegiance, name, 0f); }
public poolObject getPoolObjectInstancebyType(projectileType myType) { // return myPoolObj[0]; return myPoolObj[(int)myType]; }