/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { using (Game1 game = new Game1()) { game.Run(); } }
public Screen(Game1 g, String bg, String f) { background = g.Content.Load<Texture2D>(bg); font = g.Content.Load<SpriteFont>(f); selection = 0; numOfLinks = 0; }
/// <summary> /// The main entry point for the application. /// </summary> static void Main() { using (var game = new Game1()) { game.Run(); } }
/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { formMain form = new formMain(); form.Show(); Game1 game = new Game1(form.getDrawSurface()); game.Run(); }
//contructor public Piece(Game1 game, int x, int y) { this.game = game; this.x = x; this.y = y; this.LoadImage(); }
public Form1(Game1 mygame) { InitializeComponent(); game = mygame; graphics = this.CreateGraphics(); greenpen = new Pen(System.Drawing.Color.Green, 1); }
public Sheep(Game1 game, float x, float y) : base(game) { // Add to the sheep list sheep[sheepListCount] = this; index = sheepListCount; sheepListCount++; stateWeights = new int[,] { { 4, IdleState }, { 10, MOVE }, { 10, MOVE_SHEEP }, { 7, TURN }, { 7, FLOCK } }; currentState = IdleState; base.x = x; base.y = y; this.DrawOrder = 1000; Random random = new Random((int)x); game.Components.Add(this); xVel = (float)random.Next(0, 5); random = new Random((int)y); yVel = (float)random.Next(0, 5); for (int i = 0; i < stateWeights.GetLength(0); i++) { totalWeights += stateWeights[i, 0]; } alive = true; alert = false; done = true; this.map = map; lastUpdateTime = System.Environment.TickCount; random = new Random(); double randomDirection = random.NextDouble() * 4;// get a random number between 1 and 4 direction = (int)randomDirection; }
public Healthbar(Game1 game) : base(game) { // Choose a high number, so we will draw on top of other components. DrawOrder = 1000; textureGreen = game.textureGreen; textureRed = game.textureRed; }
public XsScGroup(Game1 g) : base(g) { translation = Matrix.CreateTranslation(new Vector3(0, 0, 0)); rotation = Matrix.CreateRotationX(0) * Matrix.CreateRotationY(0) * Matrix.CreateRotationZ(0); scale = Matrix.CreateScale(1); recalculateWorldMatrix(); }
public Vision(Game1 game, DrawableSprite parent) : base(game) { // TODO: Construct any child components here this.game = game; this.parent = parent; //this.dirLR = DIR_NONE; //this.dirUD = DIR_NONE; this.game.Components.Add(this); }
public ScriptHandler(Maps newmap, Player newplayer, Itemhandler newitems, Game1 newgame = null) { activescript = new Script("null"); map = newmap; player = newplayer; items = newitems; game = newgame; IFstack = new List<bool>(); }
public Game1() { _instance = this; graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = Defaults.window_size_x; graphics.PreferredBackBufferHeight = Defaults.window_size_y; Content.RootDirectory = "Content"; _elements = new LinkedList<AElement>(); }
public Game1() { sm_game = this; graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = 1024; graphics.PreferredBackBufferHeight = 960; graphics.ApplyChanges(); Content.RootDirectory = "Content"; audioSys = new AudioSys(); gameData = new GameData(); }
public HealthBar(Game1 game, int x, int y) : base(game) { // TODO: Construct any child components here this.game = game; this.x = x; this.y = y; DrawOrder = 2000; this.hp = 1.0f; this.game.Components.Add(this); }
private void MainForm_Load(object sender, EventArgs e) { Thread game = new Thread(() => { game1 = new Game1(); game1.Run(); }); game.Start(); RemakeWindow(); }
public Werewolf(Game1 game, int width, int height) : base(game) { // TODO: Construct any child components here DrawOrder = 1000; // Always draw this last. screenWidth = width*Map.TILE_SIZE; screenHeight = height*Map.TILE_SIZE; game.Components.Add(this); skin = new PlayerSkin(game, this); this.x = 1000; this.y = 1000; this.game = game; this.damp = 10.0f; }
public Ball(Game1 game, int seed) : base(game) { destRect = new Rectangle(0,0,36,36); x = 1500; y = 1500; game.Components.Add(this); Random random = new Random(seed); x = (float)random.Next(0,3000); random = new Random((int)(seed*3.2)); y = (float)random.Next(0, 3000); damp = 4.0f; applyForce = true; slope.range = 6; }
public Hunter(Game1 game, float x, float y) : base(game) { stateWeights = new int[,] { { 4, IdleState }, { 10, MOVE }, { 10, MOVE_SHEEP }, { 7, TURN } }; currentState = IdleState; base.x =x; base.y = y; this.DrawOrder = 1000; x += 500; y += 500; random = new Random((int)x); game.Components.Add(this); xVel = (float)random.Next(0,5); random = new Random((int)y); yVel = (float)random.Next(0, 5); for (int i = 0; i < stateWeights.GetLength(0); i++) { totalWeights += stateWeights[i,0]; } }
public Map(Game1 game, int width, int height) : base(game) { // TODO: Construct any child components here this.game = game; this.width = width; this.height = height; this.game.Components.Add(this); /* Hunter hunter = new Hunter(game,200f,200f); hunter = new Hunter(game, 200f, 200f); hunter = new Hunter(game, 250f, 200f); hunter = new Hunter(game, 3500f, 350f); hunter = new Hunter(game, 400f, 200f); hunter = new Hunter(game, 500f, 450f); hunter = new Hunter(game, 5500f, 780f); hunter = new Hunter(game, 200f, 4500f); hunter = new Hunter(game, 350f, 200f); hunter = new Hunter(game, 100f, 200f); hunter = new Hunter(game, 200f, 240f);*/ //hunter = new Hunter(game, 200f, 200f); Sheep sheep = new Sheep(game, 300, 300); sheep = new Sheep(game, 300, 300); sheep = new Sheep(game, 120, 300); sheep = new Sheep(game, 300, 1300); sheep = new Sheep(game, 20, 300); sheep = new Sheep(game, 50, 1500); sheep = new Sheep(game, 400, 300); sheep = new Sheep(game, 2000, 50); sheep = new Sheep(game, 100, 300); for (var i = 0; i < 30; i++) { Random randomy = new Random(i * 33); Random randomx = new Random(i * 51); sheep = new Sheep(game, randomx.Next(0,getWidth()), randomy.Next(0, getHeight())); } }
//We will need references to the paddles for collision detection, and //our Game1 contains these references, our ball should have the //reference to the Game1 public Ball(Game1 g, String texture) { //set the game1 object game1 = g; //set the texture of the ball this.texture = game1.Content.Load<Texture2D>(texture); //we use a random object when randomly setting the balls direction rand = new Random(); //the ball should start near at the center of the screen //use a size of 20x20 ball = new Rectangle( game1.GraphicsDevice.Viewport.Bounds.Width / 2 - ball.Width / 2, game1.GraphicsDevice.Viewport.Bounds.Height / 2 - ball.Height / 2, 20, 20); reset(); //Initialize the score font = game1.Content.Load<SpriteFont>(@"ScoreFont"); }
public XsSceneElement(Game1 game) { this.game = game; el = new List<XsSceneElement>(); }
public SlopedComponent(Game1 game) : base(game) { slope = new Slope(); }
//constructor public Rook(Game1 game, int x, int y) : base(game, x, y) { }
public XsScRectTextured(Game1 g) : base(g) { }
public Car(Game1 game, int id, string nameModel, Vector3 startPosition) : base(game, id, nameModel) { this.iniPhysx(startPosition); }
public Player(Game1 game) { mGame = game; mAnimationset = AnimationSetManager.Instance.Get("tuzi"); mAnimation = mAnimationset.Animations[0]; }
public Queen(Game1 game, int x, int y) : base(game, x, y) { }
public XsCamera(Game1 game) : base(game) { }
// Scene contains more scene elements public XsScene(Game1 game1) : base(game1) { parent = this; }
public XsScModel(Game1 g) : base(g) { }