Changeset 7023 for 2015


Ignore:
Timestamp:
2015-07-24 12:09:07 (8 years ago)
Author:
picakrty
Message:

Peli semi valmis silti voi hia jos siltä tuntuu

Location:
2015/30/CamillaT
Files:
17 added
13 edited

Legend:

Unmodified
Added
Removed
  • 2015/30/CamillaT/YouCombat/YouCombat/YouCombat/YouCombat.cs

    r6991 r7023  
    1212    Ihminen rauski; 
    1313    Ihminen miisas; 
    14     //PlatformCharacter soikku; 
     14    //Ihminen soikku; 
     15    //Ihminen herba; 
     16    //Ihminen lakko; 
     17    //Ihminen j0p; 
     18    //Ihminen pinsku  
    1519 
    1620    Image tubecon      = LoadImage("TubeCombat - tausta"); 
     
    1822    Image miisasinKuva = LoadImage("TubeCombat - Miisas"); 
    1923    Image soikunKuva   = LoadImage("TubeCombat - Soikku"); 
     24    Image tietoKuva    = LoadImage("TubeCombat - Tietoa"); 
     25    //Image herbanKuva = LoadImage("TubeCombat - Herba "); 
     26    //Image lakonKuva  = LoadImage("TubeCombat - Lakko "); 
     27    //Image j0pinKuva  = LoadImage("TubeCombat - J0P   "); 
     28    //Image pinskunKuva = LoadImage("TubeCombat - Pinsku"); 
     29 
     30    Image rauskinUlti  = LoadImage  ("TubeCombat - Käsi"); 
     31    Image miisasUlti   = LoadImage("TubeCombat - MiisasUlti"); 
    2032 
    2133    Ihminen pelaaja1; 
     
    3446    public override void Begin() 
    3547    { 
    36         // TODO Maisema valmis. Hahmoille hyppy ja hyökkäys animaatiot??? Nosta alarajaa! Menuvalikko ja musiikki! 
     48        // TODO Lisää hahmoja, niiden liikkeet, uusia taustoja, enemmän efektejä ja erillaisia efekti musiikkeja ja eri kenttiin eri musat: ) 
     49        AlkuValikko(); 
     50    } 
     51 
     52    void AloitaPeli() 
     53    { 
     54  
    3755                 LuoKentta(); 
    3856                    Hahmot(); 
     
    4260           pelaaja2 = miisas; 
    4361            HahmojenOhjaus(); 
    44  
     62               LuoHelaBars(); 
     63               
    4564    } 
    4665 
     
    6382 
    6483        Gravity = new Vector(0.0, -700.0); 
     84 
     85 
    6586    } 
    6687 
     
    94115         //Add(herba); 
    95116 
     117    } 
     118 
     119    void LuoHelaBars() 
     120    { 
     121        ProgressBar elamaPalkki1 = new ProgressBar(350, 150); 
     122        elamaPalkki1.X = Screen.Right - 200; 
     123        elamaPalkki1.Y = Screen.Top - 100; 
     124        elamaPalkki1.BindTo(rauski.ElamaLaskuri); 
     125        elamaPalkki1.Image = LoadImage ("ElamaPalkki1-0prossaa"); 
     126        elamaPalkki1.BarImage = LoadImage("ElamaPalkki1");  
     127        Add(elamaPalkki1); 
     128 
     129        ProgressBar elamaPalkki2 = new ProgressBar(350, 150); 
     130        elamaPalkki2.X = Screen.Left + 200; 
     131        elamaPalkki2.Y = Screen.Top - 100; 
     132        elamaPalkki2.BindTo(miisas.ElamaLaskuri); 
     133        elamaPalkki2.Image = LoadImage("ElamaPalkki-0prossaa"); 
     134        elamaPalkki2.BarImage = LoadImage("ElamaPalkki");  
     135        Add(elamaPalkki2); 
    96136    } 
    97137 
     
    116156         
    117157         
    118         //Miisasken hyppy ja Ulti. 
     158        //Miisasken hyppy.2 
    119159 
    120160    } 
     
    127167        Keyboard.Listen(Key.W, ButtonState.Pressed,  Hyppaa,   "Hyppy Ylos",   pelaaja1, hyppynopeus); 
    128168        Keyboard.Listen(Key.D, ButtonState.Down,     Liikuta,  "Liiku Oikealle",    pelaaja1, nopeus); 
    129         Keyboard.Listen(Key.S, ButtonState.Pressed,  Hyokkaus, "Hyokkaa Eteen",   pelaaja1, pelaaja2); 
    130         Keyboard.Listen(Key.E, ButtonState.Pressed, RauskiinaHyokkays,  "Hyokkaa Eteen",   pelaaja1, pelaaja2); 
    131  
    132         Keyboard.Listen(Key.Left, ButtonState.Down,  Liikuta,  "Liiku Vasemmalle", pelaaja2, -nopeus); 
    133         Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa,   "Hyppy Ylos",   pelaaja2, hyppynopeus); 
    134         Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta,  "Liiku Oikealle",    pelaaja2, nopeus); 
    135         Keyboard.Listen(Key.Enter, ButtonState.Pressed, Liikuta, "Hyokkaa Eteen",  pelaaja2, nopeus); 
     169        Keyboard.Listen(Key.S, ButtonState.Pressed, Hyokkaus, "Hyokkaa Eteen", pelaaja1, pelaaja2, new Animation[] {rauskinHyokkays, new Animation(rauskinKuva)}, 25); 
     170        Keyboard.Listen(Key.E, ButtonState.Pressed, RauskiinaHyokkays,  "Hyokkaa Eteen", pelaaja1, pelaaja2); 
     171        Keyboard.Listen(Key.LeftShift, ButtonState.Pressed, Ulti, "Ulti Eteen", pelaaja1, pelaaja2, rauskinUlti); 
     172 
     173        Keyboard.Listen(Key.Left, ButtonState.Down,  Liikuta,  "Liiku Vasemmalle",   pelaaja2, -nopeus); 
     174        Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa,   "Hyppy Ylos",     pelaaja2, hyppynopeus); 
     175        Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta,  "Liiku Oikealle",      pelaaja2, nopeus); 
     176        Keyboard.Listen(Key.Enter, ButtonState.Pressed, Hyokkaus, "Hyokkaa Eteen",  pelaaja2, pelaaja1, new Animation[] {miisasHyokkays, new Animation(miisasinKuva)}, 25); 
     177        Keyboard.Listen(Key.Space, ButtonState.Pressed, Ulti, "Ulti Eteen",     pelaaja2, pelaaja1, miisasUlti); 
    136178 
    137179        //Korjaa Miisasin eka hyökkays ja ultit molemmille!!!!!! 
     
    155197    } 
    156198 
    157     void Hyokkaus(PlatformCharacter pelaaja, Ihminen hyokkayksenKohde) 
    158     { 
    159         pelaaja.AnimIdle = rauskinHyokkays; 
     199    void Hyokkaus(PlatformCharacter pelaaja, Ihminen hyokkayksenKohde, Animation[] animaatiot, int vahingonMaara) 
     200    { 
     201        Animation hyokkaysanim = animaatiot[0]; 
     202        Animation paikallaananim = animaatiot[1]; 
     203 
     204        pelaaja.AnimIdle = hyokkaysanim; 
     205        pelaaja.AnimIdle.StopOnLastFrame = true; 
     206 
     207        // Tässä Lisätään tavallinen animaatio päälle kun hyökkäys on ohi. 
     208        pelaaja.AnimIdle.Played += delegate 
     209        { 
     210            pelaaja.AnimIdle = paikallaananim; 
     211            hyokkayksenKohde.OtaVahinkoa(vahingonMaara); 
     212 
     213 
     214        }; 
     215 
     216    } 
     217 
     218 
     219    void RauskiinaHyokkays(PlatformCharacter pelaaja, Ihminen hyokkayksenKohde) 
     220    { 
     221        pelaaja.AnimIdle = rauskiinaHyokkays; 
    160222        pelaaja.AnimIdle.StopOnLastFrame = true; 
    161223 
     
    164226        { 
    165227            pelaaja.AnimIdle = new Animation(rauskinKuva); 
    166             hyokkayksenKohde.OtaVahinkoa(); 
     228            hyokkayksenKohde.OtaVahinkoa(25); 
    167229 
    168230 
     
    171233    } 
    172234 
    173  
    174     void RauskiinaHyokkays(PlatformCharacter pelaaja, Ihminen hyokkayksenKohde) 
    175     { 
    176         pelaaja.AnimIdle = rauskiinaHyokkays; 
    177         pelaaja.AnimIdle.StopOnLastFrame = true; 
    178  
    179         // Tässä Lisätään tavallinen animaatio päälle kun hyökkäys on ohi. 
    180         pelaaja.AnimIdle.Played += delegate 
    181         { 
    182             pelaaja.AnimIdle = new Animation(rauskinKuva); 
    183             hyokkayksenKohde.OtaVahinkoa(); 
    184  
    185  
    186         }; 
    187  
     235    void Ulti(Ihminen hyokkaaja, Ihminen uhri, Image ultiKuva) 
     236    { 
     237        GameObject ulti = new GameObject(Screen.Width, Screen.Height); 
     238        Add(ulti); 
     239        ulti.Image = ultiKuva; 
     240        Timer.SingleShot(2.0, delegate { ulti.Destroy(); uhri.OtaVahinkoa(50); }); 
     241         
    188242    } 
    189243 
     
    206260        Keyboard.Listen(Key.P, ButtonState.Pressed, Pause, "Pysäyttää pelin"); 
    207261 
    208     } 
    209  
     262 
     263 
     264    } 
     265 
     266    void AloitaAlusta() 
     267    { 
     268        ClearAll(); 
     269        LuoKentta(); 
     270        HahmojenOhjaus(); 
     271    } 
     272 
     273    void AlkuValikko() 
     274    { 
     275        Level.Background.Color = Color.Black; 
     276        MultiSelectWindow alkuValikko = new MultiSelectWindow("TubeCombat", "Aloita peli", "Lopeta", "Tietoa"); 
     277        alkuValikko.SelectionColor = Color.Blue; 
     278        alkuValikko.Color = Color.Red; 
     279        Add(alkuValikko); 
     280        alkuValikko.AddItemHandler(0, AloitaPeli); 
     281        alkuValikko.AddItemHandler(1, Exit); 
     282        alkuValikko.AddItemHandler(2, Tietoa); 
     283 
     284    } 
     285 
     286    void Tietoa() 
     287    { 
     288        GameObject tiedot = new GameObject(tietoKuva); 
     289        Add(tiedot); 
     290 
     291        Timer.SingleShot(4, delegate { ClearAll(); AlkuValikko(); }); 
     292    } 
    210293     
    211294} 
     
    214297class Ihminen : PlatformCharacter 
    215298    { 
    216         private IntMeter elamaLaskuri = new IntMeter(3, 0, 3); 
     299        private IntMeter elamaLaskuri = new IntMeter(100, 0, 200); 
    217300        public IntMeter ElamaLaskuri { get { return elamaLaskuri; } } 
    218301 
     
    227310  
    228311 
    229        public void OtaVahinkoa() 
     312       public void OtaVahinkoa(int vahinko) 
    230313        { 
    231314            //  AddCollisionHandler(pelaaja1, Pelaaja1Tormasi); 
    232             elamaLaskuri.Value--; 
     315            elamaLaskuri.Value-=vahinko; 
    233316 
    234317        } 
    235     } 
    236  
    237 public class Peli : PhysicsGame 
    238 { 
    239     DoubleMeter elamaLaskuri; 
    240  
    241     public override void Begin() 
    242     { 
    243         //... 
    244     } 
    245  
    246     void LuoElamaLaskuri() 
    247     { 
    248         elamaLaskuri = new DoubleMeter(10); 
    249         elamaLaskuri.MaxValue = 10; 
    250         elamaLaskuri.LowerLimit += ElamaLoppui; 
    251  
    252         ProgressBar elamaPalkki = new ProgressBar(150, 20); 
    253         elamaPalkki.X = Screen.Left + 150; 
    254         elamaPalkki.Y = Screen.Top - 20; 
    255         elamaPalkki.BindTo(elamaLaskuri); 
    256         Add(elamaPalkki); 
    257     } 
    258  
    259     void ElamaLoppui() 
    260     { 
    261         MessageDisplay.Add("Elämät loppuivat, Pelaaja1 voitti!."); 
    262     } 
     318 
     319     
     320 
     321     
     322 
    263323 
    264324 
  • 2015/30/CamillaT/YouCombat/YouCombat/YouCombat/YouCombat.csproj.Debug.cachefile

    r6991 r7023  
    2929Content\MiisasHyokkays\MiisasHyokkays3.xnb 
    3030Content\MiisasHyokkays.xnb 
     31Content\TubeCombat - MiisasUlti.xnb 
     32Content\TubeCombat - KÀsi.xnb 
     33Content\ElamaPalkki.xnb 
     34Content\ElamaPalkki-0prossaa.xnb 
     35Content\ElamaPalkki1.xnb 
     36Content\ElamaPalkki1-0prossaa.xnb 
     37Content\TubeCombat - Tietoa.xnb 
    3138Content\TaustaMusa.wma 
    3239Content\Rauski.anim 
  • 2015/30/CamillaT/YouCombat/YouCombat/YouCombat/obj/x86/Debug/YouCombat.csproj.FileListAbsolute.txt

    r6991 r7023  
    4343C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\MiisasHyokkays\MiisasHyokkays3.xnb 
    4444C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\MiisasHyokkays.xnb 
     45C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\TubeCombat - KÀsi.xnb 
     46C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\TubeCombat - MiisasUlti.xnb 
     47C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\ElamaPalkki.xnb 
     48C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\ElamaPalkki-0prossaa.xnb 
     49C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\ElamaPalkki1.xnb 
     50C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\ElamaPalkki1-0prossaa.xnb 
     51C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\TubeCombat - Tietoa.xnb 
  • 2015/30/CamillaT/YouCombat/YouCombat/YouCombat/obj/x86/Debug/cachefile-{66C8E644-CC23-4609-AD73-46EEDD2FF150}-targetpath.txt

    r6991 r7023  
    3030Content\MiisasHyokkays\MiisasHyokkays3.xnb 
    3131Content\MiisasHyokkays.xnb 
     32Content\TubeCombat - MiisasUlti.xnb 
     33Content\TubeCombat - KÀsi.xnb 
     34Content\ElamaPalkki.xnb 
     35Content\ElamaPalkki-0prossaa.xnb 
     36Content\ElamaPalkki1.xnb 
     37Content\ElamaPalkki1-0prossaa.xnb 
     38Content\TubeCombat - Tietoa.xnb 
    3239Content\Rauski.anim 
    3340Content\Miisas.anim 
  • 2015/30/CamillaT/YouCombat/YouCombat/YouCombatContent/MiisasHyokkays.anim

    r6982 r7023  
     1FPS = 2 
  • 2015/30/CamillaT/YouCombat/YouCombat/YouCombatContent/YouCombatContent.contentproj

    r6991 r7023  
    229229    </Compile> 
    230230  </ItemGroup> 
     231  <ItemGroup> 
     232    <Compile Include="TubeCombat - MiisasUlti.png"> 
     233      <Name>TubeCombat - MiisasUlti</Name> 
     234      <Importer>TextureImporter</Importer> 
     235      <Processor>TextureProcessor</Processor> 
     236    </Compile> 
     237  </ItemGroup> 
     238  <ItemGroup> 
     239    <Compile Include="TubeCombat - Käsi.png"> 
     240      <Name>TubeCombat - Käsi</Name> 
     241      <Importer>TextureImporter</Importer> 
     242      <Processor>TextureProcessor</Processor> 
     243    </Compile> 
     244  </ItemGroup> 
     245  <ItemGroup> 
     246    <Compile Include="ElamaPalkki.png"> 
     247      <Name>ElamaPalkki</Name> 
     248      <Importer>TextureImporter</Importer> 
     249      <Processor>TextureProcessor</Processor> 
     250    </Compile> 
     251  </ItemGroup> 
     252  <ItemGroup> 
     253    <Compile Include="ElamaPalkki-0prossaa.png"> 
     254      <Name>ElamaPalkki-0prossaa</Name> 
     255      <Importer>TextureImporter</Importer> 
     256      <Processor>TextureProcessor</Processor> 
     257    </Compile> 
     258  </ItemGroup> 
     259  <ItemGroup> 
     260    <Compile Include="ElamaPalkki1.png"> 
     261      <Name>ElamaPalkki1</Name> 
     262      <Importer>TextureImporter</Importer> 
     263      <Processor>TextureProcessor</Processor> 
     264    </Compile> 
     265  </ItemGroup> 
     266  <ItemGroup> 
     267    <Compile Include="ElamaPalkki1-0prossaa.png"> 
     268      <Name>ElamaPalkki1-0prossaa</Name> 
     269      <Importer>TextureImporter</Importer> 
     270      <Processor>TextureProcessor</Processor> 
     271    </Compile> 
     272  </ItemGroup> 
     273  <ItemGroup> 
     274    <Compile Include="TubeCombat - Tietoa.png"> 
     275      <Name>TubeCombat - Tietoa</Name> 
     276      <Importer>TextureImporter</Importer> 
     277      <Processor>TextureProcessor</Processor> 
     278    </Compile> 
     279  </ItemGroup> 
    231280  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    232281  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2015/30/CamillaT/YouCombat/YouCombat/YouCombatContent/obj/x86/Debug/ContentPipeline.xml

    r6991 r7023  
    286286      <Options>None</Options> 
    287287      <Output>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\MiisasHyokkays.xnb</Output> 
    288       <Time>2015-07-23T14:46:54.1276418+03:00</Time> 
     288      <Time>2015-07-24T10:32:11.2960346+03:00</Time> 
    289289      <Request>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\MiisasHyokkays\MiisasHyokkays1.xnb</Request> 
    290290      <Request>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\MiisasHyokkays\MiisasHyokkays2.xnb</Request> 
    291291      <Request>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\MiisasHyokkays\MiisasHyokkays3.xnb</Request> 
     292    </Item> 
     293    <Item> 
     294      <Source>TubeCombat - MiisasUlti.png</Source> 
     295      <Name>TubeCombat - MiisasUlti</Name> 
     296      <Importer>TextureImporter</Importer> 
     297      <Processor>TextureProcessor</Processor> 
     298      <Options>None</Options> 
     299      <Output>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\TubeCombat - MiisasUlti.xnb</Output> 
     300      <Time>2015-07-24T10:04:33.8895296+03:00</Time> 
     301    </Item> 
     302    <Item> 
     303      <Source>TubeCombat - Käsi.png</Source> 
     304      <Name>TubeCombat - Käsi</Name> 
     305      <Importer>TextureImporter</Importer> 
     306      <Processor>TextureProcessor</Processor> 
     307      <Options>None</Options> 
     308      <Output>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\TubeCombat - Käsi.xnb</Output> 
     309      <Time>2015-07-24T10:08:28.2497296+03:00</Time> 
     310    </Item> 
     311    <Item> 
     312      <Source>ElamaPalkki.png</Source> 
     313      <Name>ElamaPalkki</Name> 
     314      <Importer>TextureImporter</Importer> 
     315      <Processor>TextureProcessor</Processor> 
     316      <Options>None</Options> 
     317      <Output>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\ElamaPalkki.xnb</Output> 
     318      <Time>2015-07-24T10:25:12.6221296+03:00</Time> 
     319    </Item> 
     320    <Item> 
     321      <Source>ElamaPalkki-0prossaa.png</Source> 
     322      <Name>ElamaPalkki-0prossaa</Name> 
     323      <Importer>TextureImporter</Importer> 
     324      <Processor>TextureProcessor</Processor> 
     325      <Options>None</Options> 
     326      <Output>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\ElamaPalkki-0prossaa.xnb</Output> 
     327      <Time>2015-07-24T10:25:28.4405296+03:00</Time> 
     328    </Item> 
     329    <Item> 
     330      <Source>ElamaPalkki1.png</Source> 
     331      <Name>ElamaPalkki1</Name> 
     332      <Importer>TextureImporter</Importer> 
     333      <Processor>TextureProcessor</Processor> 
     334      <Options>None</Options> 
     335      <Output>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\ElamaPalkki1.xnb</Output> 
     336      <Time>2015-07-24T10:30:44.2152292+03:00</Time> 
     337    </Item> 
     338    <Item> 
     339      <Source>ElamaPalkki1-0prossaa.png</Source> 
     340      <Name>ElamaPalkki1-0prossaa</Name> 
     341      <Importer>TextureImporter</Importer> 
     342      <Processor>TextureProcessor</Processor> 
     343      <Options>None</Options> 
     344      <Output>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\ElamaPalkki1-0prossaa.xnb</Output> 
     345      <Time>2015-07-24T10:30:27.1684634+03:00</Time> 
     346    </Item> 
     347    <Item> 
     348      <Source>TubeCombat - Tietoa.png</Source> 
     349      <Name>TubeCombat - Tietoa</Name> 
     350      <Importer>TextureImporter</Importer> 
     351      <Processor>TextureProcessor</Processor> 
     352      <Options>None</Options> 
     353      <Output>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\TubeCombat - Tietoa.xnb</Output> 
     354      <Time>2015-07-24T11:53:17.7930017+03:00</Time> 
    292355    </Item> 
    293356    <BuildSuccessful>true</BuildSuccessful> 
Note: See TracChangeset for help on using the changeset viewer.