コード例 #1
0
 public FrmGame(FrmMenu formMenu)
 {
     InitializeComponent();
     FormSettings.SetSetting(this);
     MenuForm   = formMenu;
     GameEngine = new GameEngine(this, MenuForm);
 }
コード例 #2
0
        public FrmGameRecords(FrmMenu frmMenu)
        {
            InitializeComponent();
            FormSettings.SetSetting(this);
            MenuForm = frmMenu;

            try
            {
                using (var context = new RoadFighterDataEnt())
                {
                    var records = context.GameRecords.Select(x => new
                    {
                        x.Name,
                        x.Score,
                        x.Crash,
                        x.GameID
                    })
                                  .OrderByDescending(x => x.Score)
                                  .ToList();

                    dtgRecords.DataSource = records;
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Nie udało się połączyć z bazą danych");
            }
        }
コード例 #3
0
 public FrmEndGame(FrmGame game, FrmMenu menuUI, string description, int score, int crash)
 {
     InitializeComponent();
     FormSettings.SetSetting(this);
     ActualGame          = game;
     MenuUI              = menuUI;
     GameScore           = score;
     GameCrash           = crash;
     lblDescription.Text = description;
     lblScore.Text       = "SCORE: " + score.ToString();
 }
コード例 #4
0
 public FrmEndGame(FrmGame game, FrmMenu menuUI, string description, int score, int crash, string message)
 {
     InitializeComponent();
     FormSettings.SetSetting(this);
     ActualGame          = game;
     MenuUI              = menuUI;
     GameScore           = score;
     GameCrash           = crash;
     lblDescription.Text = description;
     lblScore.Text       = message;
     btnConfirm.Enabled  = false;
     txbYourName.Enabled = false;
 }
コード例 #5
0
 public GameEngine(FrmGame gameForm, FrmMenu menuForm)
 {
     FormGame   = gameForm;
     MenuForm   = menuForm;
     Road       = new RoadBox(FormGame, this);
     Grass      = new GreenBox(FormGame, Road.random);
     SceneTimer = gameForm.tmrSceneTimer;
     GameTimer  = gameForm.tmrGameTimer;
     FinishGame = gameForm.tmrFinishGame;
     SpeedGame  = 5;
     SpeedMax   = 10;
     SpeedMin   = 1;
     Crash      = 0;
 }
コード例 #6
0
 public FrmControls(FrmMenu menuForm)
 {
     InitializeComponent();
     FormSettings.SetSetting(this);
     MenuForm = menuForm;
 }