示例#1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
 public override void FinishedLaunching(MonoMac.Foundation.NSObject notification)
 {
     // Handle a Xamarin.Mac Upgrade
     AppDomain.CurrentDomain.AssemblyResolve += (object sender, ResolveEventArgs a) => {
         if (a.Name.StartsWith ("MonoMac")) {
             return typeof(MonoMac.AppKit.AppKitFramework).Assembly;
         }
         return null;
     };
     game = new Game1 ();
     game.Run ();
 }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            // Create our OpenGL view, and display it
            //			Game1.Activity = this;
            //			var g = new Game1 ();
            //			SetContentView (g.Window);
            //			g.Run ();
            var g = new Game1();
            SetContentView(g.Services.GetService<View>()); // this is new
            g.Run();
        }
示例#4
0
        Texture2D tex; // The texture/image of the particle

        #endregion Fields

        #region Constructors

        public Particle(Game1 g, Texture2D t, Vector2 p, Vector2 v)
        {
            // I always start the age off at 255. It's great because you can use it for color as well!
            age = 255;
            tex = t;
            pos = p;
            parent = g;
            vel = v;
            rect = new Rectangle((int)p.X, (int)p.Y, t.Width/4, t.Height/4);
            midpoint = new Vector2(rect.Width/2, rect.Height / 2);
            rot = 0;
            scale = new Vector2(0.1f, 0.1f);
            isAlive = true;
            color = new Color(age, age, age, age);
        }
示例#5
0
 public ParticleComponent(Game1 game)
 {
     // TODO: Construct any child components here
     game.Components.Add(this);
 }