public CarSelect() { InitializeComponent(); BackgroundImage = Image.FromFile(Path.Combine(Environment.CurrentDirectory, "selectscreen.png")); game = new Game(); this.Size = new Size(1024, 768); this.Width = 1024; this.Height = 768; this.Left = 0; this.Top = 0; this.KeyDown += OnKeyDown; }
public Player(Game game, string character) { this.game = game; // Init string path = Path.Combine(Environment.CurrentDirectory, "car_"+character+".png"); bitmap = Bitmap.FromFile(path); posX = 0; posY = 0; speed = 0; maxSpeed = 3; maxSpeedWhenFuelIsEmpty = 1.5; minSpeed = -2; minSpeedWhenFuelIsEmpty = -1; accelerationSpeedConstant = 0.2; accelerateBelowZeroConstant = 0.02; decelerationSpeedConstant = 0.005; width = bitmap.Width; height = bitmap.Height; breakSpeedConstant = 0.04; }