public static ConveyorSprite GetConveyorSprite(int blockWidth, SpriteOrientation orientation, float rotationSpeed) { ConveyorSprite sprite = new ConveyorSprite(blockWidth, orientation, rotationSpeed); sprite.SetLeftTexture(content.Load <Texture2D>("Sprites\\InteractableSprites\\InteractableDesert\\ConveyorLeft")); sprite.SetMiddleTexture(content.Load <Texture2D>("Sprites\\InteractableSprites\\InteractableDesert\\ConveyorMiddle")); sprite.SetRightTexture(content.Load <Texture2D>("Sprites\\InteractableSprites\\InteractableDesert\\ConveyorRight")); sprite.PrepareConveyor(); return(sprite); }
public Conveyor(Vector2 position, int blockWidth, float speed, SpriteOrientation orientation, float activatedSpeed, SpriteOrientation activatedOrientation, ConveyorSprite sprite) { this.Position = position; this.Velocity = new Vector2(); this.CollisionType = CollisionType.Solid; this.sprite = sprite; this.Size = sprite.GetSize(); this.hitboxTop = new Hitbox(new Vector2(this.Position.X, this.Position.Y - 1), this.Size, Vector2.Zero, CollisionType.Gas); this.hitboxBot = new Hitbox(new Vector2(this.Position.X, this.Position.Y + 1), this.Size, Vector2.Zero, CollisionType.Gas); this.speed = speed; this.activatedSpeed = activatedSpeed; this.directionMultiplier = GetDirectionMultiplier(orientation); this.activatedDirectionMultiplier = GetDirectionMultiplier(activatedOrientation); this.active = false; }