Esempio n. 1
0
 public void Draw(Sprite sprite)
 {
     if (sprite.getBitmap() != null)
     g.DrawImage(sprite.getBitmap(), sprite.Position.X, sprite.Position.Y, sprite.Size.Width, sprite.Size.Height);
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            engine = new Engine();
            engine.Update += new Engine.UpdateEventHandler(engine_Update);
            engine.SetName("RPG TestCase");

            sphereLeft = new Animation(engine.content.Load<Bitmap>("sphere.bmp"), 8, 4);
            sphereLeft.SetTransparent();
            sphereLeft.Position.X = 64;

            sphereRight = new Animation(engine.content.Load<Bitmap>("sphere.bmp"), 8, 4);
            sphereRight.SetTransparent();

            player = new Animation(engine.content.Load<Bitmap>("breeze.png"), 4, 4, true);
            player.SetTransparent();
            player.Position.X = (engine.screen.Size.Width / 2) - (player.Size.Width / 2);
            player.Position.Y = (engine.screen.Size.Height / 2) - (player.Size.Height / 2);

            oneup = new Sprite(engine.content.Load<Bitmap>("1up.png"));
            oneup.Position.X = 128;
            oneup.SetTransparent();

            trimme = new Animation(engine.content.Load<Bitmap>("trimme.png"), 1, 1, true);
            trimme.Position.X = 320 - 100;
            trimme.Position.Y = 240 - 100;

            sprites.Add(sphereLeft);
            sprites.Add(sphereRight);
            sprites.Add(player);
            sprites.Add(oneup);
            sprites.Add(trimme);

            bgmusic = engine.content.Load<Audio>("Theme4.ogg");
            bgmusic.Repeat = true;
            bgmusic.Volume = 25;
            bgmusic.Play();

            tiksound = engine.content.Load<Audio>("tik.wav");
            tiksound.Volume = 75;
            //tiksound.Play();
            engine.Start();
        }