コード例 #1
0
        public WormholePair(bool oneInward, Vector2 position, int displayOne) : base()
        {
            one = new Wormhole(oneInward, position, displayOne);
            Audio.Play("wormhole.origin", one.display);

            Vector2 opposite = new Vector2(ScreenManager.window.X - position.X, position.Y);

            two = new Wormhole(!oneInward, opposite, ScreenManager.Opposite(displayOne));
            Audio.Play("wormhole.opposite", two.display);

            float lifespan = Randomizer.RandomInt(10, 20);

            expiry = created.AddSeconds(lifespan);
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: FluxTheGame/engine
        protected override void LoadContent()
        {
            ground = new Ground();
            CloudManager.LoadContent();

            // Load audio
            Audio.MultiSpeakerOutput_Load();

            Dictionary <string, string> audioFiles = new Dictionary <string, string>();

            audioFiles.Add("ambient.flux", "sfx/ambient/flux_v2.1.wav");
            Audio.Load(audioFiles);

            Audio.Play("ambient.flux", 0, 0.3f, true);
            Audio.Play("ambient.flux", 1, 0.3f, true);
            Audio.Play("ambient.flux", 2, 0.3f, true);
            Audio.Play("ambient.flux", 3, 0.3f, true);
            Audio.Play("ambient.flux", 4, 0.3f, true);

            //Preload spritesheets to reduce lag on first-time load
            Wormhole.WormholeAnimations();
            Collector.CollectorAnimations();


            /* For Testing */
            //Add Collector
#if PRODUCTION
#else
            OrderedDictionary c = new OrderedDictionary();
            c.Add("id", 0);
            EventManager.Emit("collector:new", c);

            //Add User

            OrderedDictionary o = new OrderedDictionary();
            o.Add("id", 0);
            o.Add("teamId", 0);
            o.Add("username", "DILBERT");
            o.Add("display", 0);
            EventManager.Emit("user:new", o);
#endif

            /* End for testing */
        }
コード例 #3
0
        private void TriggerSuction(GameObject passenger, Wormhole endpoint)
        {
            float max = passenger.scale;

            passenger.disabled = true;
            Tweenerizer.Ease(EasingType.EaseIn, 0, 1, 300,
                             // update with easing
                             (ease, incr) => passenger.scale = max - (ease * max),
                             // on complete
                             () => {
                // move to new display
                Transport(passenger, endpoint);
                // scale back up
                Tweenerizer.Ease(EasingType.EaseOut, 0, 1, 300,
                                 (ease, incr) => passenger.scale = (ease * max));
                // it's aliiiiive!
                passenger.disabled = false;
            });
        }
コード例 #4
0
 private void Transport(GameObject passenger, Wormhole destination)
 {
     passenger.display  = destination.display;
     passenger.position = destination.position;
 }