Changeset 5582 for 2014/30


Ignore:
Timestamp:
2014-07-23 12:57:36 (5 years ago)
Author:
mijoilmo
Message:
 
Location:
2014/30/MikkoI/WindowsGame1
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • 2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Game1.cs

    r5581 r5582  
    2424        MouseState previousMouseState; 
    2525        Vector2 mapSize = new Vector2(40, 40); 
    26         Random random; 
     26        public Random random; 
    2727        Camera camera; 
    2828        MapRenderer mapRenderer; 
     
    7373            spriteBatch = new SpriteBatch(GraphicsDevice); 
    7474 
    75             allMaps.Add(new Map(new Texture2D(GraphicsDevice, 1, 1), 10, 10)); 
     75            allMaps.Add(new Map(new Texture2D(GraphicsDevice, 1, 1), 100, 100)); 
    7676 
    7777            mapRenderer = new MapRenderer(spriteBatch, allMaps[currentMapIndex], screenSize); 
  • 2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Map/Map.cs

    r5581 r5582  
    3838                for (var y = 0; y < Size.Y; y++) { 
    3939                    Tiles[x,y] = new Tile("testitile");//jotain shittiä myöhemmin 
     40                    if (Pikseli.Instance.random.NextDouble()<0.1) 
    4041                    Objects.Add(new MapObject("testipuu", x, y)); 
    4142                } 
  • 2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Render/MapRenderer.cs

    r5581 r5582  
    1414        Map map; 
    1515        Vector2 screenSize; 
    16         Vector3 sunPosition = new Vector3(0,0,15); 
     16        Vector3 sunPosition = new Vector3(0, 0, 15); 
    1717 
    1818        public MapRenderer(SpriteBatch spriteBatch, Map map, Vector2 screenSize) 
     
    4747            //varjot testi 
    4848 
    49             sunPosition = new Vector3((float)Pikseli.Instance.gameTime.TotalGameTime.TotalSeconds, (float)Pikseli.Instance.gameTime.TotalGameTime.TotalSeconds, 0); 
     49            sunPosition = new Vector3(-20 + (float)Pikseli.Instance.gameTime.TotalGameTime.TotalSeconds + 1.42f, -20 + (float)Pikseli.Instance.gameTime.TotalGameTime.TotalSeconds, 0); 
    5050 
    5151            foreach (MapObject obj in map.Objects) 
     
    5757 
    5858 
    59                 float shadowAngle = (float)(Math.Atan2(erotus.Y, erotus.X) - Math.PI/2); 
     59                float shadowAngle = (float)(Math.Atan2(erotus.Y, erotus.X) - Math.PI / 2); 
    6060                double shadowOffsetX = Math.Cos(shadowAngle + Math.PI / 2) * 5, 
    6161                    shadowOffsetY = Math.Sin(shadowAngle + Math.PI / 2) * 5; 
    62  
    63                 spriteBatch.Draw(texture, new Rectangle((int)((obj.position.X + 0.5) * 64 + shadowOffsetX), (int)((obj.position.Y + 0.5) * 64 + shadowOffsetY), texture.Width, texture.Height), null, new Color(0f,0f,0f,0.3f), shadowAngle, new Vector2(texture.Width / 2, texture.Height), SpriteEffects.None, 0f); 
     62                     
     63                spriteBatch.Draw(texture, new Rectangle((int)((obj.position.X + 0.5) * 64), (int)((obj.position.Y + 0.5) * 64), texture.Width, texture.Height), null, new Color(0f, 0f, 0f, 0.5f), shadowAngle, new Vector2(texture.Width / 2, texture.Height), SpriteEffects.None, 0f); 
    6464                //spriteBatch.Draw(obj.texture, new Rectangle((int)(obj.position.X + 0.5) * 64, (int)(obj.position.Y + 0.5) * 64, (int)obj.texture.Width, (int)obj.texture.Height), null, Color.Gray, MathHelper.ToRadians(30), new Vector2(obj.texture.Width / 2, obj.texture.Height), SpriteEffects.None, 0f); 
    6565            } 
  • 2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/obj/x86/Debug/ContentPipeline-{97A5BC4F-C40A-4D52-BF03-8923DFD60CA0}.xml

    r5581 r5582  
    1818      <Options>None</Options> 
    1919      <Output>C:\MyTemp\MikkoI\WindowsGame1\WindowsGame1\WindowsGame1\bin\x86\Debug\Content\Graphics\Test\Kuusi.xnb</Output> 
    20       <Time>2014-07-23T11:18:07.466918+03:00</Time> 
     20      <Time>2014-07-23T12:43:51.363918+03:00</Time> 
    2121    </Item> 
    2222    <BuildSuccessful>true</BuildSuccessful> 
Note: See TracChangeset for help on using the changeset viewer.