using System;
using System.Collecti ons.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.F ramework;
using Microsoft.Xna.F ramework.Audio;
using Microsoft.Xna.F ramework.Conten t;
using Microsoft.Xna.F ramework.GamerS ervices;
using Microsoft.Xna.F ramework.Graphi cs;
using Microsoft.Xna.F ramework.Input;
using Microsoft.Xna.F ramework.Media;
using Microsoft.Xna.F ramework.Net;
using Microsoft.Xna.F ramework.Storag e;
namespace SimplePlayer1
{
class Player
{
Vector2 position;
Texture2D shipSprite;
Vector2 spriteOrigin;
int windowWidth, windowHeight;
public Player(Graphics Device devic, Vector2 position, Texture2D sprite)
{
//The position that is passed in is now set to the position above
this.position = position;
//Set the Texture2D
shipSprite = sprite;
//Setup origin
spriteOrigin.X = (float)shipSpri te.Width / 2.0f;
spriteOrigin.Y = (float)shipSpri te.Height / 2.0f;
windowHeight = device.Viewport .Height;
windowWidth = device.Viewport .Width;
}
}
}
When I type in the code it comes up with an error that says the name device does not exist in the current context.
Please help
using System.Collecti ons.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.F ramework;
using Microsoft.Xna.F ramework.Audio;
using Microsoft.Xna.F ramework.Conten t;
using Microsoft.Xna.F ramework.GamerS ervices;
using Microsoft.Xna.F ramework.Graphi cs;
using Microsoft.Xna.F ramework.Input;
using Microsoft.Xna.F ramework.Media;
using Microsoft.Xna.F ramework.Net;
using Microsoft.Xna.F ramework.Storag e;
namespace SimplePlayer1
{
class Player
{
Vector2 position;
Texture2D shipSprite;
Vector2 spriteOrigin;
int windowWidth, windowHeight;
public Player(Graphics Device devic, Vector2 position, Texture2D sprite)
{
//The position that is passed in is now set to the position above
this.position = position;
//Set the Texture2D
shipSprite = sprite;
//Setup origin
spriteOrigin.X = (float)shipSpri te.Width / 2.0f;
spriteOrigin.Y = (float)shipSpri te.Height / 2.0f;
windowHeight = device.Viewport .Height;
windowWidth = device.Viewport .Width;
}
}
}
When I type in the code it comes up with an error that says the name device does not exist in the current context.
Please help
Comment