Esempio n. 1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Engine game = new Engine())
     {
         game.Run();
     }
 }
Esempio n. 2
0
        public TestRoom(Engine a, int layer)
            : base(a, layer)
        {
            a.console.RegisterStateCommands(this);
            a.console.RegisterStateCommands(pe);
            a.console.Execute("fps true");

            player = new Player(a, new Vector2(100f, 100f));
            objects.Add(player);

            Particle p = new EmitterParticle(pe, new Vector2(a.resolution.X / 4 * 3, a.resolution.Y * 3 / 4 + 50), delegate(Particle emitter, ParticleEngine engine)
            {
                Particle tail = new SpriteParticle(engine, Resources.GetSprite("p_explosion"), emitter.position, Color.Orange);
                tail.rotation = (float)(MathExtra.random.NextDouble() * Math.PI * 2);
                tail.SetLife(150);
                tail.alpha = 0;
                tail.methods.Add(new FadeInOutMethod(engine));
                tail.methods.Add(new ScaleMethod(engine, 0.15f, 0.01f));
                engine.AddParticle(tail, true);
            });
            p.methods.Add(new PointForceMethod(pe, new Vector2(a.resolution.X / 4 * 3 + 50, a.resolution.Y * 3 / 4 + 50), 0.5f));
            p.velocity = new Vector2(0.0f, -10.0f);
            pe.AddParticle(p);
        }