コード例 #1
0
ファイル: AI.cs プロジェクト: dualdragoon/Unnamed-Racing-Game
 public AIKart(int kartNum, Level level, byte[][,] weight)
 {
     rand = new Random(kartNum);
     Level = level;
     Weight = weight;
     position = new Vector3(rand.NextFloat(-10, 11), rand.NextFloat(-10, 11), rand.NextFloat(-10, 11));
 }
コード例 #2
0
 public Room(Level level, string roomTitle, Vector3 pos, int seed)
 {
     this.level = level;
     room = roomTitle;
     floorPos = pos;
     trans = Matrix.Translation(floorPos);
     rand = new Random(seed);
 }
コード例 #3
0
 public KartEntity(Level level, byte[][,] weight)
 {
     acceleration = 0;
     velocity = 0;
     angle = 0;
     World = Matrix.Zero;
     View = Matrix.Zero;
     Projection = Matrix.Zero;
     position = Vector3.Zero;
     Level = level;
     Weight = weight;
 }
コード例 #4
0
 public Projectile(ProjectileType type, Model sphere, Vector3 position, Vector3 forward, float angle, Level host)
 {
     this.type = type;
     level = host;
     origin = Matrix.Translation(startLocation);
     this.forward = forward;
     pos = position;
     startLocation = position;
     model = sphere;
     effect = new BasicEffect(Main.Graphics.GraphicsDevice);
     if (this.type == ProjectileType.Red)
     {
         effect.LightingEnabled = true;
         effect.DirectionalLight0.DiffuseColor = Color.Red.ToVector3();
         effect.DirectionalLight0.Direction = new Vector3(1, 0, -1);
         effect.DirectionalLight0.SpecularColor = new Vector3(1, 0, 0);
         worth = 10;
         velocity = 100;
     }
     else if (this.type == ProjectileType.Green)
     {
         effect.LightingEnabled = true;
         effect.DirectionalLight0.DiffuseColor = Color.Green.ToVector3();
         effect.DirectionalLight0.Direction = new Vector3(1, 0, -1);
         effect.DirectionalLight0.SpecularColor = new Vector3(1, 0, 0);
         worth = 25;
         velocity = 120;
     }
     else
     {
         effect.LightingEnabled = true;
         effect.DirectionalLight0.DiffuseColor = Color.Blue.ToVector3();
         effect.DirectionalLight0.Direction = new Vector3(1, 0, -1);
         effect.DirectionalLight0.SpecularColor = new Vector3(1, 0, 0);
         worth = 100;
         velocity = 150;
     }
 }
コード例 #5
0
 /// <summary>
 /// Event Handler for changing GameState.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private void NewGameState(object sender, EventArgs args)
 {
     switch(gameState)
     {
         case GameStates.MainMenu:
             if (menu == null)menu = new Menu(this);
             menu.LoadContent();
             level = null;
             break;
         case GameStates.Play:
             if (level == null)
             {
                 level = new Level(this, menu.selectedKart);
                 level.LoadContent();
             }
             break;
         case GameStates.Pause:
             menu.type = MenuType.Pause;
             menu.LoadContent();
             break;
         case GameStates.EndGame:
             menu.type = MenuType.HighScores;
             menu.scores.recordScore(level.Player.Score, "");
             menu.LoadContent();
             break;
         default:
             break;
     }
 }
コード例 #6
0
 public Camera(Level level)
 {
     Level = level;
 }
コード例 #7
0
 public Player(Level level, string kart)
 {
     this.kart = kart;
     Level = level;
 }