Example #1
0
        void create_standhero()
        {
            Graphics g   = this.CreateGraphics();
            ccal     pnn = new ccal();

            pnn.xs = 500;
            pnn.ys = 500;

            //   pnn.im = new List<Bitmap>();


            Bitmap pp = new Bitmap("actor1.bmp");

            pp.MakeTransparent(pp.GetPixel(0, 0));
            pnn.pt = pp;


            L_standhero.Add(pnn);
        }
Example #2
0
        void create_movinghero()
        {
            Graphics g   = this.CreateGraphics();
            ccal     pnn = new ccal();

            pnn.xs = L_standhero[0].rcD.X;
            pnn.ys = L_standhero[0].rcD.Y;
            pnn.im = new List <Bitmap>();
            for (int i = 1; i <= 3; i++)
            {
                Bitmap pp = new Bitmap("actor" + (i) + ".bmp");
                pp.MakeTransparent(pp.GetPixel(0, 0));
                pnn.im.Add(pp);
            }



            L_movehero.Add(pnn);
        }
Example #3
0
        void DrawScene(Graphics g2)
        {
            ccal      pnn = new ccal();
            Bitmap    n   = new Bitmap("back.jpg");
            Rectangle rcD = new Rectangle(0, 0, this.ClientSize.Width + 1200, this.ClientSize.Height + 500);
            Rectangle rcS = new Rectangle(0, 0, this.ClientSize.Width, this.ClientSize.Height);

            g2.DrawImage(n, rcD, rcS, GraphicsUnit.Pixel);


            g2.DrawImage(L_standhero[0].pt, L_standhero[0].cx, L_standhero[0].cy);

            if (flagrun == 1)
            {
                for (int i = 1; i < L_movehero.Count; i++)
                {
                    int j = L_movehero[i].iframe;
                    g2.DrawImage(L_movehero[i].im[j], L_movehero[i].cx, L_movehero[i].cy);
                }
            }
        }