Changeset 8243


Ignore:
Timestamp:
2016-07-29 11:31:42 (3 years ago)
Author:
kaspalmu
Message:
 
Location:
2016/30/KasimirP
Files:
15 added
13 edited

Legend:

Unmodified
Added
Removed
  • 2016/30/KasimirP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1.cs

    r8212 r8243  
    3232    int index = 0; 
    3333 
    34     bool SuperVoima = false; 
    35  
    36     //SoundEffect maaliAani = LoadSoundEffect("illuminati"); 
     34    bool SuperVoima = false, alkanut = false; 
     35 
     36    SoundEffect maaliAani = LoadSoundEffect("Powerup5"); 
     37    SoundEffect voimaLoppuu = LoadSoundEffect("Powerup8");   
    3738 
    3839    public override void Begin() 
     40 
     41    { 
     42        Valikko(); 
     43         
     44    } 
     45 
     46     
     47 
     48    void LuoKentta() 
    3949    { 
    4050        Gravity = new Vector(0, -1000); 
    41  
    42         LuoKentta(); 
    43         LisaaNappaimet(); 
    44         Level.CreateBorders(); 
    45         Camera.Follow(pelaaja1); 
    46         Camera.ZoomFactor = 1.2; 
    47         Camera.StayInLevel = true; 
    48         SmoothTextures = false; 
    49         Window.Fullscreen = true; 
    50     } 
    51  
    52     void LuoKentta() 
    53     { 
     51         
    5452        TileMap kentta = TileMap.FromLevelAsset("kentta1"); 
    5553        kentta.SetTileMethod('#', LisaaTaso); 
     
    6159        kentta.SetTileMethod('F', LisaaLentovihu); 
    6260        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    63          
     61 
     62        LisaaNappaimet(); 
     63        Level.CreateBorders(); 
     64        Camera.Follow(pelaaja1); 
     65        Camera.ZoomFactor = 1.2; 
     66        Camera.StayInLevel = true; 
     67        SmoothTextures = false; 
     68        Window.Fullscreen = true; 
     69        MediaPlayer.Play("musa"); 
     70        MediaPlayer.IsRepeating = true; 
     71        MediaPlayer.Volume = 0.5; 
     72 
    6473        //Level.Background.CreateGradient(Color.White, Color.LimeGreen); 
    6574        Level.Background.Image = kek; 
     
    7281        BRAIN.FarBrain = new RandomMoverBrain(); 
    7382        //lentokone.Brain = BRAIN; 
    74  
     83        alkanut = true; 
    7584    } 
    7685 
     
    103112        tahti.Image = tahtiKuva; 
    104113        tahti.Tag = "tahti"; 
     114        
    105115        Add(tahti); 
    106116    } 
     
    155165 
    156166        lentokone.Position = paikka; 
    157         lentokone.IgnoresGravity = true; 
     167        lentokone.IgnoresGravity = false; 
    158168        Add(lentokone);   
    159169    } 
     
    162172    { 
    163173         
    164         PhysicsObject s = PhysicsObject.CreateStaticObject(Shrek); 
    165         s.Mass = 0; 
    166         s.Position = paikka + new Vector(0, s.Height / 43 / 2); 
    167         s.Width /= 20; 
    168         s.Height /= 20; 
     174        PhysicsObject s = PhysicsObject.CreateStaticObject(60,80); 
     175        s.Image = Shrek; 
     176        s.Position = paikka; 
     177        s.Bottom = paikka.Y - korkeus / 2; 
    169178        s.Tag = "Shrek"; 
    170  
    171  
    172179 
    173180        Add(s); 
     
    184191        Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 
    185192        Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
     193        Keyboard.Listen(Key.R, ButtonState.Pressed, AloitaAlusta, "Aloita alusta"); 
    186194 
    187195        ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 
     
    190198        ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 
    191199        ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
     200         
    192201 
    193202        /*Keyboard.Listen(Key.Right, ButtonState.Down, pelaaja1.Animation.Start, ""); 
     
    201210        base.Update(time); 
    202211 
    203         if (pelaaja1.Velocity.X == 0) 
     212        if (!alkanut) 
     213        { 
     214            return; 
     215        } 
     216 
     217        if (pelaaja1.Velocity.X == 0)     
    204218        { 
    205219            pelaaja1.Animation.Stop(); 
     
    234248    void TormaaTahteen(PhysicsObject hahmo, PhysicsObject tahti) 
    235249    { 
    236           //§§maaliAani.Play(); 
     250        maaliAani.Play(); 
    237251        Supervoima(); 
    238         MessageDisplay.Add("Keräsit superlehden xd!"); 
     252        MessageDisplay.Add("Keräsit superlehden xd! Voit nyt tappaa Pepejä xd"); 
    239253        tahti.Destroy(); 
    240254    } 
     
    259273            rajahdusSysteemi.AddEffect(a.Position, 50); 
    260274            a.Destroy(); 
     275 
     276            MediaPlayer.Play("loppumusa"); 
     277            MediaPlayer.Volume = 2; 
    261278        } 
    262279    } 
     
    270287        rajahdusSysteemi.AddEffect(a.Position, 50); 
    271288        a.Destroy(); 
     289 
     290        MediaPlayer.Play("loppumusa"); 
    272291    } 
    273292 
     
    280299        rajahdusSysteemi.AddEffect(a.Position, 50); 
    281300        a.Destroy(); 
     301 
     302        MediaPlayer.Play("loppumusa"); 
    282303    } 
    283304 
     
    291312    { 
    292313        MessageDisplay.Add("Supervoima loppui xdddd"); 
     314        voimaLoppuu.Play(); 
    293315        SuperVoima = false; 
    294316    }     
    295      
     317 
     318    void Valikko() 
     319    { 
     320        MultiSelectWindow alkuValikko = new MultiSelectWindow("pelin alkuvalikko", "Aloita peli", "Lopeta :D"); 
     321        alkuValikko.AddItemHandler(0, LuoKentta); 
     322        alkuValikko.AddItemHandler(1, Exit); 
     323        Add(alkuValikko); 
     324        Mouse.IsCursorVisible = true; 
     325    } 
     326    void AloitaAlusta() 
     327    { 
     328        ClearAll(); 
     329        Valikko(); 
     330    } 
     331 
    296332} 
  • 2016/30/KasimirP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1.csproj.Debug.cachefile

    r8212 r8243  
    1818Content\illuminati.xnb 
    1919Content\yee.xnb 
     20Content\musa.xnb 
     21Content\Powerup5.xnb 
     22Content\Powerup8.xnb 
     23Content\loppumusa.xnb 
    2024Content\illuminati.wma 
     25Content\musa.wma 
     26Content\loppumusa.wma 
  • 2016/30/KasimirP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r8212 r8243  
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2016-07-28T14:53:05.2303945+03:00</Time> 
     38      <Time>2016-07-29T10:42:26.4507707+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    173173      <Output>C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\yee.xnb</Output> 
    174174      <Time>2016-07-28T13:36:50.8149752+03:00</Time> 
     175    </Item> 
     176    <Item> 
     177      <Source>musa.mp3</Source> 
     178      <Name>musa</Name> 
     179      <Importer>Mp3Importer</Importer> 
     180      <Processor>SongProcessor</Processor> 
     181      <Options>None</Options> 
     182      <Output>C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\musa.xnb</Output> 
     183      <Extra>C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\musa.wma</Extra> 
     184      <Time>2016-07-29T09:49:46.3498707+03:00</Time> 
     185    </Item> 
     186    <Item> 
     187      <Source>Powerup5.wav</Source> 
     188      <Name>Powerup5</Name> 
     189      <Importer>WavImporter</Importer> 
     190      <Processor>SoundEffectProcessor</Processor> 
     191      <Options>None</Options> 
     192      <Output>C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Powerup5.xnb</Output> 
     193      <Time>2016-07-29T10:07:46.0457707+03:00</Time> 
     194    </Item> 
     195    <Item> 
     196      <Source>Powerup8.wav</Source> 
     197      <Name>Powerup8</Name> 
     198      <Importer>WavImporter</Importer> 
     199      <Processor>SoundEffectProcessor</Processor> 
     200      <Options>None</Options> 
     201      <Output>C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Powerup8.xnb</Output> 
     202      <Time>2016-07-29T10:11:34.7463707+03:00</Time> 
     203    </Item> 
     204    <Item> 
     205      <Source>loppumusa.mp3</Source> 
     206      <Name>loppumusa</Name> 
     207      <Importer>Mp3Importer</Importer> 
     208      <Processor>SongProcessor</Processor> 
     209      <Options>None</Options> 
     210      <Output>C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\loppumusa.xnb</Output> 
     211      <Extra>C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\loppumusa.wma</Extra> 
     212      <Time>2016-07-29T10:28:04.3465707+03:00</Time> 
    175213    </Item> 
    176214    <BuildSuccessful>true</BuildSuccessful> 
  • 2016/30/KasimirP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/Tasohyppelypeli1.csproj.FileListAbsolute.txt

    r8212 r8243  
    2727C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\illuminati.wma 
    2828C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\yee.xnb 
     29C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\musa.xnb 
     30C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\musa.wma 
     31C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Powerup5.xnb 
     32C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Powerup8.xnb 
     33C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\loppumusa.xnb 
     34C:\MyTemp\KasimirP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\loppumusa.wma 
  • 2016/30/KasimirP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r8212 r8243  
    1919Content\illuminati.wma 
    2020Content\yee.xnb 
     21Content\musa.xnb 
     22Content\musa.wma 
     23Content\Powerup5.xnb 
     24Content\Powerup8.xnb 
     25Content\loppumusa.xnb 
     26Content\loppumusa.wma 
  • 2016/30/KasimirP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/Tasohyppelypeli1Content.contentproj

    r8212 r8243  
    164164    </Compile> 
    165165  </ItemGroup> 
     166  <ItemGroup> 
     167    <Compile Include="musa.mp3"> 
     168      <Name>musa</Name> 
     169      <Importer>Mp3Importer</Importer> 
     170      <Processor>SongProcessor</Processor> 
     171    </Compile> 
     172  </ItemGroup> 
     173  <ItemGroup> 
     174    <Compile Include="Powerup5.wav"> 
     175      <Name>Powerup5</Name> 
     176      <Importer>WavImporter</Importer> 
     177      <Processor>SoundEffectProcessor</Processor> 
     178    </Compile> 
     179  </ItemGroup> 
     180  <ItemGroup> 
     181    <Compile Include="Powerup8.wav"> 
     182      <Name>Powerup8</Name> 
     183      <Importer>WavImporter</Importer> 
     184      <Processor>SoundEffectProcessor</Processor> 
     185    </Compile> 
     186  </ItemGroup> 
     187  <ItemGroup> 
     188    <Compile Include="loppumusa.mp3"> 
     189      <Name>loppumusa</Name> 
     190      <Importer>Mp3Importer</Importer> 
     191      <Processor>SongProcessor</Processor> 
     192    </Compile> 
     193  </ItemGroup> 
    166194  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    167195  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2016/30/KasimirP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/kentta1.txt

    r8212 r8243  
    11 
    2  
    3 ............................#######.......................X....X...X......X...X.........X*................. 
     2..............................................................................................X............ 
     3............................#######.......X...............X....X...X......X...X.........X*...###........... 
    44.......................X.................###....X.......########################........###................ 
    5 .N..................######.....................########..........................X......................... 
    6 .................................*.............................................#####....................... 
     5.N..................######.....................########..........................X...#........KKK.......... 
     6.................................*.......K.....................................#####..........###.......... 
    77##################.............#####...####................................................................ 
    88##################LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL 
Note: See TracChangeset for help on using the changeset viewer.