- Timestamp:
- 2015-06-09 15:05:18 (8 years ago)
- Location:
- 2015/24/TomasC
- Files:
-
- 15 added
- 1 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/24/TomasC/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1.cs
r5920 r5952 14 14 15 15 PlatformCharacter pelaaja1; 16 int kenttaNro = 1; 17 16 18 17 19 Image pelaajanKuva = LoadImage("norsu"); … … 20 22 SoundEffect maaliAani = LoadSoundEffect("maali"); 21 23 24 Image taustakuva = LoadImage("BR"); 25 22 26 public override void Begin() 23 27 { 28 LataaKentta(); 29 } 30 31 void LataaKentta() 32 { 33 ClearAll(); 34 24 35 Gravity = new Vector(0, -1000); 25 36 26 LuoKentta(); 37 IsFullScreen = true; 38 39 LuoKentta("kentta"+kenttaNro); 27 40 LisaaNappaimet(); 28 41 29 42 Camera.Follow(pelaaja1); 30 Camera.ZoomFactor = 1.2;43 Camera.ZoomFactor = 2.0; 31 44 Camera.StayInLevel = true; 32 45 } 33 46 34 void LuoKentta()47 void seuraavakentta() 35 48 { 36 TileMap kentta = TileMap.FromLevelAsset("kentta1"); 37 kentta.SetTileMethod('K', Lisaahirvio); 38 kentta.SetTileMethod('#', LisaaTaso); 39 kentta.SetTileMethod('*', LisaaTahti); 40 kentta.SetTileMethod('N', LisaaPelaaja); 41 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 49 kenttaNro++; 50 LataaKentta(); 51 } 52 53 void LuoKentta(string kentta) 54 { 55 ColorTileMap ruudut = ColorTileMap.FromLevelAsset(kentta); 56 57 ruudut.SetTileMethod(Color.Black, Lisaahirvio); 58 ruudut.SetTileMethod(Color.Rose, LisaaTaso); 59 ruudut.SetTileMethod(Color.Red, LisaaTahti); 60 ruudut.SetTileMethod(Color.Gold, LisaaPelaaja); 61 ruudut.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 42 62 Level.CreateBorders(); 43 Level.Background. CreateGradient(Color.White, Color.SkyBlue);63 Level.Background.Image = taustakuva; 44 64 } 45 65 … … 49 69 taso.Position = paikka; 50 70 taso.Color = Color.Green; 71 taso.CollisionIgnoreGroup = 3; 51 72 Add(taso); 52 73 } … … 70 91 AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 71 92 AddCollisionHandler(pelaaja1, "Jarmo", TormaaShrek); 72 93 pelaaja1.Tag = "Jimmy"; 73 94 Add(pelaaja1); 74 95 } … … 99 120 void Hyppaa(PlatformCharacter hahmo, double nopeus) 100 121 { 122 101 123 hahmo.Jump(nopeus); 102 124 } … … 110 132 void Lisaahirvio(Vector paikka, double leveys, double korkeus) 111 133 { 112 PhysicsObject Jarmo = PhysicsObject.CreateStaticObject(leveys, korkeus);134 PhysicsObject Jarmo = new PhysicsObject(leveys, korkeus); 113 135 Jarmo.Position = paikka; 114 Jarmo.Image = tahtiKuva;136 Jarmo.Image = LoadImage("Jarmo"); 115 137 Jarmo.Tag = "Jarmo"; 116 138 Add(Jarmo); 139 140 FollowerBrain seuraajanAivot = new FollowerBrain("Jimmy"); 141 Jarmo.Brain = seuraajanAivot; 142 seuraajanAivot.Speed = 100; 143 seuraajanAivot.DistanceFar = 2000; 144 seuraajanAivot.DistanceClose = 2000; 145 seuraajanAivot.StopWhenTargetClose = false; 146 seuraajanAivot.Active = true; 147 Jarmo.CollisionIgnoreGroup = 3; 148 149 117 150 } 118 151 void TormaaShrek(PhysicsObject hahmo, PhysicsObject Jarmo) … … 121 154 maaliAani.Play(); 122 155 MessageDisplay.Add("GET OUT OF ME SWAMP"); 156 rajaytaShrek(Jarmo, LoadImage("Snipe"), 100); 157 rajaytaShrek(Jarmo, LoadImage("Shrekt"), 200); 158 rajaytaShrek(Jarmo, LoadImage("MD"), 100); 159 Timer.SingleShot(3.0, LataaKentta); 160 161 123 162 } 163 void rajaytaShrek(PhysicsObject Jarmo, Image kuva, int pMax) 164 { 165 166 ExplosionSystem rajahdys = new ExplosionSystem(kuva, pMax); 167 rajahdys.Position = Jarmo.Position; 168 169 Add(rajahdys); 170 rajahdys.AddEffect(Jarmo.X, Jarmo.Y, pMax); 171 } 172 void Pelaaja1Tormasi(PhysicsObject pelaaja1, PhysicsObject Jarmo) 173 { 174 175 176 LataaKentta(); 177 124 178 } 179 180 } -
2015/24/TomasC/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1.csproj.Debug.cachefile
r5920 r5952 2 2 Content\norsu.xnb 3 3 Content\tahti.xnb 4 Content\kentta1.xnb 4 Content\Jarmo.xnb 5 Content\Shrekt.xnb 6 Content\Snipe.xnb 7 Content\MD.xnb 8 Content\BR.xnb 9 Content\Kentta1.xnb 10 Content\Kentta1.png -
2015/24/TomasC/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/ContentPipeline-{B88964E3-D150-4A29-8542-EAE6F8D61D58}.xml
r5920 r5952 30 30 </Item> 31 31 <Item> 32 <Source> kentta1.txt</Source>33 <Name> kentta1</Name>34 <Importer>Text FileImporter</Importer>35 <Processor>Text FileContentProcessor</Processor>32 <Source>Jarmo.png</Source> 33 <Name>Jarmo</Name> 34 <Importer>TextureImporter</Importer> 35 <Processor>TextureProcessor</Processor> 36 36 <Options>None</Options> 37 <Output>C:\MyTemp\TomasC\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2015-06-08T14:39:43.4289912+03:00</Time> 37 <Output>C:\MyTemp\TomasC\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Jarmo.xnb</Output> 38 <Time>2015-06-09T09:52:55.1770641+03:00</Time> 39 </Item> 40 <Item> 41 <Source>Shrekt.png</Source> 42 <Name>Shrekt</Name> 43 <Importer>TextureImporter</Importer> 44 <Processor>TextureProcessor</Processor> 45 <Options>None</Options> 46 <Output>C:\MyTemp\TomasC\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Shrekt.xnb</Output> 47 <Time>2015-06-09T10:51:45.2556641+03:00</Time> 48 </Item> 49 <Item> 50 <Source>Snipe.png</Source> 51 <Name>Snipe</Name> 52 <Importer>TextureImporter</Importer> 53 <Processor>TextureProcessor</Processor> 54 <Options>None</Options> 55 <Output>C:\MyTemp\TomasC\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Snipe.xnb</Output> 56 <Time>2015-06-09T11:12:17.8351641+03:00</Time> 57 </Item> 58 <Item> 59 <Source>MD.png</Source> 60 <Name>MD</Name> 61 <Importer>TextureImporter</Importer> 62 <Processor>TextureProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\MyTemp\TomasC\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\MD.xnb</Output> 65 <Time>2015-06-09T11:16:46.8034641+03:00</Time> 66 </Item> 67 <Item> 68 <Source>BR.png</Source> 69 <Name>BR</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\TomasC\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\BR.xnb</Output> 74 <Time>2015-06-09T11:49:32.1894641+03:00</Time> 75 </Item> 76 <Item> 77 <Source>Kentta1.png</Source> 78 <Name>Kentta1</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 <Options>None</Options> 82 <Output>C:\MyTemp\TomasC\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Kentta1.xnb</Output> 83 <Time>2015-06-09T14:40:41.5936641+03:00</Time> 39 84 </Item> 40 85 <BuildSuccessful>true</BuildSuccessful> -
2015/24/TomasC/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/Tasohyppelypeli1.csproj.FileListAbsolute.txt
r5920 r5952 11 11 C:\MyTemp\TomasC\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\obj\x86\Debug\Tasohyppelypeli1.exe 12 12 C:\MyTemp\TomasC\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\obj\x86\Debug\Tasohyppelypeli1.pdb 13 C:\MyTemp\TomasC\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Jarmo.xnb 14 C:\MyTemp\TomasC\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Shrekt.xnb 15 C:\MyTemp\TomasC\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Snipe.xnb 16 C:\MyTemp\TomasC\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\MD.xnb 17 C:\MyTemp\TomasC\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\BR.xnb 18 C:\MyTemp\TomasC\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Kentta1.png -
2015/24/TomasC/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/cachefile-{B88964E3-D150-4A29-8542-EAE6F8D61D58}-targetpath.txt
r5920 r5952 2 2 Content\norsu.xnb 3 3 Content\tahti.xnb 4 Content\kentta1.xnb 4 Content\Jarmo.xnb 5 Content\Shrekt.xnb 6 Content\Snipe.xnb 7 Content\MD.xnb 8 Content\BR.xnb 9 Content\Kentta1.xnb 10 Content\Kentta1.png -
2015/24/TomasC/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/Tasohyppelypeli1Content.contentproj
r5920 r5952 61 61 <Processor>TextureProcessor</Processor> 62 62 </Compile> 63 <Compile Include="kentta1.txt"> 64 <Name>kentta1</Name> 65 <Importer>TextFileImporter</Importer> 66 <Processor>TextFileContentProcessor</Processor> 63 </ItemGroup> 64 <ItemGroup> 65 <Compile Include="Jarmo.png"> 66 <Name>Jarmo</Name> 67 <Importer>TextureImporter</Importer> 68 <Processor>TextureProcessor</Processor> 69 </Compile> 70 </ItemGroup> 71 <ItemGroup> 72 <Compile Include="Shrekt.png"> 73 <Name>Shrekt</Name> 74 <Importer>TextureImporter</Importer> 75 <Processor>TextureProcessor</Processor> 76 </Compile> 77 </ItemGroup> 78 <ItemGroup> 79 <Compile Include="Snipe.png"> 80 <Name>Snipe</Name> 81 <Importer>TextureImporter</Importer> 82 <Processor>TextureProcessor</Processor> 83 </Compile> 84 </ItemGroup> 85 <ItemGroup> 86 <Compile Include="MD.png"> 87 <Name>MD</Name> 88 <Importer>TextureImporter</Importer> 89 <Processor>TextureProcessor</Processor> 90 </Compile> 91 </ItemGroup> 92 <ItemGroup> 93 <Compile Include="BR.png"> 94 <Name>BR</Name> 95 <Importer>TextureImporter</Importer> 96 <Processor>TextureProcessor</Processor> 97 </Compile> 98 </ItemGroup> 99 <ItemGroup> 100 <Compile Include="Kentta1.png"> 101 <Name>Kentta1</Name> 102 <Importer>TextureImporter</Importer> 103 <Processor>TextureProcessor</Processor> 104 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 67 105 </Compile> 68 106 </ItemGroup>
Note: See TracChangeset
for help on using the changeset viewer.