Esempio n. 1
0
 public Jellyfish(Actor actor, LevelTransition transition) : base(actor)
 {
     this.fish                = RequireComponent <Fish>();
     this.HasEnded            = false;
     this.transition          = transition;
     transition.onFallAsleep += RunAwayAndDie;
 }
Esempio n. 2
0
        public EyeRenderer(Actor actor, Player player, LevelTransition levelTransition) : base(actor)
        {
            this.player                        = player;
            this.levelTransition               = levelTransition;
            this.levelTransition.onWakeUp     += WakeUpAnimation;
            this.levelTransition.onFallAsleep += FallAsleepAnimation;

            this.openAmountAccessors = new TweenAccessors <float>(() => this.openPercent, val => this.openPercent = val);
            this.eyeTween            = new TweenChain();

            BuildEye(20);
        }
Esempio n. 3
0
        public Harness(Actor actor) : base(actor)
        {
            this.bubbleSpawner   = RequireComponent <BubbleSpawner>();
            this.levelTransition = RequireComponent <LevelTransition>();
            wires = new Wire[7];

            this.disconnectTween = new TweenChain();

            var rand = MachinaGame.Random.DirtyRandom;

            wires[0] = new Wire(new Vector2(rand.Next(-40, 40), -200 - rand.Next(0, 50)), new Vector2(-47, -100));
            wires[1] = new Wire(new Vector2(rand.Next(-40, 40), -200 - rand.Next(0, 50)), new Vector2(-60, -110));
            wires[2] = new Wire(new Vector2(rand.Next(-40, 40), -200 - rand.Next(0, 50)), new Vector2(-25, -115));
            wires[3] = new Wire(new Vector2(rand.Next(-40, 40), -200 - rand.Next(0, 50)), new Vector2(0, -120));
            wires[4] = new Wire(new Vector2(rand.Next(-40, 40), -200 - rand.Next(0, 50)), new Vector2(70, -130));
            wires[5] = new Wire(new Vector2(rand.Next(-40, 40), -200 - rand.Next(0, 50)), new Vector2(45, -90));
            wires[6] = new Wire(new Vector2(rand.Next(-40, 40), -200 - rand.Next(0, 50)), new Vector2(55, -120));
        }
Esempio n. 4
0
        public Seaweed(Actor actor, float length, int numberOfNodes, float swayFactorCoef, LevelTransition levelTransition) : base(actor)
        {
            this.length     = length;
            this.swayFactor = 1f / swayFactorCoef;
            this.baseAngle  = transform.Angle;

            this.nodes = new Node[numberOfNodes];
            for (int i = 0; i < numberOfNodes; i++)
            {
                var sign = i % 2 == 0 ? -1 : 1;
                this.nodes[i] = new Node(this, (this.length / (numberOfNodes - 1) * i), 40, MathF.PI / 3 * sign);
            }

            this.time = (float)MachinaGame.Random.CleanRandom.NextDouble() * MathF.PI * 2;

            this.levelTransition = levelTransition;
            this.levelTransition.onFallAsleep += AddDestroyTimer;
        }
Esempio n. 5
0
 public Player(Actor actor) : base(actor)
 {
     this.levelTransition = RequireComponent <LevelTransition>();
 }
Esempio n. 6
0
 public TextCrawlRenderer(Actor actor, LevelTransition levelTransition) : base(actor)
 {
     this.textRenderer    = RequireComponent <BoundedTextRenderer>();
     this.levelTransition = levelTransition;
 }