| 1234567891011121314151617181920212223242526272829303132333435363738 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Graphics;
- using Tutorial030.Interfaces;
- namespace Tutorial030.Sprites
- {
- public enum PlatformTypes
- {
- Dangerous,
- Safe,
- }
- public class Platform : Sprite, IMoveable
- {
- public Vector2 Velocity { get; set; }
- public PlatformTypes PlatformType;
- public Platform(Texture2D texture)
- : base(texture)
- {
- PlatformType = PlatformTypes.Safe;
- }
- public override void Update(GameTime gameTime)
- {
- Position += Velocity;
- if (Rectangle.Right < 0)
- IsRemoved = true;
- }
- }
- }
|