Example #1
0
 public Brick(ContentManager content, Vector2? location = null)
     : base()
 {
     spriteSheet = content.Load<Texture2D>("brick");
     idleAnimation = new Animation(spriteSheet, new Rectangle(0, 0, spriteSheet.Width, spriteSheet.Height), 1, true, 0);
     locationVector = location ?? Vector2.Zero;
     LoadAnimation(idleAnimation);
 }
Example #2
0
 public virtual void LoadAnimation(Animation animation)
 {
     this.spriteAnimation = animation;
     this.spriteSheet = animation.SpriteSheet;
     this.frames = animation.Frames;
     this.frameTime = animation.FrameTime;
     this.sourceRectangle = frames[currentFrame];
 }
Example #3
0
 public Paddle(ContentManager content, Vector2? startPosition = null)
     : base()
 {
     speed = 0f;
     maxSpeed = 8f;
     spriteSheet = content.Load<Texture2D>("paddle");
     idleAnimation = new Animation(spriteSheet, new Rectangle(0, 0, spriteSheet.Width, spriteSheet.Height), 1, true, 0);
     locationVector = startPosition ?? new Vector2(EggGameMain.ScreenRectangle.Width/2, 200);
     LoadAnimation(idleAnimation);
     gravity = 0.9f;
     friction = 0.1f;
     acceleration = 0.5f;
     inertia = 0;
 }
Example #4
0
        public Ball(ContentManager content, Vector2? startPosition = null)
            : base()
        {
            speed = 300f;
            oneUnit = 100f;

            direction = new Vector2(0, -1);
            direction.Normalize();
            spriteSheet = content.Load<Texture2D>("egg");
            idleAnimation = new Animation(spriteSheet, new Rectangle(0, 0, spriteSheet.Width, spriteSheet.Height), 1, true, 0);
            locationVector = startPosition ?? new Vector2(200, 200);
            LoadAnimation(idleAnimation);
            imCollisionCheck = false;
            radius = spriteSheet.Width / 2;
        }
Example #5
0
 public override void LoadAnimation(Animation animation)
 {
     base.LoadAnimation(animation);
 }