Changeset 6091 for 2015/24


Ignore:
Timestamp:
2015-06-15 11:48:08 (4 years ago)
Author:
sieerinn
Message:

Toisen vihollisen kuvat + jotain säätöä.

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  
    194194    public const int RUUDUN_KOKO = 64; 
    195195 
     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 
    196199    #region Kuvat 
    197200    Image lattiaKuva = LoadImage("floor"); 
     
    200203    Image kiviKuva = LoadImage("rock"); 
    201204    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}"); 
    205209    Image[] ansaKuvat; 
    206210    Image partikkeliKuva = LoadImage("partikkeli"); 
  • 2015/24/ohjaajat/Dungeon/Dungeon/Dungeon/MainMenu.cs

    r6090 r6091  
    2525    private GameObject pohjaAukko; // Aukko josta tulee ulos barbaareja. 
    2626 
     27    private const double BarbaarinNopeus = 40.0; 
    2728    private const double Gravitaatio = -600.0; 
    2829    private const double Kimmoisuus = -0.4; 
     
    3233    public PushButton[] Painikkeet { get; set; } 
    3334 
    34     const double BarbaarinNopeus = 40.0; 
    3535    private List<GameObject> barbaarit; 
    3636 
     
    6161        }; 
    6262        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(); 
    6963    } 
    7064 
    7165    private void LuoBarbaari() 
    7266    { 
    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; 
    7569        barbaari.X = pohjaAukko.X - pohjaAukko.Width/3; 
    7670        barbaari.Bottom = peli.Camera.ScreenToWorld(new Vector(0, Game.Screen.Bottom)).Y; // + RandomGen.NextDouble(0, 32); 
    7771        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 }; 
    7973        barbaari.Animation.Start(); 
    8074        peli.Add(barbaari); 
     
    130124        pala.Y += palaNopeus * dt; 
    131125 
     126        // Soitetaan ääni kun pala on liikkunut tarpeeksi. 
    132127        palaSiirtyma += palaNopeus * dt; 
    133128        if (Math.Abs(palaSiirtyma) > 20.0 && Math.Abs(palaNopeus) > 10.0) 
  • 2015/24/ohjaajat/Dungeon/Dungeon/DungeonContent/DungeonContent.contentproj

    r6090 r6091  
    287287    </Compile> 
    288288  </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> 
    289341  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    290342  <!--  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.