Esempio n. 1
0
        public PongForm(Form inThing, string username)
        {
            prevForm = inThing;
            InitializeComponent();
            handle = panel1.CreateGraphics();

            var queryPong = from usr in db.pongs
                            where usr.username == username
                            select usr;

            if (queryPong.Count() == 0)
            {
                pong usr = new pong();
                usr.username           = username;
                usr.survival_highscore = 0;
                usr.invaders_highscore = 0;
                usr.snake_highscore    = 0;
                usr.pacman_highscore   = 0;
                db.pongs.InsertOnSubmit(usr);
                db.SubmitChanges();
            }
            currentUser = username;

            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);
            label3.Show();
            label4.Show();

            theBall.ball  = new RectangleF(panel1.Width / 2, panel1.Height / 2, 10, 10);
            theBall.speed = 3;
            theBall.angle = 0;

            timer4.Start();
        }
Esempio n. 2
0
        public static void ping()
        {
            Console.WriteLine("Пинг!");
            pong p = new pong(Pong.pong);

            System.Threading.Thread.Sleep(5000);
            p.Invoke();
        }
Esempio n. 3
0
 static void Main(string[] args)
 {
     using (pong game = new pong())
     {
     #if !DEBUG
         game.IsFullScreen = true;
     #endif
         game.Run();
     }
 }
Esempio n. 4
0
    static void Main(string[] args)
    {
        using (pong game = new pong())
        {
#if !DEBUG
            game.IsFullScreen = true;
#endif
            game.Run();
        }
    }