Exemplo n.º 1
0
 /// <summary>
 /// Instancie le RenderForm et créé l'objet Game.
 /// </summary>
 private RenderForm()
 {
     InitializeComponent();
     game = Game.CreateGame(this.ClientSize);
     watch.Start();
     WorldClock.Start();
 }
Exemplo n.º 2
0
 /// <summary>
 /// Create form, create game
 /// </summary>
 public GameForm(GameMode mode)
 {
     InitializeComponent();
     game = Game.CreateGame(ClientSize, mode);
     game.InitGame();
     watch.Start();
     WorldClock.Start();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Réinitialise le niveau.
 /// </summary>
 public void Reset()
 {
     game.GameEntities.Clear();
     Console.WriteLine("Relancement du niveau...");
     game = Game.CreateGame(gameSize);
     //p1 = new Player(new Vecteur2D(gameSize.Width / 2, 500), 150, 2, GameSprites.PlayerSprite, GameVariables.defaultShootSpeed);
     Console.WriteLine("Niveau relancé !");
 }
Exemplo n.º 4
0
 /// <summary>
 /// Create form, create game
 /// </summary>
 public GameForm()
 {
     SongMap.Instance.Load();
     InitializeComponent();
     this.ClientSize = new Size(
         (2 * Screen.PrimaryScreen.Bounds.Width) / 3,
         (2 * Screen.PrimaryScreen.Bounds.Height) / 3
         );
     Game = Game.CreateGame(this.ClientSize);
     Watch.Start();
     WorldClock.Start();
 }
Exemplo n.º 5
0
        /// <summary>
        /// Create form, create game
        /// </summary>
        public GameForm()
        {
            InitializeComponent();
            byte[] fontData = space_invaders.Properties.Resources.ethnocentric_rg;

            IntPtr fontPtr = Marshal.AllocCoTaskMem(fontData.Length);

            Marshal.Copy(fontData, 0, fontPtr, fontData.Length);

            pfc.AddMemoryFont(fontPtr, fontData.Length);

            Marshal.FreeCoTaskMem(fontPtr);

            game = Game.CreateGame(new Size(this.Width - 18, this.Height - 33)); // border size...
            watch.Start();
            WorldClock.Start();
        }