コード例 #1
0
        public Spider(float xDeathZone)
        {
            Name               = "Spider";
            Height             = Width = 50;
            ShowDamage         = false;
            ShowDefaultDrawing = false;
            XDeathZone         = xDeathZone;
            JumpNextTime       = false;
            InDeathSequence    = -1; // < 0 means not in sequence, 0 means time to die

            // reduce maximum height on jumping
            MaxYForcePercentage = 0.6f;

            // setup
            var move = new ImageSource[] { new ImageSource(path: @"media\spider.r.0.png"), new ImageSource(path: @"media\spider.r.1.png"), new ImageSource(path: @"media\spider.r.2.png"), new ImageSource(path: @"media\spider.r.3.png") };

            Motion = new InMotion(
                new ImageSet[]
            {
                new ImageSet()
                {
                    Action = MotionAction.Left, PerImageLimit = 200, Images = move
                },
                new ImageSet()
                {
                    Action = MotionAction.Right, PerImageLimit = 200, Images = move
                },
                new ImageSet()
                {
                    Action = MotionAction.Idle, PerImageLimit = 400, Images = new ImageSource[] { new ImageSource(path: @"media\spider.d.0.png"), new ImageSource(path: @"media\spider.d.1.png"), new ImageSource(path: @"media\spider.d.2.png"), new ImageSource(path: @"media\spider.d.3.png") }
                }
            },
                X,
                Y
                );
            Motion.IdleLimit = 5000; // not possible unless set
            Rand             = new Random();
        }
コード例 #2
0
ファイル: stickario.cs プロジェクト: speedyjeff/stickario
        public Stickario()
        {
            Name               = "Stickario";
            Width              = 50;
            Health             = 75;
            ShowDefaultDrawing = false;
            Coins              = 0;

            // track motion and handle images
            Motion = new InMotion(
                new ImageSet[]
            {
                new ImageSet()
                {
                    Action = MotionAction.Idle, PerImageLimit = 250, Images = new ImageSource[] { new ImageSource(path: @"media\idle.0.png"), new ImageSource(path: @"media\idle.1.png") }
                },
                new ImageSet()
                {
                    Action = MotionAction.Up, PerImageLimit = 250, Images = new ImageSource[] { new ImageSource(path: @"media\up.0.png"), new ImageSource(path: @"media\up.1.png") }
                },
                new ImageSet()
                {
                    Action = MotionAction.Left, PerImageLimit = 250, Images = new ImageSource[] { new ImageSource(path: @"media\run.l.0.png"), new ImageSource(path: @"media\run.l.1.png"), new ImageSource(path: @"media\run.l.2.png") }
                },
                new ImageSet()
                {
                    Action = MotionAction.Right, PerImageLimit = 250, Images = new ImageSource[] { new ImageSource(path: @"media\run.r.0.png"), new ImageSource(path: @"media\run.r.1.png"), new ImageSource(path: @"media\run.r.2.png") }
                },
                new ImageSet()
                {
                    Action = MotionAction.Down, PerImageLimit = 250, Images = new ImageSource[] { new ImageSource(path: @"media\down.0.png"), new ImageSource(path: @"media\down.1.png") }
                }
            },
                X,
                Y
                );
        }