コード例 #1
0
ファイル: Program.cs プロジェクト: JustinWeq/Barfight-CS-285
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
コード例 #2
0
        public CharacterSelection(Game1 parent,GraphicsDevice device)
        {
            this.numOfPlayers = numOfPlayers;
            combatants = new LinkedList<CharacterInfo>();
            this.parent = parent;
            //set up the back wall for the vertex buffer
            Shader.Vertex[] vertices = new Shader.Vertex[4];
            float xWidth = 32, yWidth = 5, zWidth = 32, wallYDensity = 1, wallXDensity = 5;

            //set up the data for the back wall
            vertices[0] = new Shader.Vertex(new Vector3(-xWidth, yWidth, zWidth), new Vector2(0, 0), new Vector3(0, 1, 0));
            vertices[1] = new Shader.Vertex(new Vector3(-xWidth, 0, zWidth), new Vector2(0, wallYDensity), new Vector3(0, 1, 0));
            vertices[2] = new Shader.Vertex(new Vector3(xWidth, yWidth, zWidth), new Vector2(wallXDensity, 0), new Vector3(0, 1, 0));
            vertices[3] = new Shader.Vertex(new Vector3(xWidth, 0, zWidth), new Vector2(wallXDensity, wallYDensity), new Vector3(0, 1, 0));

            buffer = new VertexBuffer(device, Shader.Vertex.VertexDeclaration, 4, BufferUsage.WriteOnly);
            buffer.SetData(vertices);

            //set up the camera and world matrices
            view = Matrix.CreateLookAt(new Vector3(0, 0,30), new Vector3(0, 0, 0), Vector3.UnitY);
            projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, device.Viewport.AspectRatio, 0.2f, 1000);
            world1 = Matrix.CreateScale(0.1f)*Matrix.CreateRotationX(-MathHelper.PiOver4)* Matrix.CreateTranslation(new Vector3(0, 0, 10));
            world2 = Matrix.CreateScale(0.1f) * Matrix.CreateRotationX(-MathHelper.PiOver4) * Matrix.CreateTranslation(new Vector3(-5, 0, 5));
            world3 = Matrix.CreateScale(0.1f) * Matrix.CreateRotationX(-MathHelper.PiOver4) * Matrix.CreateTranslation(new Vector3(5, 0, 5));
            selectedCombatants = new List<string>();
            timer = inputDelay;
        }
コード例 #3
0
 public PlayerSelector(ContentManager content,Game1 parent)
 {
     this.parent = parent;
     left = content.Load<Texture2D>("Left");
     right = content.Load<Texture2D>("Right");
     Texture2D go, exit;
     go = content.Load<Texture2D>("Start");
     exit = content.Load <Texture2D>("Exit");
     menu = new Menu(4, new Rectangle(parent.ScreenWidth / 2 - (go.Width / 2), parent.ScreenHeight / 2, go.Width, go.Height), go, exit);
     font = content.Load<SpriteFont>("Font");
     timer = InputDelay;
     numOfPlayers = MinNumOfPlayers;
 }
コード例 #4
0
 public Combatant(Game1 parent,Room room)
     : base()
 {
     leftFist = new AABB(0, 0, 0, 0.5f, 0.5f, 0.5f);
     rightFist = new AABB(0,0,0, 0.5f, 0.5f, 0.5f);
     hp = 100;
     drunkBuffer = 0;
     this.parent = parent;
     punch1 = parent.Content.Load<SoundEffect>("punch1").CreateInstance();
     punch2 = parent.Content.Load<SoundEffect>("punch2").CreateInstance();
     punch3 = parent.Content.Load<SoundEffect>("punch3").CreateInstance();
     punch4 = parent.Content.Load<SoundEffect>("punch4").CreateInstance();
     punch1.IsLooped = punch2.IsLooped = punch3.IsLooped = punch4.IsLooped = false;
     disconnected = -1;
     Combatant.room = room;
 }
コード例 #5
0
ファイル: Options.cs プロジェクト: JustinWeq/Barfight-CS-285
        public Options(ContentManager content,Game1 parent)
        {
            this.parent = parent;
            Texture2D AA,resolution,rumble,sfx,music;
            AA = content.Load<Texture2D>("antialiasing");
            resolution = content.Load<Texture2D>("resolution");
            rumble = content.Load<Texture2D>("rumble");
            sfx = content.Load<Texture2D>("soundfx");
            music = content.Load<Texture2D>("music");

            x = parent.ScreenWidth / 2 - (AA.Width / 2);
            y = parent.ScreenHeight / 2 - ((4 + AA.Height * 5) / 2);
            width = AA.Width;
            height = AA.Height;
            menu = new Menu(4, new Rectangle(x, y, width, height), AA, resolution, rumble, sfx, music);
            settings = new Settings();
            settings.AA = true;
            settings.height = screenResos[0][1];
            settings.width = screenResos[0][0];
        }
コード例 #6
0
 public LevelSelection(Game1 parent)
 {
     levelData = new LinkedList<LevelData>();
     this.parent = parent;
 }
コード例 #7
0
ファイル: room.cs プロジェクト: JustinWeq/Barfight-CS-285
        public Room(GraphicsDevice device, Game1 parent)
        {
            //init model keys
            models = new Dictionary<string, BFModel>();

            //init music
            music = null;

            //init view and projection matrixes

            view = Matrix.CreateLookAt(new Vector3(0, 5, 5), Vector3.Zero, Vector3.UnitY);
            projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, device.Viewport.AspectRatio, 0.2f, 1000);

            //init the light
            lightPos = new Vector3();

            //set up parts list
            parts = new List<RefModel>();

            combatants = new List<Combatant>();
            hud = new HUD(parent.Content,parent.ScreenWidth,parent.ScreenHeight);

            drinks = new List<DrinkSpawner>();
            font = parent.Content.Load<SpriteFont>("Font");
            this.parent = parent;
        }
コード例 #8
0
ファイル: Controls.cs プロジェクト: JustinWeq/Barfight-CS-285
 public Controls(ContentManager content,Game1 parent)
 {
     controls = content.Load<Texture2D>("controller");
     font = content.Load<SpriteFont>("Font");
     this.parent = parent;
 }
コード例 #9
0
ファイル: Credits.cs プロジェクト: JustinWeq/Barfight-CS-285
 public Credits(ContentManager content,Game1 parent)
 {
     font = content.Load<SpriteFont>("Font");
     this.parent = parent;
     credits = content.Load<Texture2D>("creditsImage");
 }