public Objekt(MacGame game, bool collidable) { _top = new Rectangle(); _bottom = new Rectangle(); _right = new Rectangle(); _left = new Rectangle(); _sprites = new Dictionary<string, Sprite>(); _spriteBatch = game.spriteBatch; _graphics = game.graphics; _camera = game.camera; Collidable = collidable; }
protected override void Initialize() { base.Initialize(); InputManager.Initialize(); //graphics.ApplyChanges(); //testscreen = new HelpScreen(); Fonts.LoadContent(this.Content); camera = new Camera(new Vector2(0,0)); spriteBatch = new SpriteBatch (GraphicsDevice); screenManager = new ScreenManager(this); Components.Add(screenManager); screenManager.AddScreen(new GamePlayScreen(), "GamePlay"); }
//private int jumpCounter; //private int jumpSpeed = 10; public TestEnemy(Sprite sprite, SpriteBatch spriteBatch, GraphicsDeviceManager graphics, Camera camera) { playerStates = new Dictionary<string, bool>(); _sprite = sprite; _spriteBatch = spriteBatch; _graphics = graphics; _camera = camera; Speed = 5; JumpHeight = 30; playerStates.Add("UP", false); playerStates.Add("DOWN", false); playerStates.Add("LEFT", false); playerStates.Add("RIGHT", false); playerStates.Add("JUMP", false); playerStates.Add("RUN", false); playerStates.Add("FALL", false); playerStates.Add("DEAD", false); this.Position = new Vector2(this.Position.X - Speed, this.Position.Y); }