This is the main type for your game
Inheritance: Game
コード例 #1
0
ファイル: Program.cs プロジェクト: hanistory/hasuite
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
コード例 #2
0
ファイル: Screen.cs プロジェクト: japotter4/Project-Games
 public Screen(Game1 g, String bg, String f)
 {
     background = g.Content.Load<Texture2D>(bg);
     font = g.Content.Load<SpriteFont>(f);
     selection = 0;
     numOfLinks = 0;
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: soliser/Lucky-2Dgame
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main()
 {
     using (var game = new Game1())
     {
         game.Run();
     }
 }
コード例 #4
0
ファイル: Program.cs プロジェクト: abflin2/Exercises
 /// <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();
 }
コード例 #5
0
ファイル: Piece.cs プロジェクト: Epik8000/Chess-Game
 //contructor
 public Piece(Game1 game, int x, int y)
 {
     this.game = game;
     this.x = x;
     this.y = y;
     this.LoadImage();
 }
コード例 #6
0
ファイル: Form1.cs プロジェクト: HunterwolfAT/ArtistQuest
 public Form1(Game1 mygame)
 {
     InitializeComponent();
     game = mygame;
     graphics = this.CreateGraphics();
     greenpen = new Pen(System.Drawing.Color.Green, 1);
 }
コード例 #7
0
ファイル: Sheep.cs プロジェクト: colincove/HeartStopper
        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;
        }
コード例 #8
0
ファイル: Healthbar.cs プロジェクト: jorge-d/Angry-Grandmas
 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;
 }
コード例 #9
0
ファイル: XsScGroup.cs プロジェクト: Ritsuki/XsNotAlone-Game
 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();
 }
コード例 #10
0
ファイル: Vision.cs プロジェクト: colincove/HeartStopper
 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);
 }
コード例 #11
0
        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>();
        }
コード例 #12
0
ファイル: Game1.cs プロジェクト: pisani-a/Angry-Grandmas
        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>();
        }
コード例 #13
0
ファイル: Game1.cs プロジェクト: TheVirtualBoys/TOJam8
 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();
 }
コード例 #14
0
ファイル: HealthBar.cs プロジェクト: colincove/HeartStopper
 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);
 }
コード例 #15
0
ファイル: MainForm.cs プロジェクト: Eudaimonium/PI_projekt
        private void MainForm_Load(object sender, EventArgs e)
        {
            Thread game = new Thread(() =>
            {
                game1 = new Game1();
                game1.Run();
            });

            game.Start();

            RemakeWindow();
        }
コード例 #16
0
ファイル: Werewolf.cs プロジェクト: colincove/HeartStopper
 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;
 }
コード例 #17
0
ファイル: Ball.cs プロジェクト: colincove/HeartStopper
        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;
        }
コード例 #18
0
ファイル: Hunter.cs プロジェクト: colincove/HeartStopper
 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];
     }
 }
コード例 #19
0
ファイル: Map.cs プロジェクト: colincove/HeartStopper
 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()));
      }
 }
コード例 #20
0
ファイル: Ball.cs プロジェクト: japotter4/Project-Games
        //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");
        }
コード例 #21
0
 public XsSceneElement(Game1 game)
 {
     this.game = game;
     el = new List<XsSceneElement>();
 }
コード例 #22
0
 public SlopedComponent(Game1 game)
     : base(game)
 {
     slope = new Slope();
 }
コード例 #23
0
ファイル: Rook.cs プロジェクト: Epik8000/Chess-Game
 //constructor
 public Rook(Game1 game, int x, int y)
     : base(game, x, y)
 {
 }
コード例 #24
0
 public XsScRectTextured(Game1 g)
     : base(g)
 {
 }
コード例 #25
0
ファイル: Car.cs プロジェクト: EvGenius91/Game
 public Car(Game1 game, int id, string nameModel, Vector3 startPosition)
     : base(game, id, nameModel)
 {
     this.iniPhysx(startPosition);
 }
コード例 #26
0
ファイル: Player.cs プロジェクト: gigiwotou/GameEdit2
 public Player(Game1 game)
 {
     mGame = game;
     mAnimationset = AnimationSetManager.Instance.Get("tuzi");
     mAnimation = mAnimationset.Animations[0];
 }
コード例 #27
0
ファイル: Queen.cs プロジェクト: Epik8000/Chess-Game
 public Queen(Game1 game, int x, int y)
     : base(game, x, y)
 {
 }
コード例 #28
0
ファイル: XsCamera.cs プロジェクト: Ritsuki/XsNotAlone-Game
 public XsCamera(Game1 game)
     : base(game)
 {
 }
コード例 #29
0
ファイル: XsScene.cs プロジェクト: Ritsuki/XsNotAlone-Game
 // Scene contains more scene elements
 public XsScene(Game1 game1)
     : base(game1)
 {
     parent = this;
 }
コード例 #30
0
ファイル: XsScModel.cs プロジェクト: Ritsuki/XsNotAlone-Game
 public XsScModel(Game1 g)
     : base(g)
 {
 }