Changeset 4953
- Timestamp:
- 2014-06-11 14:55:15 (9 years ago)
- Location:
- 2014/24/SanniS/Tasohyppelypeli2idk_new
- Files:
-
- 16 added
- 3 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/24/SanniS/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new.sln
r4940 r4953 2 2 Microsoft Visual Studio Solution File, Format Version 11.00 3 3 # Visual Studio 2010 4 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = " Tasohyppelypeli2idk_new", "Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new.csproj", "{5BD77BA0-897F-4BD2-9B85-07D31A1C5E1B}"4 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "needkaffeine", "Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\needkaffeine.csproj", "{5BD77BA0-897F-4BD2-9B85-07D31A1C5E1B}" 5 5 EndProject 6 Project("{ 96E2B04D-8817-42C6-938A-82C39BA4D311}") = "tasohyppely", "Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_newContent\tasohyppely.contentproj", "{E3F42B96-D200-4A60-B141-89E671674F57}"6 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tasohyppely", "Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_newContent\tasohyppely.contentproj", "{E3F42B96-D200-4A60-B141-89E671674F57}" 7 7 EndProject 8 8 Global -
2014/24/SanniS/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new.cs
r4940 r4953 11 11 const double nopeus = 200; 12 12 const double hyppyNopeus = 750; 13 const int RUUDUN_KOKO = 40; 13 14 15 const int RUUDUN_KOKO = 70; 14 16 15 17 PlatformCharacter pelaaja1; 18 19 16 20 17 21 Image pelaajanKuva = LoadImage("kehveli"); 18 22 Image tahtiKuva = LoadImage("kuppi"); 19 23 Image taustaKuva = LoadImage("tausta"); 20 21 SoundEffect maaliAani = LoadSoundEffect("maali");22 24 25 26 23 27 public override void Begin() 24 28 { 25 Gravity = new Vector(0, -1000);26 29 30 31 27 32 LuoKentta(); 28 33 LisaaNappaimet(); 29 30 Camera.Follow(pelaaja1); 31 Camera.ZoomFactor = 1.2; 32 Camera.StayInLevel = true; 34 33 35 } 34 36 35 37 void LuoKentta() 36 38 { 37 TileMap kentta = TileMap.FromLevelAsset("kentta1"); 38 kentta.SetTileMethod('#', LisaaTaso); 39 kentta.SetTileMethod('*', LisaaTahti); 40 kentta.SetTileMethod('N', LisaaPelaaja); 41 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 42 39 ColorTileMap ruudut = ColorTileMap.FromLevelAsset("kentta22"); 40 ruudut.SetTileMethod(Color.Rose, LisaaPelaaja); 41 ruudut.SetTileMethod(Color.Red, LisaaTahti); 42 ruudut.SetTileMethod(Color.Black, LisaaTaso); 43 44 ruudut.Execute(20, 20); 45 46 Gravity = new Vector (0.0, -800.0); 47 43 48 Level.Background.Image = taustaKuva; 44 49 Camera.ZoomToLevel(); 50 Level.Background.FitToLevel(); 51 Level.Background.ScaleToLevelByWidth(); 52 45 53 } 46 54 … … 61 69 tahti.Tag = "kuppi"; 62 70 Add(tahti); 71 63 72 } 64 73 65 74 void LisaaPelaaja(Vector paikka, double leveys, double korkeus) 66 75 { 67 76 pelaaja1 = new PlatformCharacter(leveys, korkeus); 68 77 pelaaja1.Position = paikka; 69 pelaaja1.Mass = 15.0; 78 79 70 80 pelaaja1.Image = pelaajanKuva; 71 81 AddCollisionHandler(pelaaja1, "kuppi", TormaaTahteen); … … 77 87 Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 78 88 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 89 79 90 80 91 Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 81 92 Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 82 Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 83 93 Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 84 94 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 85 95 86 96 ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); 87 97 ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 88 ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 89 98 ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 90 99 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 91 100 } … … 94 103 { 95 104 hahmo.Walk(nopeus); 96 }97 105 98 void Hyppaa(PlatformCharacter hahmo, double nopeus) 106 } 107 void Hyppaa(PlatformCharacter hahmo, double nopeus) 99 108 { 100 109 hahmo.Jump(nopeus); 110 111 112 101 113 } 102 114 103 115 void TormaaTahteen(PhysicsObject hahmo, PhysicsObject tahti) 104 116 { 105 maaliAani.Play(); 106 MessageDisplay.Add("Keräsit tähden!"); 117 118 MessageDisplay.Add("KAHVIAArrgghh"); 119 MessageDisplay.TextColor = Color.Cyan; 107 120 tahti.Destroy(); 121 122 123 108 124 } 125 126 109 127 } -
2014/24/SanniS/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/obj/x86/Debug/ContentPipeline-{E3F42B96-D200-4A60-B141-89E671674F57}.xml
r4940 r4953 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2014-06-1 0T14:55:52.3181993+03:00</Time>38 <Time>2014-06-11T13:17:02.0059604+03:00</Time> 39 39 </Item> 40 40 <Item> … … 45 45 <Options>None</Options> 46 46 <Output>C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\kehveli.xnb</Output> 47 <Time>2014-06-1 0T13:53:54.7244489+03:00</Time>47 <Time>2014-06-11T14:44:12.7238971+03:00</Time> 48 48 </Item> 49 49 <Item> … … 57 57 </Item> 58 58 <Item> 59 <Source>kentta2.png</Source>60 <Name>kentta2</Name>61 <Importer>TextureImporter</Importer>62 <Processor>TextureProcessor</Processor>63 <Options>None</Options>64 <Output>C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\kentta2.xnb</Output>65 <Time>2014-06-10T14:20:06.5257302+03:00</Time>66 </Item>67 <Item>68 59 <Source>kuppi.png</Source> 69 60 <Name>kuppi</Name> … … 73 64 <Output>C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\kuppi.xnb</Output> 74 65 <Time>2014-06-10T14:51:40.7260426+03:00</Time> 66 </Item> 67 <Item> 68 <Source>katti.png</Source> 69 <Name>katti</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\katti.xnb</Output> 74 <Time>2014-06-11T11:48:49.2937139+03:00</Time> 75 </Item> 76 <Item> 77 <Source>kentta22.png</Source> 78 <Name>kentta22</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 <Options>None</Options> 82 <Output>C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\kentta22.xnb</Output> 83 <Time>2014-06-11T14:18:59.0953235+03:00</Time> 84 </Item> 85 <Item> 86 <Source>ukko.png</Source> 87 <Name>ukko</Name> 88 <Importer>TextureImporter</Importer> 89 <Processor>TextureProcessor</Processor> 90 <Options>None</Options> 91 <Output>C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\ukko.xnb</Output> 92 <Time>2014-06-11T14:22:50.2853235+03:00</Time> 93 </Item> 94 <Item> 95 <Source>orkki.png</Source> 96 <Name>orkki</Name> 97 <Importer>TextureImporter</Importer> 98 <Processor>TextureProcessor</Processor> 99 <Options>None</Options> 100 <Output>C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\orkki.xnb</Output> 101 <Time>2014-06-11T14:42:21.6350971+03:00</Time> 75 102 </Item> 76 103 <BuildSuccessful>true</BuildSuccessful> -
2014/24/SanniS/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/obj/x86/Debug/Tasohyppelypeli2idk_new.csproj.FileListAbsolute.txt
r4940 r4953 14 14 C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\kentta2.xnb 15 15 C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\bin\x86\Debug\Content\kuppi.xnb 16 C:\MyTemp\SanniS\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\Tasohyppelypeli2idk_new\obj\x86\Debug\Tasohyppelypeli2idk_new.csprojResolveAssemblyReference.cache -
2014/24/SanniS/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/obj/x86/Debug/cachefile-{E3F42B96-D200-4A60-B141-89E671674F57}-targetpath.txt
r4940 r4953 5 5 Content\kehveli.xnb 6 6 Content\tausta.xnb 7 Content\kentta2.xnb8 7 Content\kuppi.xnb 8 Content\katti.xnb 9 Content\kentta22.xnb 10 Content\ukko.xnb 11 Content\orkki.xnb -
2014/24/SanniS/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_newContent/kentta1.txt
r4940 r4953 1 2 * 3 # * 4 # * # #### 5 ######## ## 6 #### 7 ### 8 * N #### * 9 ## #### ##### 10 # ####### 11 ## 12 ########## * ###### * ######## ## 13 ###################### ## * ## 14 ###### 1 2 3 4 * 5 N ####### 6 ##### ###### ##### 7 ##### 8 * 9 * ########### #### 10 ##### ###### ## ######### 11 ######## # ###### * #### 12 * ########## ########## ## ## ####### 13 ###### ############# R ######### # ### ## #### 14 ############## # ############# ## * ##### 15 # * ######## ############## 16 ####### -
2014/24/SanniS/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_new/Tasohyppelypeli2idk_newContent/tasohyppely.contentproj
r4940 r4953 82 82 </ItemGroup> 83 83 <ItemGroup> 84 <Compile Include="k entta2.png">85 <Name>k entta2</Name>84 <Compile Include="kuppi.png"> 85 <Name>kuppi</Name> 86 86 <Importer>TextureImporter</Importer> 87 87 <Processor>TextureProcessor</Processor> … … 89 89 </ItemGroup> 90 90 <ItemGroup> 91 <Compile Include="kuppi.png"> 92 <Name>kuppi</Name> 91 <Compile Include="katti.png"> 92 <Name>katti</Name> 93 <Importer>TextureImporter</Importer> 94 <Processor>TextureProcessor</Processor> 95 </Compile> 96 </ItemGroup> 97 <ItemGroup> 98 <Compile Include="kentta22.png"> 99 <Name>kentta22</Name> 100 <Importer>TextureImporter</Importer> 101 <Processor>TextureProcessor</Processor> 102 </Compile> 103 </ItemGroup> 104 <ItemGroup> 105 <Compile Include="ukko.png"> 106 <Name>ukko</Name> 107 <Importer>TextureImporter</Importer> 108 <Processor>TextureProcessor</Processor> 109 </Compile> 110 </ItemGroup> 111 <ItemGroup> 112 <Compile Include="orkki.png"> 113 <Name>orkki</Name> 93 114 <Importer>TextureImporter</Importer> 94 115 <Processor>TextureProcessor</Processor>
Note: See TracChangeset
for help on using the changeset viewer.