Changeset 8639
- Timestamp:
- 2017-06-14 11:55:44 (6 years ago)
- Location:
- 2017/24/GregoryK/LimaPeli
- Files:
-
- 12 added
- 4 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/24/GregoryK/LimaPeli/LimaPeli/LimaPeli/LimaPeli.cs
r8600 r8639 9 9 public class LimaPeli : PhysicsGame 10 10 { 11 private Animation limanKavely; 11 12 const double nopeus = 200; 12 13 const double hyppyNopeus = 550; … … 15 16 PlatformCharacter pelaaja1; 16 17 17 Image pelaajanKuva = LoadImage(" lima2");18 Image pelaajanKuva = LoadImage("slime\\slime1"); 18 19 Image tahtiKuva = LoadImage("dorito"); 20 int kenttaNro = 1; 19 21 20 22 21 23 public override void Begin() 22 24 { 23 Gravity = new Vector(0, -500); 24 25 LuoKentta(); 26 LisaaNappaimet(); 27 28 Camera.Follow(pelaaja1); 29 Camera.ZoomFactor = 1.2; 30 Camera.StayInLevel = true; 25 SeuraavaKentta(); 31 26 } 32 27 33 void LuoKentta()28 void SeuraavaKentta() 34 29 { 35 TileMap kentta = TileMap.FromLevelAsset("kentta1"); 30 ClearAll(); 31 32 if (kenttaNro == 1) LuoKentta("kentta1"); 33 else if (kenttaNro == 2) LuoKentta("kentta2"); 34 else if (kenttaNro == 3) LuoKentta("kentta3"); 35 else if (kenttaNro > 3) Exit(); 36 37 LisaaNappaimet(); 38 } 39 40 41 42 void LuoKentta(string kenttaTiedostonNimi) 43 { 44 limanKavely = LoadAnimation("slime"); 45 TileMap kentta = TileMap.FromLevelAsset(kenttaTiedostonNimi); 36 46 kentta.SetTileMethod('#', LisaaTaso); 37 47 kentta.SetTileMethod('*', LisaaTahti); … … 41 51 //Level.Background.CreateGradient(Color.White, Color.SkyBlue); 42 52 Level.Background.Color = Color.Gray; 43 53 54 Gravity = new Vector(0, -500); 55 56 //LuoKentta(); 57 //LisaaNappaimet(); 58 59 Camera.Follow(pelaaja1); 60 Camera.ZoomFactor = 1.2; 61 Camera.StayInLevel = true; 62 } 63 64 void TormasiMaaliin(PhysicsObject slime, PhysicsObject maali) 65 { 66 //Kasvatetaan kenttänumeroa yhdellä ja siirrytään seuraavaan kenttään: 67 kenttaNro++; 68 SeuraavaKentta(); 69 } 70 71 void TormasiPiikkiin(PhysicsObject slime, PhysicsObject piikki) 72 { 73 //Sama kenttä ladataan alusta jos kenttänumeroa ei kasvateta: 74 SeuraavaKentta(); 44 75 } 45 76 … … 64 95 void LisaaPelaaja(Vector paikka, double leveys, double korkeus) 65 96 { 97 66 98 pelaaja1 = new PlatformCharacter(leveys, korkeus); 67 99 pelaaja1.Position = paikka; … … 69 101 pelaaja1.Image = pelaajanKuva; 70 102 AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 103 pelaaja1.Animation = new Animation(limanKavely); 104 pelaaja1.Animation.Start(); 71 105 Add(pelaaja1); 72 106 } -
2017/24/GregoryK/LimaPeli/LimaPeli/LimaPeli/LimaPeli.csproj.Debug.cachefile
r8600 r8639 1 1 Content\maali.xnb 2 2 Content\kentta1.xnb 3 Content\lima.xnb4 3 Content\dorito.xnb 5 4 Content\slime background.xnb 6 Content\lima2.xnb 5 Content\slime.xnb 6 Content\slime\slime1.xnb 7 Content\slime\slime2.xnb 8 Content\slime\slime3_0.xnb 9 Content\slime\slime4_0.xnb -
2017/24/GregoryK/LimaPeli/LimaPeli/LimaPeli/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml
r8600 r8639 21 21 </Item> 22 22 <Item> 23 <Source>lima.png</Source>24 <Name>lima</Name>25 <Importer>TextureImporter</Importer>26 <Processor>TextureProcessor</Processor>27 <Options>None</Options>28 <Output>C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\lima.xnb</Output>29 <Time>2017-06-13T11:13:37.5574996+03:00</Time>30 </Item>31 <Item>32 23 <Source>dorito.png</Source> 33 24 <Name>dorito</Name> … … 48 39 </Item> 49 40 <Item> 50 <Source>lima2.png</Source> 51 <Name>lima2</Name> 41 <Source>slime.anim</Source> 42 <Name>slime</Name> 43 <Importer>AnimationImporter</Importer> 44 <Processor>AnimationContentProcessor</Processor> 45 <Options>None</Options> 46 <Output>C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\slime.xnb</Output> 47 <Time>2017-06-14T11:05:09.7369882+03:00</Time> 48 <Request>C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\slime\slime1.xnb</Request> 49 <Request>C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\slime\slime2.xnb</Request> 50 <Request>C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\slime\slime3_0.xnb</Request> 51 <Request>C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\slime\slime4_0.xnb</Request> 52 </Item> 53 <Item> 54 <Source>slime\slime1.png</Source> 55 <Name>slime\slime1</Name> 52 56 <Importer>TextureImporter</Importer> 53 57 <Processor>TextureProcessor</Processor> 54 58 <Options>None</Options> 55 <Output>C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\lima2.xnb</Output> 56 <Time>2017-06-13T12:45:11.0549912+03:00</Time> 59 <Output>C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\slime\slime1.xnb</Output> 60 <Time>2017-06-13T14:53:50.0950627+03:00</Time> 61 </Item> 62 <Item> 63 <Source>slime\slime2.png</Source> 64 <Name>slime\slime2</Name> 65 <Importer>TextureImporter</Importer> 66 <Processor>TextureProcessor</Processor> 67 <Options>None</Options> 68 <Output>C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\slime\slime2.xnb</Output> 69 <Time>2017-06-13T14:53:54.0385518+03:00</Time> 70 </Item> 71 <Item> 72 <Source>slime\slime3.png</Source> 73 <Importer>TextureImporter</Importer> 74 <Processor>TextureProcessor</Processor> 75 <Options>None</Options> 76 <Output>C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\slime\slime3_0.xnb</Output> 77 <Time>2017-06-14T10:17:32.8307018+03:00</Time> 78 </Item> 79 <Item> 80 <Source>slime\slime4.png</Source> 81 <Importer>TextureImporter</Importer> 82 <Processor>TextureProcessor</Processor> 83 <Options>None</Options> 84 <Output>C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\slime\slime4_0.xnb</Output> 85 <Time>2017-06-14T10:48:12.2319619+03:00</Time> 57 86 </Item> 58 87 <BuildSuccessful>true</BuildSuccessful> -
2017/24/GregoryK/LimaPeli/LimaPeli/LimaPeli/obj/x86/Debug/LimaPeli.csproj.FileListAbsolute.txt
r8600 r8639 9 9 C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\obj\x86\Debug\LimaPeli.exe 10 10 C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\obj\x86\Debug\LimaPeli.pdb 11 C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\lima.xnb12 11 C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\dorito.xnb 13 12 C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\slime background.xnb 14 C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\lima2.xnb 13 C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\slime.xnb 14 C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\slime\slime1.xnb 15 C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\slime\slime2.xnb 16 C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\slime\slime3_0.xnb 17 C:\MyTemp\GregoryK\LimaPeli\LimaPeli\LimaPeli\bin\x86\Debug\Content\slime\slime4_0.xnb -
2017/24/GregoryK/LimaPeli/LimaPeli/LimaPeli/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt
r8600 r8639 1 1 Content\maali.xnb 2 2 Content\kentta1.xnb 3 Content\lima.xnb4 3 Content\dorito.xnb 5 4 Content\slime background.xnb 6 Content\lima2.xnb 5 Content\slime.xnb 6 Content\slime\slime1.xnb 7 Content\slime\slime2.xnb 8 Content\slime\slime3_0.xnb 9 Content\slime\slime4_0.xnb -
2017/24/GregoryK/LimaPeli/LimaPeli/LimaPeliContent/LimaPeliContent.contentproj
r8600 r8639 58 58 </ItemGroup> 59 59 <ItemGroup> 60 <Compile Include="lima.png">61 <Name>lima</Name>62 <Importer>TextureImporter</Importer>63 <Processor>TextureProcessor</Processor>64 </Compile>65 </ItemGroup>66 <ItemGroup>67 60 <Compile Include="dorito.png"> 68 61 <Name>dorito</Name> … … 79 72 </ItemGroup> 80 73 <ItemGroup> 81 <Compile Include="lima2.png"> 82 <Name>lima2</Name> 74 <Compile Include="slime.anim"> 75 <Name>slime</Name> 76 <Importer>AnimationImporter</Importer> 77 <Processor>AnimationContentProcessor</Processor> 78 </Compile> 79 </ItemGroup> 80 <ItemGroup /> 81 <ItemGroup> 82 <Compile Include="slime\slime1.png"> 83 <Name>slime1</Name> 84 <Importer>TextureImporter</Importer> 85 <Processor>TextureProcessor</Processor> 86 </Compile> 87 </ItemGroup> 88 <ItemGroup> 89 <Compile Include="slime\slime2.png"> 90 <Name>slime2</Name> 83 91 <Importer>TextureImporter</Importer> 84 92 <Processor>TextureProcessor</Processor>
Note: See TracChangeset
for help on using the changeset viewer.