public override bool OnPlayerInput(int playerIndex, DDW.Input.Move move, TimeSpan time)
 {
     if (move == DDW.Input.Move.ButtonA)
     {
         MenuState ms = MenuState.QuickGame;
         ((StartScreen)parent).SetPanel(ms, playerIndex);
     }
     return true;
 }
 public override bool OnPlayerInput(int playerIndex, DDW.Input.Move move, System.TimeSpan time)
 {
     bool result = base.OnPlayerInput(playerIndex, move, time );
     if (move.Releases == Microsoft.Xna.Framework.Input.Buttons.A)
     {
         result = false;
         videoPlayer.Stop();
     }
     return result;
 }
 public override bool OnPlayerInput(int playerIndex, DDW.Input.Move move, TimeSpan time)
 {
     bool result = base.OnPlayerInput(playerIndex, move, time);
     if (result && isActive)
     {
         if ((move.Releases & Buttons.A) != 0) // == Move.ButtonA)
         {
             Continue(this, null);
             result = false;
         }
     }
     return result;
 }
 public override bool OnPlayerInput(int playerIndex, DDW.Input.Move move, TimeSpan time)
 {
     bool result = base.OnPlayerInput(playerIndex, move, time);
     if (result && isActive)
     {
         if (move == Move.Start)
         {
             Unpause(this, null);
             result = false;
         }
     }
     return result;
 }
Example #5
0
        public void Convert(VexObject vo, DDW.Swf.SwfCompilationUnit scu)
        {
            curVo = vo;
            this.scu = scu;
            Init();
            FilterMarkers();
            ParseActions();
            ParseTimeline(curVo.Root);
            GenerateWorldActionData(); // temp
            GenerateBitamps();

            //genV2d = new GenV2DWorld(this, paths);
            //genV2d.Generate();
        }
        public override bool OnPlayerInput(int playerIndex, DDW.Input.Move move, TimeSpan time)
        {
            bool result = base.OnPlayerInput(playerIndex, move, time);

            if (result && isActive)
            {
                if (move == Move.ButtonA)
                {
                    bool needsSignIn = false;
            #if XBOX
                    //needsSignIn = playerIndex >= SignedInGamer.SignedInGamers.Count || SignedInGamer.SignedInGamers[playerIndex] == null;
                    //if (needsSignIn)
                    //{
                    //    ShowSignIn();
                    //}
            #endif
                    InputManager im = screen.inputManagers[playerIndex];
                    playerIndicatorLights.piLight[playerIndex].GotoAndStop(1);

                    if (!needsSignIn)
                    {
                        result = false;
                        if (im.PlayerJoinState == PlayerJoinState.NotJoined)
                        {
                            im.PlayerJoinState = PlayerJoinState.Joined;
                            needsUpdate = true;
                        }
                        else
                        {
                            ((StartScreen)parent).SetPanel(MenuState.MainMenu, playerIndex);
                        }
                    }
                }
                else if (move == Move.ButtonB || ((int)move.Releases & (int)Microsoft.Xna.Framework.Input.Buttons.B) > 0)
                {
                    result = false;
                    playerIndicatorLights.piLight[playerIndex].GotoAndStop(0);
                    if (screen.inputManagers[playerIndex].PlayerJoinState > PlayerJoinState.NotJoined)
                    {
                        screen.inputManagers[playerIndex].PlayerJoinState = PlayerJoinState.NotJoined;
                        needsUpdate = true;
                    }
                }
                if (move == Move.ButtonX)
                {
                    ShowSignIn();
                }
            }
            return result;
        }
Example #7
0
        public void Convert(VexObject vo, DDW.Swf.SwfCompilationUnit scu)
        {
            curVo = vo;
            Init(scu);
            FilterMarkers();
            ParseActions(scu);
            ParseRootTimeline();
            ParseNamedDefinitions();
            GenerateWorldActionData();

            Gdi.GdiRenderer gr = new Gdi.GdiRenderer();
            Dictionary<string, List<Bitmap>> bmps = new Dictionary<string, List<Bitmap>>();
            gr.GenerateFilteredBitmaps(vo, usedImages, bmps);

            gr.ExportBitmapsAsPremultiplied(bmps);

            genV2d = new GenV2DWorld(this, usedImages);
            genV2d.Generate();
        }
Example #8
0
        public override bool OnPlayerInput(int playerIndex, DDW.Input.Move move, TimeSpan time)
        {
            bool result = base.OnPlayerInput(playerIndex, move, time);

            if (result && isActive)
            {
                if (move == Move.ButtonA)
                {
                    NextPitch();
                    result = false;
                }
                else if (move == Move.ButtonX)
                {
                    SleepwalkerGame.instance.UnlockTrial();
                    result = false;
                }
            }
            return result;
        }
 public override bool OnPlayerInput(int playerIndex, DDW.Input.Move move, TimeSpan time)
 {
     bool result = base.OnPlayerInput(playerIndex, move, time);
     if (result && isActive && Visible)
     {
         if ((move.Releases & Buttons.A) != 0)
         {
             if (delayTime > 2000)
             {
                 Continue(this, null);
                 result = false;
             }
             else
             {
                 canAdvance = true;
             }
         }
     }
     return result;
 }
        public override bool OnPlayerInput(int playerIndex, DDW.Input.Move move, TimeSpan time)
        {
            bool result = base.OnPlayerInput(playerIndex, move, time);

            if (result && isActive)// && !Guide.IsVisible)
            {
                if (move == Move.Left)
                {
                    PreviousFocus();
                }
                else if (move == Move.Right)
                {
                    NextFocus();
                }
                else if (focusIndex > -1 && move == Move.ButtonA)
                {
                    levelSelected = true;
                }
                else if (move == Move.Empty)
                {
                }
            }
            return result;
        }
Example #11
0
        private void ParseActions(DDW.Swf.SwfCompilationUnit scu)
        {
            List<DDW.Swf.DoActionTag> dat = new List<DDW.Swf.DoActionTag>();
            foreach (DDW.Swf.ISwfTag tag in scu.Tags)
            {
                if (tag is DDW.Swf.DoActionTag)
                {
                    dat.Add((DDW.Swf.DoActionTag)tag);
                }
            }

            foreach (DDW.Swf.DoActionTag tag in dat)
            {
                DDW.Swf.ConstantPool cp = null;
                List<string> stack = new List<string>();
                for (int i = 0; i < tag.Statements.Count; i++)
                {
                    DDW.Swf.IAction a = tag.Statements[i];
                    if (a is DDW.Swf.ConstantPool)
                    {
                        cp = (DDW.Swf.ConstantPool)a;
                    }
                    else if (a is DDW.Swf.SetMember)
                    {
                        if (stack.Count > 2)
                        {
                            string s0 = stack[0];
                            string s1 = stack[1];
                            string s2 = stack[2];
                            if (!codeData.ContainsKey(s0))
                            {
                                codeData.Add(s0, new Dictionary<string, string>());
                            }
                            Dictionary<string, string> targData = codeData[s0];
                            targData.Add(s1, s2);
                        }
                        stack.Clear();
                    }
                    else if (a is DDW.Swf.Push)
                    {
                        DDW.Swf.Push push = (DDW.Swf.Push)a;
                        for (int j = 0; j < push.Values.Count; j++)
                        {
                            DDW.Swf.IPrimitive v = push.Values[j];
                            switch (v.PrimitiveType)
                            {
                                case DDW.Swf.PrimitiveType.String:
                                    stack.Add(((DDW.Swf.PrimitiveString)v).StringValue);
                                    break;

                                case DDW.Swf.PrimitiveType.Constant8:
                                    stack.Add(cp.Constants[((DDW.Swf.PrimitiveConstant8)v).Constant8Value]);
                                    break;
                                case DDW.Swf.PrimitiveType.Constant16:
                                    stack.Add(cp.Constants[((DDW.Swf.PrimitiveConstant16)v).Constant16Value]);
                                    break;

                                case DDW.Swf.PrimitiveType.Integer:
                                    stack.Add(((DDW.Swf.PrimitiveInteger)v).IntegerValue.ToString());
                                    break;
                                case DDW.Swf.PrimitiveType.Float:
                                    stack.Add(((DDW.Swf.PrimitiveFloat)v).FloatValue.ToString());
                                    break;
                                case DDW.Swf.PrimitiveType.Double:
                                    stack.Add(((DDW.Swf.PrimitiveDouble)v).DoubleValue.ToString());
                                    break;
                                case DDW.Swf.PrimitiveType.Boolean:
                                    stack.Add(((DDW.Swf.PrimitiveBoolean)v).BooleanValue.ToString().ToLowerInvariant());
                                    break;
                                case DDW.Swf.PrimitiveType.Null:
                                    stack.Add("null");
                                    break;
                                case DDW.Swf.PrimitiveType.Undefined:
                                    stack.Add("null");
                                    break;
                            }
                        }
                    }
                }
            }
        }
Example #12
0
        public void Init(DDW.Swf.SwfCompilationUnit scu)
        {
            root = new Definition2D();
            root.DefinitionName = V2D.ROOT_NAME;
            root.LinkageName = V2D.ROOT_NAME;
            root.Bounds = Rectangle.Empty;
            root.FrameCount = 1;
            definitions.Add(root);

            rootInstance = new Instance2D(V2D.ROOT_NAME, root.DefinitionName, 0, 0, 0, 1, 1);
            rootInstance.Definition = root;
            rootInstance.Transforms.Add(new Transform(
                0,
                (uint)(scu.Header.FrameCount * (1000 / scu.Header.FrameRate)),
                new Matrix(1, 0, 0, 1, 0, 0),
                1,
                ColorTransform.Identity));

            parentStack.Push(rootInstance);
        }
Example #13
0
        public override bool OnPlayerInput(int playerIndex, DDW.Input.Move move, System.TimeSpan time)
        {
            bool result = base.OnPlayerInput(playerIndex, move, time);

            if (!gameOverlay.hasActivePanel)
            {
                if (result && move.Releases == Buttons.X)
                {
                    ResetLevel();
                }
                if (result && move == Move.Start)
                {
                    SleepwalkerGame.activeController = (PlayerIndex)playerIndex;
                    gameOverlay.PauseGame();
                }
                //else if (result && move.Releases == Buttons.LeftShoulder)
                //{
                //    SkipLevel();
                //}
            }
            //else if (result && levelOver && move.Releases == Buttons.A && endDelay <= 0)
            //{
            //    levelOver = false;
            //    DestroyView();
            //    stage.NextScreen();
            //}

            return false;
        }
Example #14
0
        private void DrawText(Text tx, DDW.Vex.Matrix m)
        {
            for (int i = 0; i < tx.TextRuns.Count; i++)
            {
                TextRun tr = tx.TextRuns[i];
                string s = tr.Text;
                FontStyle style = tr.isBold ? FontStyle.Bold : FontStyle.Regular;
                if (tr.isItalic)
                {
                    style |= FontStyle.Italic;
                }

                Font font = new Font(tr.FontName, tr.FontSize, style, GraphicsUnit.Pixel);

                System.Drawing.Color col = System.Drawing.Color.FromArgb(tr.Color.A, tr.Color.R, tr.Color.G, tr.Color.B);
                Brush b = new SolidBrush(col);

                g.SmoothingMode = SmoothingMode.HighQuality;
                g.InterpolationMode = InterpolationMode.HighQualityBicubic;
                g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
                g.CompositingMode = CompositingMode.SourceOver;
                g.CompositingQuality = CompositingQuality.HighQuality;

                g.DrawString(s, font, b, tx.Matrix.TranslateX + m.TranslateX + tr.Left, tx.Matrix.TranslateY + m.TranslateY + tr.Top);

                b.Dispose();
            }
        }
 public override bool OnPlayerInput(int playerIndex, DDW.Input.Move move, TimeSpan time)
 {
     return base.OnPlayerInput(playerIndex, move, time);
 }
Example #16
0
 void Trampoline_PlayheadWrap(DDW.Display.DisplayObjectContainer sender)
 {
     tramp.GotoAndStop(0);
     tramp.PlayheadWrap -= new V2DRuntime.Display.AnimationEvent(Trampoline_PlayheadWrap);
 }
 protected override void DrawChild(DDW.Display.DisplayObject d, SpriteBatch batch)
 {
     base.DrawChild(d, batch);
 }