public LevelEditor(GameMeta GameMeta) { CurrentMeta = GameMeta; SceneBounds = new Rectangle(0, 0, 512, 764); Scenery = new List <IObject>(); LevelData = new List <LevelKeypoint>(); UI = new List <UIObject>(); BuildUI(); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); currentTextureCache = new TextureCache(Content, GraphicsDevice); currentInputManager = new InputManager(); currentMeta = new GameMeta(currentTextureCache, this, currentInputManager); currentScene = new Menu(currentMeta); // TODO: use this.Content to load your game content here }
public Stage(GameMeta GameMeta) { CurrentMeta = GameMeta; SceneBounds = new Rectangle(0, 0, 512, 764); Scenery = new List <IObject>(); Player = new Player(GameMeta) { RenderTexture = CurrentMeta.TextureCache["PlayerSprite"], Position = new Vector2(SceneBounds.X + SceneBounds.Width / 2, SceneBounds.Height - 128), }; Scenery.Add(Player); }
public Menu(GameMeta GameMeta) { CurrentMeta = GameMeta; menuButtons = new List <Button>(); currentScene = this; menuButtons.Add(new Button(null, CurrentMeta.TextureCache["Button"], new UDim(new Vector2(0.5f, 0.5f), new Vector2(-50, -55)), new UDim(Vector2.Zero, new Vector2(100, 50)), () => { currentScene = new Stage(CurrentMeta); })); menuButtons.Add(new Button(null, CurrentMeta.TextureCache["Button"], new UDim(new Vector2(0.5f, 0.5f), new Vector2(-50, 55)), new UDim(Vector2.Zero, new Vector2(100, 50)), () => { currentScene = new LevelEditor(CurrentMeta); })); }
public GameEntity(GameMeta gameMeta) { GameMeta = gameMeta; }