:
namespace catapult_game
{
class Gameplayscreen
{
// Texture Members
Texture2D foregroundTexture;
Texture2D cloud1Texture;
Texture2D cloud2Texture;
Texture2D mountainTexture;
Texture2D skyTexture;
Texture2D hudBackgroundTexture;
Texture2D ammoTypeTexture;
Texture2D windArrowTexture;
Texture2D defeatTexture;
Texture2D victoryTexture;
SpriteFont hudFont;
// Rendering members
Vector2 cloud1Position;
Vector2 cloud2Position;
}
}
public *void* LoadAssets()
{
// Load textures
foregroundTexture = Load<Texture2D>("Textures/Backgrounds/gameplay_screen");
cloud1Texture = Load<Texture2D>("Textures/Backgrounds/cloud1");
cloud2Texture = Load<Texture2D>("Textures/Backgrounds/cloud2");
mountainTexture = Load<Texture2D>("Textures/Backgrounds/mountain");
skyTexture = Load<Texture2D>("Textures/Backgrounds/sky");
defeatTexture = Load<Texture2D>("Textures/Backgrounds/defeat");
victoryTexture = Load<Texture2D>("Textures/Backgrounds/victory");
hudBackgroundTexture = Load<Texture2D>("Textures/HUD/hudBackground");
windArrowTexture = Load<Texture2D>("Textures/HUD/windArrow");
ammoTypeTexture = Load<Texture2D>("Textures/HUD/ammoType");
// Load font
hudFont = Load<SpriteFont>("Fonts/HUDFont");
// Define initial cloud position
cloud1Position = *new Vector2*(224 - cloud1Texture.Width, 32);
cloud2Position = *new Vector2*(64, 90);
*}*
public override void LoadContent()
{
LoadAssets();
base.LoadContent();
}
public override void Draw(GameTime gameTime)
{
float elapsedTime = (float)gameTime.ElapsedGameTime.TotalSeconds;
ScreenManager.SpriteBatch.Begin();
// Render all parts of the screen
DrawBackground();
// DrawComputer(gameTime);
// DrawPlayer(gameTime);
// DrawHud();
ScreenManager.SpriteBatch.End();
}
private void DrawBackground()
{
// Clear the background
ScreenManager.Game.GraphicsDevice.Clear(Color.White);
// Draw the Sky
ScreenManager.SpriteBatch.Draw(skyTexture, Vector2.Zero, Color.White);
// Draw Cloud #1
ScreenManager.SpriteBatch.Draw(cloud1Texture,
cloud1Position, Color.White);
// Draw the Mountain
ScreenManager.SpriteBatch.Draw(mountainTexture,
Vector2.Zero, Color.White);
// Draw Cloud #2
ScreenManager.SpriteBatch.Draw(cloud2Texture,
cloud2Position, Color.White);
//Draw the Castle, trees, and foreground
ScreenManager.SpriteBatch.Draw(foregroundTexture,
Vector2.Zero, Color.White);
}
I placed astricks around what visual studio is telling me there is an error and i dont know what to do to fix it
|