- Timestamp:
- 2014-07-01 14:55:25 (9 years ago)
- Location:
- 2014/27/WilleK/Project_000
- Files:
-
- 17 added
- 2 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/27/WilleK/Project_000/Project_000/Project_000/Project_000.cs
r5186 r5239 16 16 17 17 Image pelaajanKuva = LoadImage("Pelaaja1"); 18 Image tahtiKuva = LoadImage("tahti"); 18 Image pelaajanKuvaHyppy = LoadImage("Pelaaja1-3"); 19 private Image[] PelaajanKavely = LoadImages("Pelaaja1-1", "Pelaaja1-2"); 20 private Image[] PelaajaPaikallaan = LoadImages("Pelaaja1"); 21 22 Image KolikkoKuva = LoadImage("Kolikko1"); 19 23 Image ruohoKuva = LoadImage("Ruoho"); 20 Image ruohoKuva = LoadImage("Alkuvalikko"); 24 Image alkuvalikkoKuva = LoadImage("Alkuvalikko"); 25 Image pilviKuva = LoadImage("Pilvi"); 26 Image klönttiKuva = LoadImage("Klöntti"); 27 Image tausta1 = LoadImage("Tausta1"); 28 int kenttänumero = 1; 21 29 22 30 SoundEffect maaliAani = LoadSoundEffect("maali"); … … 26 34 SmoothTextures = false; 27 35 IsMouseVisible = true; 28 IsFullScreen = true;29 36 alkuvalikko(); 30 37 } … … 37 44 LuoKentta(); 38 45 LisaaNappaimet(); 46 LuoPistelaskuri(); 47 LuoKlönttiPistelaskuri(); 39 48 40 49 Camera.Follow(pelaaja1); … … 43 52 } 44 53 54 void Seuraavakenttä() 55 { 56 kenttänumero++; 57 AloitaPeli(); 58 } 59 60 void KenttäValikko() 61 { 62 MultiSelectWindow KenttäValikko = new MultiSelectWindow("Level Select", "Level 1", "Level 2"); 63 Add(KenttäValikko); 64 65 KenttäValikko.Image = alkuvalikkoKuva; 66 67 KenttäValikko.AddItemHandler(0, AloitaPeli); 68 } 69 45 70 void alkuvalikko() 46 71 { 47 MultiSelectWindow alkuValikko = new MultiSelectWindow(" Pelin alkuvalikko","Start", "Options", "Quit");72 MultiSelectWindow alkuValikko = new MultiSelectWindow("Bluune","Start", "Options", "Quit"); 48 73 Add(alkuValikko); 49 74 50 alkuValikko.Image= 51 52 alkuValikko.AddItemHandler(0, AloitaPeli);75 alkuValikko.Image= alkuvalikkoKuva; 76 77 alkuValikko.AddItemHandler(0, KenttäValikko); 53 78 //alkuValikko.AddItemHandler(1, ParhaatPisteet); 54 79 alkuValikko.AddItemHandler(2, Exit); 55 80 } 56 81 82 IntMeter pisteLaskuri; 83 84 void LuoPistelaskuri() 85 { 86 pisteLaskuri = new IntMeter(0); 87 88 Label pisteNaytto = new Label(); 89 pisteNaytto.X = Screen.Left + 1150; 90 pisteNaytto.Y = Screen.Top - 100; 91 pisteNaytto.TextColor = Color.Black; 92 pisteNaytto.Title = "Coins"; 93 94 pisteNaytto.BindTo(pisteLaskuri); 95 Add(pisteNaytto); 96 } 97 98 IntMeter pisteLaskuri1; 99 100 void LuoKlönttiPistelaskuri() 101 { 102 pisteLaskuri1 = new IntMeter(0); 103 104 Label pisteNaytto = new Label(); 105 pisteNaytto.X = Screen.Left + 1000; 106 pisteNaytto.Y = Screen.Top - 100; 107 pisteNaytto.TextColor = Color.Black; 108 pisteNaytto.Title = "Slimes"; 109 110 pisteNaytto.BindTo(pisteLaskuri1); 111 Add(pisteNaytto); 112 } 113 57 114 void LuoKentta() 58 115 { 59 ColorTileMap ruudut = ColorTileMap.FromLevelAsset("Kenttä 1");116 ColorTileMap ruudut = ColorTileMap.FromLevelAsset("Kenttä"+kenttänumero); 60 117 ruudut.SetTileMethod(Color.Blue, LisaaPelaaja); 61 118 ruudut.SetTileMethod(Color.Black, LisaaTaso); 62 ruudut.SetTileMethod(Color.Yellow, LisaaTahti); 119 ruudut.SetTileMethod(Color.Yellow, LisaaKolikko); 120 ruudut.SetTileMethod(Color.FromHexCode("7F3300"), LisaaMulta); 121 ruudut.SetTileMethod(Color.White, LisaaPilvi); 122 ruudut.SetTileMethod(Color.FromHexCode("00FFFF"), LisaaKlöntti); 123 ruudut.SetTileMethod(Color.FromHexCode("B6FF00"), LisaaKuilu); 63 124 ruudut.Execute(20, 20); 64 125 65 126 Level.CreateBorders(); 127 Level.Background.Image = tausta1; 128 Level.Background.ScaleToLevelFull(); 129 } 130 131 void LisaaKuilu(Vector paikka, double leveys, double korkeus) 132 { 133 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus/5.0); 134 taso.Position = paikka+new Vector(0, -korkeus*(2/5.0)); 135 taso.IsVisible = false; 136 taso.Tag = "kuilu"; 137 Add(taso); 138 } 139 140 void PelaajaKuoli(PhysicsObject pelaaja1, PhysicsObject kuilu) 141 { 142 MultiSelectWindow Pelaajakuoli1 = new MultiSelectWindow("Game Over", "Restart", "Quit"); 143 Add(Pelaajakuoli1); 144 145 Pelaajakuoli1.AddItemHandler(0, AloitaPeli); 146 Pelaajakuoli1.AddItemHandler(1, alkuvalikko); 66 147 } 67 148 … … 74 155 } 75 156 76 void LisaaTahti(Vector paikka, double leveys, double korkeus) 77 { 78 PhysicsObject tahti = PhysicsObject.CreateStaticObject(leveys, korkeus); 79 tahti.IgnoresCollisionResponse = true; 80 tahti.Position = paikka; 81 tahti.Image = tahtiKuva; 82 tahti.Tag = "tahti"; 83 Add(tahti); 157 void LisaaPilvi(Vector paikka, double leveys, double korkeus) 158 { 159 PhysicsObject pilvi = PhysicsObject.CreateStaticObject(leveys*3, korkeus); 160 pilvi.Position = paikka; 161 pilvi.Image = pilviKuva; 162 Add(pilvi); 163 } 164 165 void LisaaMulta(Vector paikka, double leveys, double korkeus) 166 { 167 PhysicsObject multa = PhysicsObject.CreateStaticObject(leveys, korkeus); 168 multa.Position = paikka; 169 multa.Color = Color.FromHexCode("7F3300"); 170 Add(multa); 171 } 172 173 void LisaaKolikko(Vector paikka, double leveys, double korkeus) 174 { 175 PhysicsObject kolikko = PhysicsObject.CreateStaticObject(leveys, korkeus); 176 kolikko.IgnoresCollisionResponse = true; 177 kolikko.Position = paikka; 178 kolikko.Image = KolikkoKuva; 179 kolikko.Tag = "Coin"; 180 Add(kolikko); 181 } 182 183 void LisaaKlöntti(Vector paikka, double leveys, double korkeus) 184 { 185 PhysicsObject klöntti = PhysicsObject.CreateStaticObject(leveys, korkeus); 186 klöntti.IgnoresCollisionResponse = true; 187 klöntti.Position = paikka; 188 klöntti.Image = klönttiKuva; 189 klöntti.Tag = "Klöntti"; 190 Add(klöntti); 84 191 } 85 192 86 193 void LisaaPelaaja(Vector paikka, double leveys, double korkeus) 87 194 { 88 pelaaja1 = new PlatformCharacter( leveys, korkeus);195 pelaaja1 = new PlatformCharacter(15, 15); 89 196 pelaaja1.Position = paikka; 90 197 pelaaja1.Mass = 4.0; 91 198 pelaaja1.Image = pelaajanKuva; 92 AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 199 AddCollisionHandler(pelaaja1, "Coin", TormaaTahteen); 200 AddCollisionHandler(pelaaja1, "Klöntti", TormaaKlönttiin); 201 AddCollisionHandler(pelaaja1, "kuilu", PelaajaKuoli); 202 pelaaja1.AnimWalk = new Animation(PelaajanKavely); 203 pelaaja1.AnimWalk.FPS = 5; 204 pelaaja1.AnimIdle = new Animation(PelaajaPaikallaan); 93 205 Add(pelaaja1); 206 } 207 208 void lisaavihu(Vector paikka, double leveys, double korkeus) 209 { 210 94 211 } 95 212 … … 101 218 102 219 Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 103 Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus);220 Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu oikealle", pelaaja1, nopeus); 104 221 Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 105 222 … … 127 244 maaliAani.Play(); 128 245 tahti.Destroy(); 246 pisteLaskuri.Value++; 247 } 248 249 void TormaaKlönttiin(PhysicsObject hahmo, PhysicsObject klöntti) 250 { 251 maaliAani.Play(); 252 klöntti.Destroy(); 253 pisteLaskuri1.Value++; 254 255 if(pisteLaskuri1.Value==3) 256 { 257 Seuraavakenttä(); 258 } 129 259 } 130 260 } -
2014/27/WilleK/Project_000/Project_000/Project_000/Project_000.csproj.Debug.cachefile
r5186 r5239 1 1 Content\maali.xnb 2 Content\tahti.xnb3 2 Content\KenttÀ1.xnb 4 3 Content\Pelaaja1.xnb 5 4 Content\Ruoho.xnb 5 Content\Alkuvalikko.xnb 6 Content\Kolikko1.xnb 7 Content\Pilvi.xnb 8 Content\Kentta2.xnb 9 Content\Klöntti.xnb 10 Content\Tausta1.xnb 11 Content\Pelaaja1-1.xnb 12 Content\Pelaaja1-2.xnb 13 Content\Pelaaja1-3.xnb -
2014/27/WilleK/Project_000/Project_000/Project_000/obj/x86/Debug/Project_000.csproj.FileListAbsolute.txt
r5186 r5239 2 2 C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\obj\x86\Debug\Microsoft.Xna.Framework.RuntimeProfile.txt 3 3 C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\maali.xnb 4 C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\tahti.xnb5 4 C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\KenttÀ1.xnb 6 5 C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Project_000.exe … … 12 11 C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Pelaaja1.xnb 13 12 C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Ruoho.xnb 13 C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Alkuvalikko.xnb 14 C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Kolikko1.xnb 15 C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Pilvi.xnb 16 C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Kentta2.xnb 17 C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Klöntti.xnb 18 C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Tausta1.xnb 19 C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Pelaaja1-1.xnb 20 C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Pelaaja1-2.xnb 21 C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Pelaaja1-3.xnb -
2014/27/WilleK/Project_000/Project_000/Project_000/obj/x86/Debug/cachefile-{0B319EE5-EF35-48E7-AA16-C0EB252ED043}-targetpath.txt
r5186 r5239 1 1 Content\maali.xnb 2 Content\tahti.xnb3 2 Content\KenttÀ1.xnb 4 3 Content\Pelaaja1.xnb 5 4 Content\Ruoho.xnb 5 Content\Alkuvalikko.xnb 6 Content\Kolikko1.xnb 7 Content\Pilvi.xnb 8 Content\Kentta2.xnb 9 Content\Klöntti.xnb 10 Content\Tausta1.xnb 11 Content\Pelaaja1-1.xnb 12 Content\Pelaaja1-2.xnb 13 Content\Pelaaja1-3.xnb -
2014/27/WilleK/Project_000/Project_000/Project_000Content/Project_000Content.contentproj
r5186 r5239 51 51 <Processor>SoundEffectProcessor</Processor> 52 52 </Compile> 53 <Compile Include="tahti.png">54 <Name>tahti</Name>55 <Importer>TextureImporter</Importer>56 <Processor>TextureProcessor</Processor>57 </Compile>58 53 </ItemGroup> 59 54 <ItemGroup> … … 85 80 </Compile> 86 81 </ItemGroup> 82 <ItemGroup> 83 <Compile Include="Kolikko1.png"> 84 <Name>Kolikko1</Name> 85 <Importer>TextureImporter</Importer> 86 <Processor>TextureProcessor</Processor> 87 </Compile> 88 </ItemGroup> 89 <ItemGroup> 90 <Compile Include="Pilvi.png"> 91 <Name>Pilvi</Name> 92 <Importer>TextureImporter</Importer> 93 <Processor>TextureProcessor</Processor> 94 </Compile> 95 </ItemGroup> 96 <ItemGroup> 97 <Compile Include="Kentta2.png"> 98 <Name>Kentta2</Name> 99 <Importer>TextureImporter</Importer> 100 <Processor>TextureProcessor</Processor> 101 </Compile> 102 </ItemGroup> 103 <ItemGroup> 104 <Compile Include="Klöntti.png"> 105 <Name>Klöntti</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 </Compile> 109 </ItemGroup> 110 <ItemGroup> 111 <Compile Include="Tausta1.png"> 112 <Name>Tausta1</Name> 113 <Importer>TextureImporter</Importer> 114 <Processor>TextureProcessor</Processor> 115 </Compile> 116 </ItemGroup> 117 <ItemGroup> 118 <Compile Include="Pelaaja1-1.png"> 119 <Name>Pelaaja1-1</Name> 120 <Importer>TextureImporter</Importer> 121 <Processor>TextureProcessor</Processor> 122 </Compile> 123 </ItemGroup> 124 <ItemGroup> 125 <Compile Include="Pelaaja1-2.png"> 126 <Name>Pelaaja1-2</Name> 127 <Importer>TextureImporter</Importer> 128 <Processor>TextureProcessor</Processor> 129 </Compile> 130 </ItemGroup> 131 <ItemGroup> 132 <Compile Include="Pelaaja1-3.png"> 133 <Name>Pelaaja1-3</Name> 134 <Importer>TextureImporter</Importer> 135 <Processor>TextureProcessor</Processor> 136 </Compile> 137 </ItemGroup> 87 138 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 88 139 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2014/27/WilleK/Project_000/Project_000/Project_000Content/obj/x86/Debug/ContentPipeline.xml
r5186 r5239 12 12 </Item> 13 13 <Item> 14 <Source>tahti.png</Source>15 <Name>tahti</Name>16 <Importer>TextureImporter</Importer>17 <Processor>TextureProcessor</Processor>18 <Options>None</Options>19 <Output>C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\tahti.xnb</Output>20 <Time>2014-06-30T13:33:03.7213733+03:00</Time>21 </Item>22 <Item>23 14 <Source>Kenttä1.png</Source> 24 15 <Name>Kenttä1</Name> … … 27 18 <Options>None</Options> 28 19 <Output>C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Kenttä1.xnb</Output> 29 <Time>2014-0 6-30T13:56:27.59067+03:00</Time>20 <Time>2014-07-01T13:35:12.3137663+03:00</Time> 30 21 </Item> 31 22 <Item> … … 36 27 <Options>None</Options> 37 28 <Output>C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Pelaaja1.xnb</Output> 38 <Time>2014-0 6-30T14:09:28.2143192+03:00</Time>29 <Time>2014-07-01T14:26:09.7306406+03:00</Time> 39 30 </Item> 40 31 <Item> … … 46 37 <Output>C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Ruoho.xnb</Output> 47 38 <Time>2014-06-30T14:39:27.476231+03:00</Time> 39 </Item> 40 <Item> 41 <Source>Alkuvalikko.png</Source> 42 <Name>Alkuvalikko</Name> 43 <Importer>TextureImporter</Importer> 44 <Processor>TextureProcessor</Processor> 45 <Options>None</Options> 46 <Output>C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Alkuvalikko.xnb</Output> 47 <Time>2014-07-01T09:50:26.6494305+03:00</Time> 48 </Item> 49 <Item> 50 <Source>Kolikko1.png</Source> 51 <Name>Kolikko1</Name> 52 <Importer>TextureImporter</Importer> 53 <Processor>TextureProcessor</Processor> 54 <Options>None</Options> 55 <Output>C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Kolikko1.xnb</Output> 56 <Time>2014-06-30T18:44:59.3078547+03:00</Time> 57 </Item> 58 <Item> 59 <Source>Pilvi.png</Source> 60 <Name>Pilvi</Name> 61 <Importer>TextureImporter</Importer> 62 <Processor>TextureProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Pilvi.xnb</Output> 65 <Time>2014-07-01T10:25:02.3271524+03:00</Time> 66 </Item> 67 <Item> 68 <Source>Kentta2.png</Source> 69 <Name>Kentta2</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Kentta2.xnb</Output> 74 <Time>2014-07-01T10:37:50.7161018+03:00</Time> 75 </Item> 76 <Item> 77 <Source>Klöntti.png</Source> 78 <Name>Klöntti</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 <Options>None</Options> 82 <Output>C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Klöntti.xnb</Output> 83 <Time>2014-07-01T10:43:38.43299+03:00</Time> 84 </Item> 85 <Item> 86 <Source>Tausta1.png</Source> 87 <Name>Tausta1</Name> 88 <Importer>TextureImporter</Importer> 89 <Processor>TextureProcessor</Processor> 90 <Options>None</Options> 91 <Output>C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Tausta1.xnb</Output> 92 <Time>2014-07-01T12:37:34.540993+03:00</Time> 93 </Item> 94 <Item> 95 <Source>Pelaaja1-1.png</Source> 96 <Name>Pelaaja1-1</Name> 97 <Importer>TextureImporter</Importer> 98 <Processor>TextureProcessor</Processor> 99 <Options>None</Options> 100 <Output>C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Pelaaja1-1.xnb</Output> 101 <Time>2014-07-01T14:39:34.5996765+03:00</Time> 102 </Item> 103 <Item> 104 <Source>Pelaaja1-2.png</Source> 105 <Name>Pelaaja1-2</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 <Options>None</Options> 109 <Output>C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Pelaaja1-2.xnb</Output> 110 <Time>2014-07-01T14:39:41.9420964+03:00</Time> 111 </Item> 112 <Item> 113 <Source>Pelaaja1-3.png</Source> 114 <Name>Pelaaja1-3</Name> 115 <Importer>TextureImporter</Importer> 116 <Processor>TextureProcessor</Processor> 117 <Options>None</Options> 118 <Output>C:\Users\Wille Kotala\Documents\WilleK\Project_000\Project_000\Project_000\bin\x86\Debug\Content\Pelaaja1-3.xnb</Output> 119 <Time>2014-07-01T14:39:47.4084091+03:00</Time> 48 120 </Item> 49 121 <BuildSuccessful>true</BuildSuccessful>
Note: See TracChangeset
for help on using the changeset viewer.