Changeset 9447
- Timestamp:
- 2017-08-04 13:04:17 (5 years ago)
- Location:
- 2017/31/OskariP
- Files:
-
- 4 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/31/OskariP/Alienharvester2/Alienharvester2/Alienharvester2/Alienharvester2.cs
r9430 r9447 14 14 15 15 const double nopeus = 200; 16 const double hyppyNopeus = 750;16 const double hyppyNopeus = 1000; 17 17 const int RUUDUN_KOKO = 40; 18 18 … … 24 24 Image olion3kuva = LoadImage("gargantua"); 25 25 Image olion4uva = LoadImage("vortigaunt"); 26 Image olio33im = LoadImage("olio3"); 26 27 27 28 SoundEffect maaliAani = LoadSoundEffect("maali"); 28 29 29 30 bool saakoRajahtaa = true; 31 30 32 31 33 public override void Begin() 32 34 { 33 Gravity = new Vector(0, - 1000);35 Gravity = new Vector(0, -2000); 34 36 35 37 LuoKentta(); 36 38 LisaaNappaimet(); 37 39 gargant(); 40 olio33(); 41 vortigaunt(); 38 42 39 43 … … 43 47 pelaaja1.Weapon = new AssaultRifle(30, 10); 44 48 pelaaja1.Weapon.ProjectileCollision = AmmusOsui; 45 PhysicsObject vortigaunt = new PhysicsObject(50, 50); 46 vortigaunt.Shape = Shape.Rectangle; 47 Add(vortigaunt); 48 vortigaunt.Color = Color.DarkGreen; 49 vortigaunt.Image = olion4uva; 49 50 50 51 51 } … … 160 160 tasoAivot.Speed = 200; 161 161 tasoAivot.FallsOffPlatforms = true; 162 162 163 163 tasoAivot.JumpSpeed = 1700; 164 164 tasoAivot.TriesToJump = true; … … 166 166 gargantuan.Brain = tasoAivot; 167 167 168 169 168 } 169 void vortigaunt() 170 { 171 PlatformCharacter vortigaunt = new PlatformCharacter(50, 50); 172 Add(vortigaunt); 173 vortigaunt.Shape = Shape.Rectangle; 174 vortigaunt.Color = Color.DarkGreen; 175 vortigaunt.Image = olion4uva; 176 177 PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 178 tasoAivot.Speed = 100; 179 180 181 182 tasoAivot.JumpSpeed = 700; 183 tasoAivot.TriesToJump = true; 184 tasoAivot.FallsOffPlatforms = false; 185 186 vortigaunt.Brain = tasoAivot; 187 188 170 189 // Millä nopeudella kohdetta seurataan 171 190 // Pysähdytään kun ollaan lähellä kohdetta 172 191 //seuraajanAivot.FarBrain = satunnaisAivot; // Käytetään satunnaisaivoja kun ollaan kaukana 173 192 174 193 175 194 } … … 189 208 190 209 } 191 210 void olio33() 211 { 212 PhysicsObject olio3 = new PhysicsObject(25, 25); 213 olio3.Mass = 20; 214 olio3.Image = olio33im; 215 olio3.X = -400; 216 olio3.Y = 200; 217 Add(olio3); 218 FollowerBrain seuraajanAivot = new FollowerBrain(pelaaja1); 219 seuraajanAivot.Speed = 300; // Millä nopeudella kohdetta seurataan 220 seuraajanAivot.DistanceFar = 2200; // Etäisyys jolla aletaan seurata kohdetta 221 seuraajanAivot.DistanceClose = 200; // Etäisyys jolloin ollaan lähellä kohdetta 222 seuraajanAivot.StopWhenTargetClose = false; // Pysähdytään kun ollaan lähellä kohdetta 223 // seuraajanAivot.FarBrain = satunnaisAivot; // Käytetään satunnaisaivoja kun ollaan kaukana 224 225 // Tapahtuma, joka tapahtuu kun ollaan lähellä kohdetta 226 seuraajanAivot.TargetClose += mitaKunOllaanLahella; 227 olio3.Brain = seuraajanAivot; 228 } 229 230 231 // Aliohjelma joka ajetaan kun olio on tarpeeksi lähellä kohdetta. 232 233 234 235 236 void mitaKunOllaanLahella() 237 { 238 if (!saakoRajahtaa) return; 239 saakoRajahtaa = false; 240 Timer.SingleShot(5, () => { saakoRajahtaa = true; }); 241 242 Explosion rajahdys = new Explosion(120); 243 rajahdys.Position = pelaaja1.Position; 244 rajahdys.Speed = 50.0; 245 rajahdys.Force = 50000; 246 Add(rajahdys); 247 } 248 192 249 193 250 } -
2017/31/OskariP/Alienharvester2/Alienharvester2/Alienharvester2/Alienharvester2.csproj.Debug.cachefile
r9430 r9447 10 10 Content\Tausta2.xnb 11 11 Content\ammuslaatikko.xnb 12 Content\olio3.xnb -
2017/31/OskariP/Alienharvester2/Alienharvester2/Alienharvester2/obj/x86/Debug/Alienharvester2.csproj.FileListAbsolute.txt
r9430 r9447 18 18 C:\MyTemp\OskariP\Alienharvester2\Alienharvester2\Alienharvester2\bin\x86\Debug\Content\Tausta2.xnb 19 19 C:\MyTemp\OskariP\Alienharvester2\Alienharvester2\Alienharvester2\bin\x86\Debug\Content\ammuslaatikko.xnb 20 C:\MyTemp\OskariP\Alienharvester2\Alienharvester2\Alienharvester2\bin\x86\Debug\Content\olio3.xnb -
2017/31/OskariP/Alienharvester2/Alienharvester2/Alienharvester2/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml
r9430 r9447 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\OskariP\Alienharvester2\Alienharvester2\Alienharvester2\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2017-08-04T1 1:36:10.9831296+03:00</Time>38 <Time>2017-08-04T12:42:40.2283854+03:00</Time> 39 39 </Item> 40 40 <Item> … … 101 101 <Time>2017-08-04T11:41:54.1851585+03:00</Time> 102 102 </Item> 103 <Item> 104 <Source>olio3.png</Source> 105 <Name>olio3</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 <Options>None</Options> 109 <Output>C:\MyTemp\OskariP\Alienharvester2\Alienharvester2\Alienharvester2\bin\x86\Debug\Content\olio3.xnb</Output> 110 <Time>2017-08-04T11:55:14.1019632+03:00</Time> 111 </Item> 103 112 <BuildSuccessful>true</BuildSuccessful> 104 113 <Settings> -
2017/31/OskariP/Alienharvester2/Alienharvester2/Alienharvester2/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt
r9430 r9447 10 10 Content\Tausta2.xnb 11 11 Content\ammuslaatikko.xnb 12 Content\olio3.xnb -
2017/31/OskariP/Alienharvester2/Alienharvester2/Alienharvester2Content/Alienharvester2Content.contentproj
r9430 r9447 116 116 </Compile> 117 117 </ItemGroup> 118 <ItemGroup> 119 <Compile Include="olio3.png"> 120 <Name>olio3</Name> 121 <Importer>TextureImporter</Importer> 122 <Processor>TextureProcessor</Processor> 123 </Compile> 124 </ItemGroup> 118 125 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 119 126 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2017/31/OskariP/Alienharvester2/Alienharvester2/Alienharvester2Content/kentta1.txt
r9430 r9447 14 14 * * * * # 15 15 ### ### ### ### # 16 * * * #17 ### ### ### #18 * * * # #19 ### ### ### ### # ##################20 ####################21 N ######################22 ##################################################### ###################################################16 * * * 17 ### ### ### 18 * * * # 19 ### ### ### ### 20 21 N 22 #####################################################
Note: See TracChangeset
for help on using the changeset viewer.