Changeset 2991
- Timestamp:
- 2012-06-13 14:52:56 (11 years ago)
- Location:
- 2012/24/VilmaK/Tasohyppelypeli1
- Files:
-
- 16 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1.cs
r2973 r2991 14 14 double ruudunKorkeus; 15 15 int ruudunKoko = 40; 16 int kaikkiTimantit = 0; 16 17 17 18 PlatformCharacter pelaaja1; … … 21 22 22 23 SoundEffect maaliAani = LoadSoundEffect("maali"); 24 25 IntMeter timanttiLaskuri; 23 26 24 27 public override void Begin() … … 30 33 lisaaNappaimet(); 31 34 Image taustaKuva = LoadImage("rantatausta"); 32 33 34 35 Level.Background.Image = taustaKuva; 35 36 Level.Background.FitToLevel(); 36 37 38 39 37 Camera.ZoomToLevel(); 40 38 // Camera.ZoomToAllObjects(); 41 Camera.StayInLevel = true;39 //Camera.StayInLevel = true; 42 40 //Camera.Follow(pelaaja1); 43 41 } … … 45 43 void luoKentta() 46 44 { 45 timanttiLaskuri = new IntMeter(0, 0, int.MaxValue); 46 timanttiLaskuri.LowerLimit += delegate { MessageDisplay.Add("Kaikki timantit kerätty"); }; 47 47 TileMap kentta = TileMap.FromLevelAsset("kentta1"); 48 48 kentta.SetTileMethod('b', lisaaTaso); 49 49 kentta.SetTileMethod('*', lisaaTimantti); 50 50 kentta.SetTileMethod('P', lisaaPelaaja); 51 kentta.SetTileMethod('m', lisaaMaa); 51 kentta.SetTileMethod('m', lisaaHiekka); 52 kentta.SetTileMethod('g', lisaaMaa); 53 kentta.SetTileMethod('l', lisaaLiaani); 54 kentta.SetTileMethod('t', lisaaLaava); 55 kentta.SetTileMethod('v', lisaaVesi); 56 //kentta.SetTileMethod('j', lisaaJaa); 57 // kentta.SetTileMethod('J', lisaaJaaPuikko); 58 52 59 ruudunLeveys = Screen.Width / kentta.GetLength(1); 53 60 ruudunKorkeus = Screen.Height / kentta.GetLength(0); 54 61 kentta.Execute(ruudunLeveys, ruudunKorkeus); 62 timanttiLaskuri.Value = kaikkiTimantit; 55 63 Level.CreateBorders(); 56 64 // Level.Background.CreateGradient(Color.White, Color.SkyBlue); 57 65 Level.BackgroundColor = Color.Yellow; 58 } 66 67 LuoEpatasainenMaasto(); 68 } 69 70 void LuoEpatasainenMaasto() 71 { 72 73 CollisionShapeParameters csp = new CollisionShapeParameters(); 74 csp.DistanceGridSpacing = 10; 75 csp.MaxVertexDistance = 10; 76 77 Surface ylareuna = new Surface(Level.Width, 78 Level.Height / 200, // ylin kohta yläreunassa 79 Level.Height / 8, // alin kohta 80 RandomGen.NextInt(50, 100), // kuinka monta piikkiä 81 csp); 82 ylareuna.Angle = Angle.FromDegrees(180); 83 ylareuna.Left = Level.Left; 84 ylareuna.Top = Level.Top; 85 ylareuna.TextureFillsShape = true; 86 ylareuna.Color = Color.LightBlue; 87 // Toivottavasti saadaan allaoleva toimimaan kurssin aikana 88 // ylareuna.Image = Image.FromGradient((int)ylareuna.Width, (int)ylareuna.Height, Color.White, Color.Black); 89 Add(ylareuna); 90 } 91 92 //void lisaaJaaPuikko(Vector paikka, double leveys, double korkeus) 93 //{ 94 // PhysicsObject puikko = PhysicsObject.CreateStaticObject(leveys, korkeus); 95 // puikko.Position = paikka; 96 // puikko.Image = LoadImage("jaa"); 97 // Add(puikko); 98 // } 99 //void lisaaJaa(Vector paikka, double leveys, double korkeus) 100 //{ 101 // PhysicsObject jaa = PhysicsObject.CreateStaticObject(leveys, korkeus); 102 // jaa.Position = paikka; 103 // jaa.Color = new Color(40, 165, 255); 104 // Add(jaa); 105 // } 106 107 //void lisaaJaa(Vector paikka, double leveys, double korkeus) 108 //{ 109 // PhysicsObject jaa = PhysicsObject.CreateStaticObject(leveys, korkeus); 110 // jaa.Position = paikka; 111 // jaa.Image = LoadImage("jaa"); 112 // Add(jaa); 113 //} 114 115 void lisaaVesi(Vector paikka, double leveys, double korkeus) 116 { 117 PhysicsObject vesi = PhysicsObject.CreateStaticObject(leveys, korkeus); 118 vesi.Position = paikka; 119 vesi.Image = LoadImage("vesi"); 120 Add(vesi); 121 } 122 123 void lisaaLaava(Vector paikka, double leveys, double korkeus) 124 { 125 PhysicsObject laava = PhysicsObject.CreateStaticObject(leveys, korkeus); 126 laava.Position = paikka; 127 laava.Image = LoadImage("laava"); 128 Add(laava); 129 } 130 131 void lisaaLiaani(Vector paikka, double leveys, double korkeus) 132 { 133 PhysicsObject liaani = PhysicsObject.CreateStaticObject(leveys, korkeus); 134 liaani.Position = paikka; 135 liaani.Image = LoadImage("liaani"); 136 Add(liaani); 137 } 138 59 139 60 140 void lisaaMaa(Vector paikka, double leveys, double korkeus) … … 62 142 PhysicsObject maa = PhysicsObject.CreateStaticObject(leveys, korkeus); 63 143 maa.Position = paikka; 144 maa.Image = LoadImage("viidakko"); 145 Add(maa); 146 } 147 148 void lisaaHiekka(Vector paikka, double leveys, double korkeus) 149 { 150 PhysicsObject hiekka = PhysicsObject.CreateStaticObject(leveys, korkeus); 151 hiekka.Position = paikka; 64 152 // maa.Color = Color.Brown; 65 maa.Image = LoadImage("hiekka");66 Add( maa);153 hiekka.Image = LoadImage("hiekka"); 154 Add(hiekka); 67 155 } 68 156 … … 84 172 timantti.Color = Color.Orange; 85 173 //timantti.Image = tahtiKuva; 86 timantti.Tag = "timantti"; 174 timantti.Tag = "timantti"; 175 timanttiLaskuri.Value++; 87 176 Add(timantti); 177 kaikkiTimantit++; 88 178 } 89 179 … … 131 221 if (kohde.Tag.ToString() == "timantti") 132 222 { 133 maaliAani.Play();134 223 //maaliAani.Play(); 224 135 225 //MessageDisplay.Add("Keräsit timantin!"); 226 timanttiLaskuri.AddValue(-1); 136 227 kohde.Destroy(); 137 228 } -
2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1.csproj.Debug.cachefile
r2973 r2991 9 9 Content\hiekka.xnb 10 10 Content\rantatausta.xnb 11 Content\viidakko.xnb 12 Content\liaani.xnb 13 Content\laava.xnb 14 Content\vesi.xnb 15 Content\jaa.xnb 16 Content\jaatikko.xnb 17 Content\tulivuori.xnb 18 Content\viidakkotausta.xnb -
2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/Tasohyppelypeli1.csproj.FileListAbsolute.txt
r2973 r2991 29 29 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Jypeli.dll 30 30 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Jypeli.xml 31 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\viidakko.xnb 32 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\liaani.xnb 33 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\laava.xnb 34 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\vesi.xnb 35 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\jaa.xnb 36 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\jaatikko.xnb 37 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\tulivuori.xnb 38 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\viidakkotausta.xnb -
2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/cachefile-{3D11F9FF-84D7-4FD4-9CD5-2D7DDC927B82}-targetpath.txt
r2973 r2991 9 9 Content\hiekka.xnb 10 10 Content\rantatausta.xnb 11 Content\viidakko.xnb 12 Content\liaani.xnb 13 Content\laava.xnb 14 Content\vesi.xnb 15 Content\jaa.xnb 16 Content\jaatikko.xnb 17 Content\tulivuori.xnb 18 Content\viidakkotausta.xnb -
2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/Tasohyppelypeli1Content.contentproj
r2973 r2991 114 114 </Compile> 115 115 </ItemGroup> 116 <ItemGroup> 117 <Compile Include="viidakko.png"> 118 <Name>viidakko</Name> 119 <Importer>TextureImporter</Importer> 120 <Processor>TextureProcessor</Processor> 121 </Compile> 122 </ItemGroup> 123 <ItemGroup> 124 <Compile Include="liaani.png"> 125 <Name>liaani</Name> 126 <Importer>TextureImporter</Importer> 127 <Processor>TextureProcessor</Processor> 128 </Compile> 129 </ItemGroup> 130 <ItemGroup> 131 <Compile Include="laava.png"> 132 <Name>laava</Name> 133 <Importer>TextureImporter</Importer> 134 <Processor>TextureProcessor</Processor> 135 </Compile> 136 </ItemGroup> 137 <ItemGroup> 138 <Compile Include="vesi.png"> 139 <Name>vesi</Name> 140 <Importer>TextureImporter</Importer> 141 <Processor>TextureProcessor</Processor> 142 </Compile> 143 </ItemGroup> 144 <ItemGroup> 145 <Compile Include="jaa.png"> 146 <Name>jaa</Name> 147 <Importer>TextureImporter</Importer> 148 <Processor>TextureProcessor</Processor> 149 </Compile> 150 </ItemGroup> 151 <ItemGroup> 152 <Compile Include="jaatikko.png"> 153 <Name>jaatikko</Name> 154 <Importer>TextureImporter</Importer> 155 <Processor>TextureProcessor</Processor> 156 </Compile> 157 </ItemGroup> 158 <ItemGroup> 159 <Compile Include="tulivuori.png"> 160 <Name>tulivuori</Name> 161 <Importer>TextureImporter</Importer> 162 <Processor>TextureProcessor</Processor> 163 </Compile> 164 </ItemGroup> 165 <ItemGroup> 166 <Compile Include="viidakkotausta.png"> 167 <Name>viidakkotausta</Name> 168 <Importer>TextureImporter</Importer> 169 <Processor>TextureProcessor</Processor> 170 </Compile> 171 </ItemGroup> 116 172 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 117 173 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/kentta3.txt
r2947 r2991 16 16 xt bbbb bbbb tx 17 17 xt tx 18 xtttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttx 19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 18 ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt -
2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/kentta4.txt
r2947 r2991 1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2 xjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjx 3 xj jj j jj jj jj jjj jjjjj jj jjjjj jjx 4 x jj jj jj jjj j j j j x5 x j jj jj j x1 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj 2 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj 3 jj jj j jj jj jj jjj jjjjj jj jjjjj jjj 4 x jj J j jj jjj j j j j x 5 x J J j jj j x 6 6 x j x 7 7 x bbb bbbb x … … 16 16 x bbbbb bbbbb bbbb x 17 17 x x 18 xvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvx 19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 18 vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 19 vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -
2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/obj/x86/Debug/ContentPipeline.xml
r2973 r2991 27 27 <Options>None</Options> 28 28 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Pingviini.xnb</Output> 29 <Time>2012-06-13T 09:46:04.9593471+03:00</Time>29 <Time>2012-06-13T13:34:48.622865+03:00</Time> 30 30 </Item> 31 31 <Item> … … 45 45 <Options>None</Options> 46 46 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta2.xnb</Output> 47 <Time>2012-06-13T 09:38:06.8195471+03:00</Time>47 <Time>2012-06-13T10:38:37.0880101+03:00</Time> 48 48 </Item> 49 49 <Item> … … 54 54 <Options>None</Options> 55 55 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta3.xnb</Output> 56 <Time>2012-06-13T 09:38:06.8195471+03:00</Time>56 <Time>2012-06-13T11:57:44.6272101+03:00</Time> 57 57 </Item> 58 58 <Item> … … 63 63 <Options>None</Options> 64 64 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta4.xnb</Output> 65 <Time>2012-06-13T 09:38:06.8975471+03:00</Time>65 <Time>2012-06-13T12:14:14.4592581+03:00</Time> 66 66 </Item> 67 67 <Item> … … 91 91 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\rantatausta.xnb</Output> 92 92 <Time>2012-06-13T10:01:45.3823383+03:00</Time> 93 </Item> 94 <Item> 95 <Source>viidakko.png</Source> 96 <Name>viidakko</Name> 97 <Importer>TextureImporter</Importer> 98 <Processor>TextureProcessor</Processor> 99 <Options>None</Options> 100 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\viidakko.xnb</Output> 101 <Time>2012-06-13T11:34:19.3578101+03:00</Time> 102 </Item> 103 <Item> 104 <Source>liaani.png</Source> 105 <Name>liaani</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 <Options>None</Options> 109 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\liaani.xnb</Output> 110 <Time>2012-06-13T11:43:47.4038101+03:00</Time> 111 </Item> 112 <Item> 113 <Source>laava.png</Source> 114 <Name>laava</Name> 115 <Importer>TextureImporter</Importer> 116 <Processor>TextureProcessor</Processor> 117 <Options>None</Options> 118 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\laava.xnb</Output> 119 <Time>2012-06-13T11:56:39.5902101+03:00</Time> 120 </Item> 121 <Item> 122 <Source>vesi.png</Source> 123 <Name>vesi</Name> 124 <Importer>TextureImporter</Importer> 125 <Processor>TextureProcessor</Processor> 126 <Options>None</Options> 127 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\vesi.xnb</Output> 128 <Time>2012-06-13T12:03:52.5130101+03:00</Time> 129 </Item> 130 <Item> 131 <Source>jaa.png</Source> 132 <Name>jaa</Name> 133 <Importer>TextureImporter</Importer> 134 <Processor>TextureProcessor</Processor> 135 <Options>None</Options> 136 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\jaa.xnb</Output> 137 <Time>2012-06-13T12:13:17.3952457+03:00</Time> 138 </Item> 139 <Item> 140 <Source>jaatikko.png</Source> 141 <Name>jaatikko</Name> 142 <Importer>TextureImporter</Importer> 143 <Processor>TextureProcessor</Processor> 144 <Options>None</Options> 145 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\jaatikko.xnb</Output> 146 <Time>2012-06-13T14:42:11.6504652+03:00</Time> 147 </Item> 148 <Item> 149 <Source>tulivuori.png</Source> 150 <Name>tulivuori</Name> 151 <Importer>TextureImporter</Importer> 152 <Processor>TextureProcessor</Processor> 153 <Options>None</Options> 154 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\tulivuori.xnb</Output> 155 <Time>2012-06-13T14:19:55.779665+03:00</Time> 156 </Item> 157 <Item> 158 <Source>viidakkotausta.png</Source> 159 <Name>viidakkotausta</Name> 160 <Importer>TextureImporter</Importer> 161 <Processor>TextureProcessor</Processor> 162 <Options>None</Options> 163 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\viidakkotausta.xnb</Output> 164 <Time>2012-06-13T14:15:18.910865+03:00</Time> 93 165 </Item> 94 166 <BuildSuccessful>true</BuildSuccessful>
Note: See TracChangeset
for help on using the changeset viewer.