- Timestamp:
- 2014-07-23 12:57:36 (9 years ago)
- Location:
- 2014/30/MikkoI/WindowsGame1
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Game1.cs
r5581 r5582 24 24 MouseState previousMouseState; 25 25 Vector2 mapSize = new Vector2(40, 40); 26 Random random;26 public Random random; 27 27 Camera camera; 28 28 MapRenderer mapRenderer; … … 73 73 spriteBatch = new SpriteBatch(GraphicsDevice); 74 74 75 allMaps.Add(new Map(new Texture2D(GraphicsDevice, 1, 1), 10 , 10));75 allMaps.Add(new Map(new Texture2D(GraphicsDevice, 1, 1), 100, 100)); 76 76 77 77 mapRenderer = new MapRenderer(spriteBatch, allMaps[currentMapIndex], screenSize); -
2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Map/Map.cs
r5581 r5582 38 38 for (var y = 0; y < Size.Y; y++) { 39 39 Tiles[x,y] = new Tile("testitile");//jotain shittiä myöhemmin 40 if (Pikseli.Instance.random.NextDouble()<0.1) 40 41 Objects.Add(new MapObject("testipuu", x, y)); 41 42 } -
2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Render/MapRenderer.cs
r5581 r5582 14 14 Map map; 15 15 Vector2 screenSize; 16 Vector3 sunPosition = new Vector3(0, 0,15);16 Vector3 sunPosition = new Vector3(0, 0, 15); 17 17 18 18 public MapRenderer(SpriteBatch spriteBatch, Map map, Vector2 screenSize) … … 47 47 //varjot testi 48 48 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); 50 50 51 51 foreach (MapObject obj in map.Objects) … … 57 57 58 58 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); 60 60 double shadowOffsetX = Math.Cos(shadowAngle + Math.PI / 2) * 5, 61 61 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); 64 64 //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); 65 65 } -
2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/obj/x86/Debug/ContentPipeline-{97A5BC4F-C40A-4D52-BF03-8923DFD60CA0}.xml
r5581 r5582 18 18 <Options>None</Options> 19 19 <Output>C:\MyTemp\MikkoI\WindowsGame1\WindowsGame1\WindowsGame1\bin\x86\Debug\Content\Graphics\Test\Kuusi.xnb</Output> 20 <Time>2014-07-23T1 1:18:07.466918+03:00</Time>20 <Time>2014-07-23T12:43:51.363918+03:00</Time> 21 21 </Item> 22 22 <BuildSuccessful>true</BuildSuccessful>
Note: See TracChangeset
for help on using the changeset viewer.