public CollisionHandler(Game1 game) { this.audioManager = game.audioManager; this.splashScreen = game.splashScreen; this.modelManager = game.modelManager; this.game = game; this.score = game.score; }
float velocity = 0f; // need to track velocity so the car naturally slows down #endregion Fields #region Constructors public Player(Model model, GraphicsDevice device, Camera camera, Game1 game) : base(model) { this.MAX_HEALTH = (int)game.playerHealth; this.MOVE_SPEED = game.playerMoveSpeed; graphicsDeviceManager = game.graphics; this.uiManager = game.uiManager; this.audioManager = game.audioManager; health = MAX_HEALTH; energy = MAX_ENERGY; base.translation.Translation = new Vector3(500f, 0f, 500f); }
protected override void Initialize() { camera = new Camera(this, new Vector3(770, 1200, 1090), new Vector3(770, -2800, -500), Vector3.Up); Components.Add(camera); uiManager = new UIManager(this); audioManager = new AudioManager(this); score = new Score(); // Splash screen component splashScreen = new SplashScreen(this); Components.Add(splashScreen); splashScreen.SetData("Welcome to Battery Derby!", currentGameState); modelManager = new ModelManager(this); modelManager.Enabled = false; // for when splash screen is enabled modelManager.Visible = false; // for when splash screen is enabled Components.Add(modelManager); this.IsMouseVisible = true; /// read in our config and behaviour files, use our xml reader helper class XMLReader xmlRead = new XMLReader(this); base.Initialize(); }