- Timestamp:
- 2015-02-14 14:59:54 (8 years ago)
- Location:
- 2014/koodauskerho/38/santeriS
- Files:
-
- 6 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/koodauskerho/38/santeriS/VaikeaTasohyppely/VaikeaTasohyppely/VaikeaTasohyppely/VaikeaTasohyppely.cs
r5799 r5810 15 15 PlatformCharacter pelaaja1; 16 16 17 Image pelaajanKuva = LoadImage(" kuvat");18 Image tahtiKuva = LoadImage("tahti"); 17 Image pelaajanKuva = LoadImage("ukkeli"); 18 19 19 20 20 SoundEffect maaliAani = LoadSoundEffect("maali"); 21 AssaultRifle pelaajan1Ase; 21 22 22 23 public override void Begin() … … 53 54 void LisaaTahti(Vector paikka, double leveys, double korkeus) 54 55 { 55 PhysicsObject tahti = PhysicsObject.CreateStaticObject(leveys, korkeus); 56 tahti.IgnoresCollisionResponse = true; 57 tahti.Position = paikka; 58 tahti.Image = tahtiKuva; 59 tahti.Tag = "tahti"; 60 Add(tahti); 56 61 57 } 62 58 … … 69 65 AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 70 66 Add(pelaaja1); 67 68 pelaajan1Ase = new AssaultRifle(30, 10); 69 pelaajan1Ase.FireRate = 0.8; 70 71 72 //Ammusten määrä aluksi: 73 pelaajan1Ase.Ammo.Value = 1000; 74 pelaajan1Ase.Image = null; 75 pelaajan1Ase.Color = Color.Transparent; 76 //Mitä tapahtuu kun ammus osuu johonkin? 77 pelaajan1Ase.ProjectileCollision = AmmusOsui; 78 79 80 pelaaja1.Weapon=pelaajan1Ase; 81 pelaaja1.Weapon.Position = new Vector(0, 10); 82 pelaajan1Ase.Ammo.Value = 12; 83 pelaajan1Ase.InfiniteAmmo = false; 71 84 } 85 86 void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 87 { 88 ammus.Destroy(); 89 } 90 91 void AmmuAseella(AssaultRifle ase) 92 { 93 PhysicsObject ammus = ase.Shoot(); 94 95 if (ammus != null) 96 { 97 ammus.Size *= 0.4; 98 //ammus.Image = ... 99 //ammus.MaximumLifetime = TimeSpan.FromSeconds(2.0); 100 } 101 } 102 72 103 73 104 void LisaaNappaimet() … … 79 110 Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 80 111 Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 112 113 Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaajan1Ase); 114 81 115 82 116 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); -
2014/koodauskerho/38/santeriS/VaikeaTasohyppely/VaikeaTasohyppely/VaikeaTasohyppely/VaikeaTasohyppely.csproj.Debug.cachefile
r5799 r5810 2 2 Content\norsu.xnb 3 3 Content\tahti.xnb 4 Content\kuvat.xnb 4 5 Content\kentta1.xnb 5 Content\kuvat.xnb 6 Content\ukkeli.xnb 7 Content\ukkeli2.xnb -
2014/koodauskerho/38/santeriS/VaikeaTasohyppely/VaikeaTasohyppely/VaikeaTasohyppely/obj/x86/Debug/VaikeaTasohyppely.csproj.FileListAbsolute.txt
r5799 r5810 12 12 C:\MyTemp\santeriS\VaikeaTasohyppely\VaikeaTasohyppely\VaikeaTasohyppely\obj\x86\Debug\VaikeaTasohyppely.pdb 13 13 C:\MyTemp\santeriS\VaikeaTasohyppely\VaikeaTasohyppely\VaikeaTasohyppely\bin\x86\Debug\Content\kuvat.xnb 14 C:\MyTemp\santeriS\VaikeaTasohyppely\VaikeaTasohyppely\VaikeaTasohyppely\bin\x86\Debug\Content\ukkeli.xnb 15 C:\MyTemp\santeriS\VaikeaTasohyppely\VaikeaTasohyppely\VaikeaTasohyppely\bin\x86\Debug\Content\ukkeli2.xnb -
2014/koodauskerho/38/santeriS/VaikeaTasohyppely/VaikeaTasohyppely/VaikeaTasohyppely/obj/x86/Debug/cachefile-{9383C1E7-5E7C-4BF1-9A8E-1E992CABC11C}-targetpath.txt
r5799 r5810 2 2 Content\norsu.xnb 3 3 Content\tahti.xnb 4 Content\kuvat.xnb 4 5 Content\kentta1.xnb 5 Content\kuvat.xnb 6 Content\ukkeli.xnb 7 Content\ukkeli2.xnb -
2014/koodauskerho/38/santeriS/VaikeaTasohyppely/VaikeaTasohyppely/VaikeaTasohyppelyContent/VaikeaTasohyppelyContent.contentproj
r5799 r5810 74 74 </Compile> 75 75 </ItemGroup> 76 <ItemGroup> 77 <Compile Include="ukkeli.png"> 78 <Name>ukkeli</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 </Compile> 82 </ItemGroup> 83 <ItemGroup> 84 <Compile Include="ukkeli2.png"> 85 <Name>ukkeli2</Name> 86 <Importer>TextureImporter</Importer> 87 <Processor>TextureProcessor</Processor> 88 </Compile> 89 </ItemGroup> 76 90 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 77 91 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset
for help on using the changeset viewer.