using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Sandbox.Map; using Sandbox.Tiles; namespace Sandbox { public class Game1 : Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; Texture2D spriteFloor; Texture2D spriteWall; GameMap FirstMap = new GameMap(20, 11); List<Title> titles; public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; } protected override void Initialize() { FirstMap.setMap(); setGameMap(); base.Initialize(); } protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); spriteFloor = Content.Load<Texture2D>("floor"); spriteWall = Content.Load<Texture2D>("wall"); } protected override void UnloadContent() { // TODO: Unload any non ContentManager content here } public void setGameMap() { titles = new List<Title>(); int X = 0; int Y = 0; for (int i = 0; i < FirstMap.width; i++) { for (int j = 0; j < FirstMap.length; j++) { if (FirstMap.map[i, j] == 1) { Title aWall = new Wall(spriteWall); aWall.Position.X = X; aWall.Position.Y = Y; titles.Add(aWall); } else if (FirstMap.map[i, j] == 0) { Title aFloor = new Floor(spriteFloor); aFloor.Position.X = X; aFloor.Position.Y = Y; titles.Add(aFloor); } X += 30; } X = 0; Y += 30; } } protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) Exit(); // TODO: Add your update logic here base.Update(gameTime); } protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); spriteBatch.Begin(); foreach (Title element in titles) { element.draw(spriteBatch); } spriteBatch.End(); base.Draw(gameTime); } } }
Standard input is empty
prog.cs(2,17): error CS0234: The type or namespace name `Xna' does not exist in the namespace `Microsoft'. Are you missing an assembly reference? prog.cs(3,17): error CS0234: The type or namespace name `Xna' does not exist in the namespace `Microsoft'. Are you missing an assembly reference? prog.cs(4,17): error CS0234: The type or namespace name `Xna' does not exist in the namespace `Microsoft'. Are you missing an assembly reference? prog.cs(5,15): error CS0234: The type or namespace name `Map' does not exist in the namespace `Sandbox'. Are you missing an assembly reference? prog.cs(6,15): error CS0234: The type or namespace name `Tiles' does not exist in the namespace `Sandbox'. Are you missing an assembly reference? prog.cs(10,26): error CS0246: The type or namespace name `Game' could not be found. Are you missing an assembly reference? prog.cs(12,9): error CS0246: The type or namespace name `GraphicsDeviceManager' could not be found. Are you missing an assembly reference? prog.cs(13,9): error CS0246: The type or namespace name `SpriteBatch' could not be found. Are you missing an assembly reference? prog.cs(15,9): error CS0246: The type or namespace name `Texture2D' could not be found. Are you missing an assembly reference? prog.cs(16,9): error CS0246: The type or namespace name `Texture2D' could not be found. Are you missing an assembly reference? prog.cs(18,9): error CS0246: The type or namespace name `GameMap' could not be found. Are you missing an assembly reference? prog.cs(20,14): error CS0246: The type or namespace name `Title' could not be found. Are you missing an assembly reference? prog.cs(28,33): error CS0115: `Sandbox.Game1.Initialize()' is marked as an override but no suitable method found to override prog.cs(36,33): error CS0115: `Sandbox.Game1.LoadContent()' is marked as an override but no suitable method found to override prog.cs(44,33): error CS0115: `Sandbox.Game1.UnloadContent()' is marked as an override but no suitable method found to override prog.cs(83,40): error CS0246: The type or namespace name `GameTime' could not be found. Are you missing an assembly reference? prog.cs(93,38): error CS0246: The type or namespace name `GameTime' could not be found. Are you missing an assembly reference? Compilation failed: 17 error(s), 0 warnings
Standard output is empty