Example #1
0
 public GameForm()
 {
     InitializeComponent();
     this.ClientSize = new Size(VW, VH);
     //this.Width = VW;
     //this.Height = VH;
     world = new World(VW, VH);
     this.MouseWheel += (o, e) => {
         //MessageBox.Show("" + e.Delta  + "\n" +  SystemInformation.MouseWheelScrollLines / 120);
         n += e.Delta / 120;
         n = n < 1 ? 1 : n;
         debugLbl.Text = e.Delta+"";
         //debugLbl.Text = SystemInformation.MouseWheelScrollLines + "";
         debugLbl.Invalidate();
     };
 }
Example #2
0
 /// <summary>
 /// A helper method to print world data (collection of cubes) to lines on console.
 /// </summary>
 /// <param name="w"></param>
 private static void PrintWorldCubes(World w)
 {
     Console.WriteLine("World Cubes {");
     foreach (Cube c in w.foodCubes.Values)
     {
         Console.Write("\t");
         PrintCubeData(c);
         Console.WriteLine();
     }
     Console.WriteLine("}");
 }