Ejemplo n.º 1
0
        public WaterBase(Vector3 origin, float height, Vector2 size, String baseTextureKey, String waveTextureKey, int xRowTextures, int yRowTextures, string effectKey, int waveDensity, Game1 game)
            : base(game)
        {
            this.game = game;
            this.origin = origin;
            this.size = size;
            this.baseTextureKey = baseTextureKey;
            this.waveTextureKey = waveTextureKey;
            this.xRowTextures = xRowTextures;
            this.yRowTextures = yRowTextures;
            this.graphicsDevice = game.GraphicsDevice;
            this.content = game.Content;
            this.effectKey = effectKey;
            this.waveDensity = waveDensity;

            vertices = new VertexPositionNormalTexture[4];

            camera = (Camera.Camera)game.Services.GetService(typeof(Camera.Camera));
            level = (States.Level)game.Services.GetService(typeof(States.Level));

            baseEffect = new AlphaTestEffect(graphicsDevice);

            randy = new Random();

            LoadContent();

            //Calculates were the corner vectors of the quad are qoing to be
            CalcVertices();
            FillVertices();
            LoadWaves();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
Ejemplo n.º 3
0
        public void InitiateLoad(Game1 game, string filename)
        {
            this.filename = filename + ".sav";

            try
            {
                device = null;
                StorageDevice.BeginShowSelector(LoadFromDevice, null);
            }

            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Ejemplo n.º 4
0
        public void InitiateSave(Game1 game, Vector3 playerPosition, float playerSize, VertexMultitextured[] terrain, Vector3[] modelRotation, bool[] modelActivated, string filename)
        {
            this.playerPosition = playerPosition;
            this.playerSize = playerSize;
            this.terrain = terrain;
            this.modelRotation = modelRotation;
            this.modelActivated = modelActivated;

            #if WINDOWS
            FileStream fs = new FileStream("lastsave.txt", FileMode.Create);
            StreamWriter sw = new StreamWriter(fs);

            sw.WriteLine(filename);
            Console.WriteLine("Last save created with name: " + filename);

            sw.Close();
            fs.Close();
            #endif

            #if XBOX
            Save.GlobalData gd = new Save.GlobalData();
            gd.InitiateSave(game, filename, "global");
            #endif

            this.filename = filename + ".sav";
            try
            {
                device = null;
                StorageDevice.BeginShowSelector(SaveToDevice, null);
            }

            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Ejemplo n.º 5
0
 public SmokePlumeParticleSystem(Game1 game, ContentManager content)
     : base(game, content)
 {
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Terrain Constructor
 /// </summary>
 /// <param name="game">This game</param>
 /// <param name="heightmapKey">The key of the heightmapKey</param>
 /// <param name="graphicsdevice"></param>
 /// <param name="content"></param>
 public Terrain(Game1 game, string heightmapKey, string texturemapKey, Level level)
     : base(game)
 {
     this.game = game;
     this.heightMapKey = heightmapKey;
     this.textureMapKey = texturemapKey;
     this.graphicsDevice = game.GraphicsDevice;;
     this.content = game.Content;
     this.level = level;
 }