Beispiel #1
0
        public Pacman()
        {
            this.listedKey           = true;
            this.Properties.isRotate = true;
            Image stillImage = ImageLoader.LoadImage(Mariopath + "pacman.png");

            Still.AddFrame(stillImage, "", new SizeF(80f, 52f));
            AnimatorList.Add(Still);
            setAnimation(0);
            this.Properties.Direction          = SpriteProperties.Directions.Left;
            this.Properties.CollisionRect.Size = AnimatorList[0].AnimSize;
            this.Properties.RotateAngle        = 20;
        }
Beispiel #2
0
        public RotatingBlock()
        {
            this.Properties.isTile = true;
            Image[] image = new Image[] { ImageLoader.LoadImage(Itempath + "Rotating_Block_Hit_1.png"),
                                          ImageLoader.LoadImage(Itempath + "Rotating_Block_Hit_2.png"),
                                          ImageLoader.LoadImage(Itempath + "Rotating_Block_Hit_3.png") };
            for (int i = 0; i < image.Length; i++)
            {
                animator.AddFrame(image[i], @"", new SizeF(32, 32));
            }
            Image stillImage = ImageLoader.LoadImage(Itempath + "Rotating_Block_Still.png");

            stillanimator.AddFrame(stillImage, @"", new SizeF(32, 32));
            AnimatorList.Add(stillanimator);
            animator.RePlay += new MethodInvoker(animFinish);
            AnimatorList.Add(animator);
            setAnimation(0);
            this.Properties.CollisionRect.Size = AnimatorList[0].AnimSize;
        }
        public QuestionBlock()
        {
            this.Properties.isTile = true;
            Image[] image = new Image[] { ImageLoader.LoadImage(Itempath + "Question_Block_0.png"),
                                          ImageLoader.LoadImage(Itempath + "Question_Block_1.png"),
                                          ImageLoader.LoadImage(Itempath + "Question_Block_2.png"),
                                          ImageLoader.LoadImage(Itempath + "Question_Block_3.png") };
            for (int i = 0; i < image.Length; i++)
            {
                animator.AddFrame(image[i], @"", new SizeF(32, 32));
            }
            Image deadImage = ImageLoader.LoadImage(Itempath + "Question_Block_Dead.png");

            diedanimator.AddFrame(deadImage, @"", new SizeF(32, 32));
            AnimatorList.Add(animator);
            AnimatorList.Add(diedanimator);
            setAnimation(0);
            this.Properties.CollisionRect.Size = AnimatorList[0].AnimSize;
        }
Beispiel #4
0
        public Mario()
        {
            this.listedKey = true;
            this.Properties.GravityValue = .28f;
            Image crouchImage = ImageLoader.LoadImage(Mariopath + "Mario_Big_Crouch.png");
            Image stillImage  = ImageLoader.LoadImage(Mariopath + "Mario_Big_Still.png");
            Image step1Image  = ImageLoader.LoadImage(Mariopath + "Mario_Big_Step1.png");
            Image step2Image  = ImageLoader.LoadImage(Mariopath + "Mario_Big_Step2.png");
            Image jumpImage   = ImageLoader.LoadImage(Mariopath + "Mario_Big_Jump.png");
            Image run1Image   = ImageLoader.LoadImage(Mariopath + "Mario_Big_Run1.png");
            Image run2Image   = ImageLoader.LoadImage(Mariopath + "Mario_Big_Run2.png");
            Image slopeImage  = ImageLoader.LoadImage(Mariopath + "Mario_Slope.png");

            Crouchanim.AddFrame(crouchImage, "", new SizeF(24, 32));
            Stillanim.AddFrame(stillImage, "", new SizeF(32, 52));
            Stepanim.AddFrame(step1Image, @"", new SizeF(32, 52));
            Stepanim.AddFrame(step2Image, @"", new SizeF(32, 52));
            Jumpanim.AddFrame(jumpImage, @"", new SizeF(32, 52));
            Runanim.AddFrame(run1Image, @"", new SizeF(38, 52));
            Runanim.AddFrame(run2Image, @"", new SizeF(38, 52));
            Slopeanim.AddFrame(slopeImage, @"", new SizeF(32, 52));

            AnimatorList.Add(Stillanim);
            AnimatorList.Add(Stepanim);
            AnimatorList.Add(Crouchanim);
            AnimatorList.Add(Jumpanim);
            AnimatorList.Add(Runanim);
            AnimatorList.Add(Slopeanim);
            crouchImage.Dispose();
            stillImage.Dispose();
            step1Image.Dispose();
            step2Image.Dispose();
            jumpImage.Dispose();
            run1Image.Dispose();
            run2Image.Dispose();
            slopeImage.Dispose();
            setAnimation(0);
            this.Properties.Direction          = SpriteProperties.Directions.Left;
            this.Properties.CollisionRect.Size = AnimatorList[0].AnimSize;
        }