コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
 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;
 }
コード例 #4
0
ファイル: Equipment.cs プロジェクト: tomki-studios/Forgotten
 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
 }
コード例 #5
0
 //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);
 }
コード例 #6
0
ファイル: gameController.cs プロジェクト: wolong91/MageDuel
 public poolObject getPoolObjectInstancebyType(projectileType myType)
 {
     //  return myPoolObj[0];
       return myPoolObj[(int)myType];
 }