- Timestamp:
- 2015-06-15 11:48:08 (8 years ago)
- Location:
- 2015/24/ohjaajat/Dungeon/Dungeon
- Files:
-
- 11 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/24/ohjaajat/Dungeon/Dungeon/Dungeon/Dungeon.cs
r6088 r6091 194 194 public const int RUUDUN_KOKO = 64; 195 195 196 public static Func<int, int, string, Image[]> LoadImages2 = (a, b, fmt) => 197 LoadImages((from i in Enumerable.Range(a, b) select string.Format(fmt, i)).ToArray()); 198 196 199 #region Kuvat 197 200 Image lattiaKuva = LoadImage("floor"); … … 200 203 Image kiviKuva = LoadImage("rock"); 201 204 Image[] kultuuriKuvat = LoadImages("nyan", "es", "spurdo"); 202 Image[] piikkiAnsaKuvat = LoadImages((from i in Enumerable.Range(1, 7) select String.Format("piikit/piikit{0:0000}", i)).ToArray()); 203 Image[] murskausAnsaKuvat = LoadImages((from i in Enumerable.Range(1, 9) select String.Format("smash/smash{0:0000}", i)).ToArray()); 204 public Image[] vihuKuvat = LoadImages((from i in Enumerable.Range(1, 10) select String.Format("vihu/v{0:0000}", i)).ToArray()); 205 private Image[] piikkiAnsaKuvat = LoadImages2(1, 7, "piikit/piikit{0:0000}"); 206 private Image[] murskausAnsaKuvat = LoadImages2(1, 9, "smash/smash{0:0000}"); 207 public Image[] vihuKuvat = LoadImages2(1, 10, "vihu/v{0:0000}"); 208 public Image[] kirvesVihuKuvat = LoadImages2(1, 10, "kirvesvihu/kv{0:0000}"); 205 209 Image[] ansaKuvat; 206 210 Image partikkeliKuva = LoadImage("partikkeli"); -
2015/24/ohjaajat/Dungeon/Dungeon/Dungeon/MainMenu.cs
r6090 r6091 25 25 private GameObject pohjaAukko; // Aukko josta tulee ulos barbaareja. 26 26 27 private const double BarbaarinNopeus = 40.0; 27 28 private const double Gravitaatio = -600.0; 28 29 private const double Kimmoisuus = -0.4; … … 32 33 public PushButton[] Painikkeet { get; set; } 33 34 34 const double BarbaarinNopeus = 40.0;35 35 private List<GameObject> barbaarit; 36 36 … … 61 61 }; 62 62 barbaariAjastin.Start(); 63 64 //Sound aani = ratasAani.CreateSound();65 ////aani.IsLooped = true;66 //aani.Volume = 1.0;67 //aani.Pitch = 0.0;68 //aani.Play();69 63 } 70 64 71 65 private void LuoBarbaari() 72 66 { 73 var barbaari = new GameObject( 64, 64);74 //barbaari.Right = peli.Camera.ScreenToWorld(new Vector(Game.Screen.Left, 0)).X;67 var barbaari = new GameObject(50, 80); 68 barbaari.Size *= 0.75; 75 69 barbaari.X = pohjaAukko.X - pohjaAukko.Width/3; 76 70 barbaari.Bottom = peli.Camera.ScreenToWorld(new Vector(0, Game.Screen.Bottom)).Y; // + RandomGen.NextDouble(0, 32); 77 71 barbaari.Image = peli.vihuKuvat[0]; 78 barbaari.Animation = new Animation( peli.vihuKuvat) { FPS = 10 };72 barbaari.Animation = new Animation(RandomGen.SelectOne(peli.vihuKuvat, peli.kirvesVihuKuvat)) { FPS = 10 }; 79 73 barbaari.Animation.Start(); 80 74 peli.Add(barbaari); … … 130 124 pala.Y += palaNopeus * dt; 131 125 126 // Soitetaan ääni kun pala on liikkunut tarpeeksi. 132 127 palaSiirtyma += palaNopeus * dt; 133 128 if (Math.Abs(palaSiirtyma) > 20.0 && Math.Abs(palaNopeus) > 10.0) -
2015/24/ohjaajat/Dungeon/Dungeon/DungeonContent/DungeonContent.contentproj
r6090 r6091 287 287 </Compile> 288 288 </ItemGroup> 289 <ItemGroup> 290 <Compile Include="kirvesvihu\kv0001.png"> 291 <Name>kv0001</Name> 292 <Importer>TextureImporter</Importer> 293 <Processor>TextureProcessor</Processor> 294 </Compile> 295 <Compile Include="kirvesvihu\kv0002.png"> 296 <Name>kv0002</Name> 297 <Importer>TextureImporter</Importer> 298 <Processor>TextureProcessor</Processor> 299 </Compile> 300 <Compile Include="kirvesvihu\kv0003.png"> 301 <Name>kv0003</Name> 302 <Importer>TextureImporter</Importer> 303 <Processor>TextureProcessor</Processor> 304 </Compile> 305 <Compile Include="kirvesvihu\kv0004.png"> 306 <Name>kv0004</Name> 307 <Importer>TextureImporter</Importer> 308 <Processor>TextureProcessor</Processor> 309 </Compile> 310 <Compile Include="kirvesvihu\kv0005.png"> 311 <Name>kv0005</Name> 312 <Importer>TextureImporter</Importer> 313 <Processor>TextureProcessor</Processor> 314 </Compile> 315 <Compile Include="kirvesvihu\kv0006.png"> 316 <Name>kv0006</Name> 317 <Importer>TextureImporter</Importer> 318 <Processor>TextureProcessor</Processor> 319 </Compile> 320 <Compile Include="kirvesvihu\kv0007.png"> 321 <Name>kv0007</Name> 322 <Importer>TextureImporter</Importer> 323 <Processor>TextureProcessor</Processor> 324 </Compile> 325 <Compile Include="kirvesvihu\kv0008.png"> 326 <Name>kv0008</Name> 327 <Importer>TextureImporter</Importer> 328 <Processor>TextureProcessor</Processor> 329 </Compile> 330 <Compile Include="kirvesvihu\kv0009.png"> 331 <Name>kv0009</Name> 332 <Importer>TextureImporter</Importer> 333 <Processor>TextureProcessor</Processor> 334 </Compile> 335 <Compile Include="kirvesvihu\kv0010.png"> 336 <Name>kv0010</Name> 337 <Importer>TextureImporter</Importer> 338 <Processor>TextureProcessor</Processor> 339 </Compile> 340 </ItemGroup> 289 341 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 290 342 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset
for help on using the changeset viewer.