コード例 #1
0
 public override void Create()
 {
     //Load Sprites
     Sprite     = Sprites.GetSprite("spr_spindle");
     Dimensions = new MathClasses.Vector2(Sprite.width, Sprite.height);
     Origin     = Dimensions / 2;
     Position   = new MathClasses.Vector2(Program.GameWidth / 2, Program.GameHeight / 2);
 }
コード例 #2
0
        //Shoot a bullet
        public void ShootBullet(MathClasses.Vector2 NewPosition, float DegreeRotation, float Speed)
        {
            SpindleBullet sb = new SpindleBullet(gameScene, BulletSprite);

            sb.Position = NewPosition;
            sb.Velocity = new MathClasses.Vector2((float)Math.Cos((DegreeRotation) * DEG2RAD), (float)Math.Sin((DegreeRotation) * DEG2RAD)) * Speed;
            sb.Rotation = DegreeRotation;
            gameScene.SpindleBullets.Add(sb);
        }