Example #1
0
 public Game1()
 {
     gameInterface = new GameInterface(this);
     gameInterface.InitGraphicsDeviceManager();
     //Definition in FPS Notes
     IsFixedTimeStep = true;
 }
Example #2
0
 public override void LoadContent(GameInterface gi, String fileName, bool pauseScreen)
 {
     PopUp = pauseScreen;
     _gameInterface = gi;
     background = new Background(gi, fileName);
     background.sprite.position = new Vector2(600, 450);
     background.sprite.scale = 1.0f;
 }
Example #3
0
 public TestObject(GameInterface gi)
     : base(ref gi)
 {
     position = new Vector2(
         (float)gi.random.Next(400), (float)gi.random.Next(400));
     InitSprite("Assets/asteroid");
     InitAnimation(new Vector2(8, 4), 30);
     InitPhysics();
     physics.SetVel(rand(), rand());
     InitCollision();
 }
Example #4
0
 public GameMouse( GameInterface gi, string file)
 {
     _sprite = new Sprite(gi, file);
     _animation = new Animation(new Vector2(1, 1), 100, _sprite);
     _mouseButtonMaps = new Dictionary<MouseButtons, Func<MouseState, ButtonState>>
     {
         { MouseButtons.Left, s => s.LeftButton },
         { MouseButtons.Right, s => s.RightButton },
         { MouseButtons.Middle, s => s.MiddleButton },
     };
 }
Example #5
0
 public Sprite(GameInterface gameInterface, string file)
 {
     _gameInterface = gameInterface;
     _texture = _gameInterface.Content.Load<Texture2D>(file);
     _position = new Vector2(0,0);
     _tint = Color.White;
     _rotation = 0;
     _scale = 1;
     _layer = 1;
     _pivot = new Vector2(_texture.Width / 2, _texture.Height / 2);
     _SetRect();
 }
Example #6
0
 public Background(GameInterface gi,  string file)
 {
     _sprite = new Sprite(gi, file);
     _sprite.layer = 0.0f;
     size = new Vector2(_sprite.texture.Width * 20,_sprite.texture.Height * 20);
 }
Example #7
0
 public InputManager(GameInterface gi)
 {
     _mouse = new GameMouse(gi, "Assets/harpoon mouse");
     _EVENT = new List<InputEvent>();
 }
Example #8
0
 public virtual void LoadContent(GameInterface gi, String fileName,
     bool popUp)
 {
 }
Example #9
0
 // Constructor
 public GameObject(ref GameInterface gi)
 {
     _gi = gi;
 }
Example #10
0
 public void LoadContent(GameInterface gi)
 {
     content = new ContentManager(gi.Content.ServiceProvider, "Content");
        currentScreen.LoadContent(gi, "BackGround/Bg1", false);
 }