Changeset 5841
- Timestamp:
- 2015-05-16 14:50:12 (8 years ago)
- Location:
- 2014/koodauskerho/38/FransM/Destroy
- Files:
-
- 10 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/koodauskerho/38/FransM/Destroy/Destroy/Destroy/Destroy.cs
r5828 r5841 9 9 public class Destroy : PhysicsGame 10 10 { 11 12 bool osuiIhmiseen = false; 13 11 14 const double nopeus = 200; 12 15 const double hyppyNopeus = 750; … … 15 18 PlatformCharacter pelaaja1; 16 19 17 Image pelaajanKuva = LoadImage("norsu");20 Image pelaajanKuva1 = LoadImage("norsu2"); 18 21 Image tahtiKuva = LoadImage("tahti"); 19 Image vihukuva = LoadImage("ihminen"); 22 Image vihukuva = LoadImage("ihminenpaikallaan"); 23 Image[] ukkelinKavely = LoadImages("norsu", "norsu3"); 24 Image[] vihukavely = LoadImages("ihminen", "ihminen2"); 25 Image tasoKuva = LoadImage("palikka"); 20 26 21 27 SoundEffect maaliAani = LoadSoundEffect("maali"); … … 28 34 LisaaNappaimet(); 29 35 36 37 SmoothTextures = false; 30 38 Camera.Follow(pelaaja1); 31 39 Camera.ZoomFactor = 1.2; … … 49 57 void LuoIhminen(Vector paikka, double leveys, double korkeus) 50 58 { 51 P hysicsObject ihminen = new PhysicsObject(40, 50 );59 PlatformCharacter ihminen = new PlatformCharacter(40, 50 ); 52 60 ihminen.Position = paikka; 53 61 ihminen.Shape = Shape.Rectangle; 54 62 Add( ihminen ); 63 ihminen.Mass = 10.0; 55 64 ihminen.Image = vihukuva; 56 65 57 } 66 PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 67 tasoAivot.Speed = 100; 58 68 69 ihminen.Brain = tasoAivot; 70 ihminen.Tag = "ihminen"; 59 71 60 61 void LisaaTaso(Vector paikka, double leveys, double korkeus) 62 { 63 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 64 taso.Position = paikka; 65 taso.Color = Color.Green; 66 Add(taso); 72 ihminen.AnimWalk = new Animation(vihukavely); 73 74 ihminen.AnimIdle = new Animation(vihukuva); 67 75 } 68 76 … … 76 84 Add(tahti); 77 85 } 86 87 void LisaaTaso(Vector paikka, double leveys, double korkeus) 88 { 89 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 90 taso.Position = paikka; 91 taso.Color = Color.Green; 92 Add(taso); 93 } 78 94 79 95 void LisaaPelaaja(Vector paikka, double leveys, double korkeus) … … 82 98 pelaaja1.Position = paikka; 83 99 pelaaja1.Mass = 4.0; 84 pelaaja1.Image = pelaajanKuva ;100 pelaaja1.Image = pelaajanKuva1; 85 101 AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 86 102 Add(pelaaja1); 103 pelaaja1.IgnoresExplosions = true; 104 pelaaja1.AnimWalk = new Animation(ukkelinKavely); 105 106 pelaaja1.AnimIdle = new Animation(pelaajanKuva1); 107 pelaaja1.AnimWalk.FPS = 6; 87 108 88 109 } … … 128 149 { 129 150 MessageDisplay.Add("Aktivointi"); 130 Timer.SingleShot(5.0, delegate { MessageDisplay.Add("Nyt se räjähti"); }); 151 Timer.SingleShot(3.0, delegate { 152 MessageDisplay.Add("Nyt se räjähti"); 153 Explosion rajahdys = new Explosion(100); 154 rajahdys.Position = hahmo.Position + new Vector(0, 10); 155 rajahdys.AddShockwaveHandler("ihminen", PaineaaltoOsuu); 156 Add(rajahdys); 157 rajahdys.Speed = 100; 158 Timer.SingleShot(1.0, delegate 159 { 160 if (!osuiIhmiseen) hahmo.Destroy(); 161 osuiIhmiseen = false; 162 }); 163 164 }); 131 165 } 132 166 167 void PaineaaltoOsuu(IPhysicsObject olio, Vector shokki) 168 { 169 olio.Destroy(); 170 osuiIhmiseen = true; 171 } 172 173 void AloitaAlusta() 174 { 175 ClearAll(); 176 LuoKentta(); 177 } 178 179 133 180 } -
2014/koodauskerho/38/FransM/Destroy/Destroy/Destroy/Destroy.csproj.Debug.cachefile
r5828 r5841 2 2 Content\norsu.xnb 3 3 Content\tahti.xnb 4 Content\Ihminen.xnb 4 5 Content\kentta1.xnb 5 Content\Ihminen.xnb 6 Content\norsu2.xnb 7 Content\norsu3.xnb 8 Content\Ihminenpaikallaan.xnb 9 Content\Ihminen2.xnb 10 Content\palikka.xnb -
2014/koodauskerho/38/FransM/Destroy/Destroy/Destroy/obj/x86/Debug/ContentPipeline-{C577C307-9368-49BF-8519-D17A06D491FA}.xml
r5828 r5841 9 9 <Options>None</Options> 10 10 <Output>C:\MyTemp\FransM\Destroy\Destroy\Destroy\bin\x86\Debug\Content\maali.xnb</Output> 11 <Time>2015-0 4-18T13:22:37.9229754+03:00</Time>11 <Time>2015-05-16T10:02:16.4654142+03:00</Time> 12 12 </Item> 13 13 <Item> … … 18 18 <Options>None</Options> 19 19 <Output>C:\MyTemp\FransM\Destroy\Destroy\Destroy\bin\x86\Debug\Content\norsu.xnb</Output> 20 <Time>2015-0 4-18T13:51:24.4376822+03:00</Time>20 <Time>2015-05-16T10:02:16.5278142+03:00</Time> 21 21 </Item> 22 22 <Item> … … 27 27 <Options>None</Options> 28 28 <Output>C:\MyTemp\FransM\Destroy\Destroy\Destroy\bin\x86\Debug\Content\tahti.xnb</Output> 29 <Time>2015-04-18T13:27:52.1437082+03:00</Time> 29 <Time>2015-05-16T10:02:16.5746142+03:00</Time> 30 </Item> 31 <Item> 32 <Source>Ihminen.png</Source> 33 <Name>Ihminen</Name> 34 <Importer>TextureImporter</Importer> 35 <Processor>TextureProcessor</Processor> 36 <Options>None</Options> 37 <Output>C:\MyTemp\FransM\Destroy\Destroy\Destroy\bin\x86\Debug\Content\Ihminen.xnb</Output> 38 <Time>2015-05-16T13:31:12.8654037+03:00</Time> 30 39 </Item> 31 40 <Item> … … 36 45 <Options>None</Options> 37 46 <Output>C:\MyTemp\FransM\Destroy\Destroy\Destroy\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2015-0 4-18T14:25:21.4558084+03:00</Time>47 <Time>2015-05-16T10:22:44.0744142+03:00</Time> 39 48 </Item> 40 49 <Item> 41 <Source> Ihminen.png</Source>42 <Name> Ihminen</Name>50 <Source>norsu2.png</Source> 51 <Name>norsu2</Name> 43 52 <Importer>TextureImporter</Importer> 44 53 <Processor>TextureProcessor</Processor> 45 54 <Options>None</Options> 46 <Output>C:\MyTemp\FransM\Destroy\Destroy\Destroy\bin\x86\Debug\Content\Ihminen.xnb</Output> 47 <Time>2015-04-18T14:37:59.8341999+03:00</Time> 55 <Output>C:\MyTemp\FransM\Destroy\Destroy\Destroy\bin\x86\Debug\Content\norsu2.xnb</Output> 56 <Time>2015-05-16T13:21:23.0996037+03:00</Time> 57 </Item> 58 <Item> 59 <Source>norsu3.png</Source> 60 <Name>norsu3</Name> 61 <Importer>TextureImporter</Importer> 62 <Processor>TextureProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\MyTemp\FransM\Destroy\Destroy\Destroy\bin\x86\Debug\Content\norsu3.xnb</Output> 65 <Time>2015-05-16T13:22:59.9728037+03:00</Time> 66 </Item> 67 <Item> 68 <Source>Ihminenpaikallaan.png</Source> 69 <Name>Ihminenpaikallaan</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\FransM\Destroy\Destroy\Destroy\bin\x86\Debug\Content\Ihminenpaikallaan.xnb</Output> 74 <Time>2015-05-16T13:31:43.2114037+03:00</Time> 75 </Item> 76 <Item> 77 <Source>Ihminen2.png</Source> 78 <Name>Ihminen2</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 <Options>None</Options> 82 <Output>C:\MyTemp\FransM\Destroy\Destroy\Destroy\bin\x86\Debug\Content\Ihminen2.xnb</Output> 83 <Time>2015-05-16T13:32:28.5102037+03:00</Time> 84 </Item> 85 <Item> 86 <Source>palikka.png</Source> 87 <Name>palikka</Name> 88 <Importer>TextureImporter</Importer> 89 <Processor>TextureProcessor</Processor> 90 <Options>None</Options> 91 <Output>C:\MyTemp\FransM\Destroy\Destroy\Destroy\bin\x86\Debug\Content\palikka.xnb</Output> 92 <Time>2015-05-16T14:47:51.5318037+03:00</Time> 48 93 </Item> 49 94 <BuildSuccessful>true</BuildSuccessful> … … 94 139 <Assembly> 95 140 <Key>C:\Windows\Microsoft.Net\assembly\GAC_32\Microsoft.Xna.Framework.Content.Pipeline\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Content.Pipeline.dll</Key> 96 <Value>2014-04-23T0 0:53:38.0521963+03:00</Value>141 <Value>2014-04-23T01:01:53.8831999+03:00</Value> 97 142 </Assembly> 98 143 </Assemblies> -
2014/koodauskerho/38/FransM/Destroy/Destroy/Destroy/obj/x86/Debug/Destroy.csproj.FileListAbsolute.txt
r5828 r5841 12 12 C:\MyTemp\FransM\Destroy\Destroy\Destroy\obj\x86\Debug\Destroy.pdb 13 13 C:\MyTemp\FransM\Destroy\Destroy\Destroy\bin\x86\Debug\Content\Ihminen.xnb 14 C:\MyTemp\FransM\Destroy\Destroy\Destroy\bin\x86\Debug\Content\norsu2.xnb 15 C:\MyTemp\FransM\Destroy\Destroy\Destroy\bin\x86\Debug\Content\norsu3.xnb 16 C:\MyTemp\FransM\Destroy\Destroy\Destroy\bin\x86\Debug\Content\Ihminenpaikallaan.xnb 17 C:\MyTemp\FransM\Destroy\Destroy\Destroy\bin\x86\Debug\Content\Ihminen2.xnb 18 C:\MyTemp\FransM\Destroy\Destroy\Destroy\bin\x86\Debug\Content\palikka.xnb -
2014/koodauskerho/38/FransM/Destroy/Destroy/Destroy/obj/x86/Debug/cachefile-{C577C307-9368-49BF-8519-D17A06D491FA}-targetpath.txt
r5828 r5841 2 2 Content\norsu.xnb 3 3 Content\tahti.xnb 4 Content\Ihminen.xnb 4 5 Content\kentta1.xnb 5 Content\Ihminen.xnb 6 Content\norsu2.xnb 7 Content\norsu3.xnb 8 Content\Ihminenpaikallaan.xnb 9 Content\Ihminen2.xnb 10 Content\palikka.xnb -
2014/koodauskerho/38/FransM/Destroy/Destroy/DestroyContent/DestroyContent.contentproj
r5828 r5841 74 74 </Compile> 75 75 </ItemGroup> 76 <ItemGroup> 77 <Compile Include="norsu2.png"> 78 <Name>norsu2</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 </Compile> 82 </ItemGroup> 83 <ItemGroup> 84 <Compile Include="norsu3.png"> 85 <Name>norsu3</Name> 86 <Importer>TextureImporter</Importer> 87 <Processor>TextureProcessor</Processor> 88 </Compile> 89 </ItemGroup> 90 <ItemGroup> 91 <Compile Include="Ihminenpaikallaan.png"> 92 <Name>Ihminenpaikallaan</Name> 93 <Importer>TextureImporter</Importer> 94 <Processor>TextureProcessor</Processor> 95 </Compile> 96 </ItemGroup> 97 <ItemGroup> 98 <Compile Include="Ihminen2.png"> 99 <Name>Ihminen2</Name> 100 <Importer>TextureImporter</Importer> 101 <Processor>TextureProcessor</Processor> 102 </Compile> 103 </ItemGroup> 104 <ItemGroup> 105 <Compile Include="palikka.png"> 106 <Name>palikka</Name> 107 <Importer>TextureImporter</Importer> 108 <Processor>TextureProcessor</Processor> 109 </Compile> 110 </ItemGroup> 76 111 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 77 112 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2014/koodauskerho/38/FransM/Destroy/Destroy/DestroyContent/kentta1.txt
r5828 r5841 5 5 ## ## 6 6 7 * 7 * * * 8 8 ## ## ## 9 9
Note: See TracChangeset
for help on using the changeset viewer.