// For now we'll take these values in, eventually we'll // take a Camera object public void Draw(GridCamera camera) { foreach (var mesh in model.Meshes) { foreach (BasicEffect effect in mesh.Effects) { effect.EnableDefaultLighting(); effect.PreferPerPixelLighting = true; effect.World = GetWorldMatrix(); effect.View = camera.ViewMatrix; effect.Projection = camera.ProjectionMatrix; } mesh.Draw(); } }
public void Step() { if (CheckWin()) { GridCamera.RaycastOff(); state = GameState.Complete; return; } if (CheckDraw()) { GridCamera.RaycastOff(); state = GameState.Draw; return; } NextTurn(); }
public void GameInit() { GridCamera.RaycastOn(); GridGenerator.instance.Clear(); GridGenerator.instance.GenerateHex(tile, Vector3.zero, 10, 10); List <GameObject> list = new List <GameObject> (); GameObject s1 = GridGenerator.instance.Fetch(3, 3); s1.GetComponent <SbModel>().SelectArea(); GameObject s2 = GridGenerator.instance.Fetch(6, 4); s2.GetComponent <SbModel>().SelectCone(); GameObject s3 = GridGenerator.instance.Fetch(7, 1); s3.GetComponent <SbModel>().SelectLine(); }
public void GameInit() { GridCamera.RaycastOn(); turn = 0; player = Player.Player1; state = GameState.Playing; board = new List <TttModel>(); GridGenerator.instance.Clear(); GridGenerator.instance.Generate(tile, Vector3.zero, 3, 3); int index = 0; foreach (GameObject go in GridGenerator.instance.tiles) { TttModel tm = go.GetComponent <TttModel>() as TttModel; tm.index = index; board.Add(tm); index++; } }