Changeset 7291
- Timestamp:
- 2016-06-14 14:55:22 (7 years ago)
- Location:
- 2016/24/MattiK/ZlandZ
- Files:
-
- 21 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/24/MattiK/ZlandZ/ZlandZ/ZlandZ/ZlandZ.cs
r7266 r7291 16 16 PlatformCharacter Sombombo; 17 17 18 Image pelaajanKuva = LoadImage("norsu"); 19 Image tahtiKuva = LoadImage("tahti"); 18 Image pelaajanKuva = LoadImage("lintu"); 19 Image GuninKuva = LoadImage("gun"); 20 Image BossinKuva = LoadImage("Boss"); 21 Image boxinKuva = LoadImage("box"); 22 Image piikinKuva = LoadImage("piikki"); 20 23 AssaultRifle pelaajan1Ase; 21 24 SoundEffect maaliAani = LoadSoundEffect("maali"); 22 25 int ammustenMaara = 60; 26 SoundEffect hyppyAani = LoadSoundEffect("Jump17"); 23 27 public override void Begin() 24 28 { … … 28 32 29 33 LisaaNappaimet(); 34 LuoAmmusLaskuri(); 30 35 31 36 Camera.Follow(Leaf); … … 38 43 39 44 TileMap kentta = TileMap.FromLevelAsset("kentta1"); 45 40 46 kentta.SetTileMethod('#', LisaaTaso); 41 kentta.SetTileMethod('*', LisaaTahti); 47 kentta.SetTileMethod('G', Lisaagun); 48 kentta.SetTileMethod('B', LisaaBoss); 49 kentta.SetTileMethod('b', LisaaBox); 42 50 kentta.SetTileMethod('N', LisaaPelaaja); 51 kentta.SetTileMethod('P', LisaaPiikki); 43 52 kentta.SetTileMethod('S', LisaaVihu); 44 53 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); … … 56 65 Add(taso); 57 66 } 58 IntMeter pisteLaskuri; 59 60 void Luoelamalaskuri() 61 { 62 IntMeter pisteLaskuri; 63 } 64 65 void LuoPistelaskuri() 66 { 67 68 } 69 70 void LisaaTahti(Vector paikka, double leveys, double korkeus) 71 { 72 PhysicsObject tahti = PhysicsObject.CreateStaticObject(leveys, korkeus); 73 tahti.IgnoresCollisionResponse = true; 74 tahti.Position = paikka; 75 tahti.Image = tahtiKuva; 76 tahti.Tag = "tahti"; 77 Add(tahti); 67 void LisaaPiikki(Vector paikka, double leveys, double korkeus) 68 { 69 PhysicsObject Piikki = PhysicsObject.CreateStaticObject(leveys, korkeus); 70 Piikki.Position = paikka; 71 Piikki.Color = Color.Red; 72 Add(Piikki); 73 Piikki.Image = piikinKuva; 74 Piikki.Tag = "piikki"; 75 } 76 void LisaaBoss(Vector paikka, double leveys, double korkeus) 77 { 78 PlatformCharacter Boss =new PlatformCharacter(leveys, korkeus); 79 Boss.Position = paikka; 80 Add(Boss); 81 Boss.Image = BossinKuva; 82 Boss.Tag = "pahis"; 83 PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 84 tasoAivot.Speed = 50; 85 tasoAivot.Active = true; 86 87 Boss.Brain = tasoAivot; 88 } 89 IntMeter ammusLaskuri; 90 91 void LuoAmmusLaskuri() 92 { 93 ammusLaskuri = new IntMeter(ammustenMaara); 94 Label pisteNaytto = new Label(); 95 pisteNaytto.X = Screen.Left + 100; 96 pisteNaytto.Y = Screen.Top - 100; 97 pisteNaytto.TextColor = Color.Red; 98 pisteNaytto.Color = Color.Green; 99 100 pisteNaytto.BindTo(ammusLaskuri); 101 Add(pisteNaytto); 102 } 103 104 105 106 void LisaaBox(Vector paikka, double leveys, double korkeus) 107 { 108 PhysicsObject Box = PhysicsObject.CreateStaticObject(leveys, korkeus); 109 Box.IgnoresCollisionResponse = true; 110 Box.Position = paikka; 111 Box.Image = boxinKuva; 112 Box.Tag = "Box"; 113 Add(Box); 78 114 } 79 115 void LisaaVihu(Vector paikka, double leveys, double korkeus) … … 85 121 // Sombombo.X = 140;Sombombo.Y = 180; 86 122 Sombombo.Position = paikka; 87 } 88 89 90 void LisaaPelaaja(Vector paikka, double leveys, double korkeus) 123 124 125 126 PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 127 tasoAivot.Speed = 50; 128 129 Sombombo.Brain = tasoAivot; 130 } 131 void Lisaagun(Vector paikka, double leveys, double korkeus) 132 { 133 PhysicsObject gun = new PhysicsObject(leveys, korkeus); 134 Add(gun); 135 gun.Image = LoadImage("gun"); 136 gun.Tag = "gun"; 137 gun.Position = paikka; 138 } 139 140 141 142 void LisaaPelaaja(Vector paikka, double leveys, double korkeus) 91 143 { 92 144 Leaf = new PlatformCharacter(leveys, korkeus); … … 94 146 Leaf.Mass = 4.0; 95 147 Leaf.Image = pelaajanKuva; 96 AddCollisionHandler(Leaf, " tahti", TormaaTahteen);148 AddCollisionHandler(Leaf, "Box", TormaaTahteen); 97 149 AddCollisionHandler(Leaf, "pahis", TormaaVihuun); 150 AddCollisionHandler(Leaf, "piikki", TormaaPiikkiin); 98 151 Add(Leaf); 99 152 //pelaaja1 on PlatformCharacter-tyyppinen … … 101 154 102 155 //Ammusten määrä aluksi: 103 Leaf.Weapon.Ammo.Value = 100;156 Leaf.Weapon.Ammo.Value = ammustenMaara; 104 157 105 158 //Mitä tapahtuu kun ammus osuu johonkin? … … 110 163 { 111 164 ammus.Destroy(); 112 kohde.Destroy(); 165 if (kohde.Tag.Equals("pahis")) 166 { 167 kohde.Destroy(); 168 } 113 169 } 114 170 void AmmuAseella(PlatformCharacter pelaaja) 115 171 { 116 172 PhysicsObject ammus = pelaaja.Weapon.Shoot(); 117 173 ammusLaskuri.Value--; 118 174 if (ammus != null) 119 175 { … … 139 195 Keyboard.Listen(Key.D, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", Leaf, nopeus); 140 196 Keyboard.Listen(Key.W, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", Leaf, hyppyNopeus); 141 Keyboard.Listen(Key.Space, ButtonState. Down, AmmuAseella, "Ammu", Leaf);197 Keyboard.Listen(Key.Space, ButtonState.Pressed, AmmuAseella, "Ammu", Leaf); 142 198 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 143 199 … … 157 213 { 158 214 hahmo.Jump(nopeus); 159 } 160 161 void TormaaTahteen(PhysicsObject hahmo, PhysicsObject tahti) 215 hyppyAani.Play(); 216 } 217 218 void TormaaTahteen(PhysicsObject hahmo, PhysicsObject Box) 162 219 { 163 220 maaliAani.Play(); 164 MessageDisplay.Add("Keräsit tähden!");165 tahti.Destroy();221 MessageDisplay.Add("Keräsit Boxin!"); 222 Box.Destroy(); 166 223 } 167 224 void TormaaVihuun(PhysicsObject hahmo, PhysicsObject vihu) … … 171 228 hahmo.Destroy(); 172 229 } 230 void TormaaPiikkiin(PhysicsObject hahmo, PhysicsObject piikki) 231 { 232 maaliAani.Play(); 233 MessageDisplay.Add("You died"); 234 hahmo.Destroy(); 235 } 173 236 } -
2016/24/MattiK/ZlandZ/ZlandZ/ZlandZ/ZlandZ.csproj.Debug.cachefile
r7266 r7291 4 4 Content\kentta1.xnb 5 5 Content\vihu.xnb 6 Content\Lintu.xnb 7 Content\Piikki.xnb 8 Content\box.xnb 9 Content\boss.xnb 10 Content\Jump17.xnb 11 Content\gun.xnb -
2016/24/MattiK/ZlandZ/ZlandZ/ZlandZ/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml
r7266 r7291 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2016-06-1 3T13:49:30.515756+03:00</Time>38 <Time>2016-06-14T14:52:07.8748476+03:00</Time> 39 39 </Item> 40 40 <Item> … … 46 46 <Output>C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\vihu.xnb</Output> 47 47 <Time>2016-06-13T11:18:00.8268075+03:00</Time> 48 </Item> 49 <Item> 50 <Source>Lintu.png</Source> 51 <Name>Lintu</Name> 52 <Importer>TextureImporter</Importer> 53 <Processor>TextureProcessor</Processor> 54 <Options>None</Options> 55 <Output>C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\Lintu.xnb</Output> 56 <Time>2016-06-14T10:05:20.3102632+03:00</Time> 57 </Item> 58 <Item> 59 <Source>Piikki.png</Source> 60 <Name>Piikki</Name> 61 <Importer>TextureImporter</Importer> 62 <Processor>TextureProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\Piikki.xnb</Output> 65 <Time>2016-06-14T10:20:32.7855016+03:00</Time> 66 </Item> 67 <Item> 68 <Source>box.png</Source> 69 <Name>box</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\box.xnb</Output> 74 <Time>2016-06-14T12:22:30.0631562+03:00</Time> 75 </Item> 76 <Item> 77 <Source>boss.png</Source> 78 <Name>boss</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 <Options>None</Options> 82 <Output>C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\boss.xnb</Output> 83 <Time>2016-06-14T12:22:49.5281025+03:00</Time> 84 </Item> 85 <Item> 86 <Source>Jump17.wav</Source> 87 <Name>Jump17</Name> 88 <Importer>WavImporter</Importer> 89 <Processor>SoundEffectProcessor</Processor> 90 <Options>None</Options> 91 <Output>C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\Jump17.xnb</Output> 92 <Time>2016-06-14T14:08:40.018088+03:00</Time> 93 </Item> 94 <Item> 95 <Source>gun.png</Source> 96 <Name>gun</Name> 97 <Importer>TextureImporter</Importer> 98 <Processor>TextureProcessor</Processor> 99 <Options>None</Options> 100 <Output>C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\gun.xnb</Output> 101 <Time>2016-06-14T14:34:19.1299838+03:00</Time> 48 102 </Item> 49 103 <BuildSuccessful>true</BuildSuccessful> -
2016/24/MattiK/ZlandZ/ZlandZ/ZlandZ/obj/x86/Debug/ZlandZ.csproj.FileListAbsolute.txt
r7266 r7291 12 12 C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\obj\x86\Debug\ZlandZ.pdb 13 13 C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\vihu.xnb 14 C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\Lintu.xnb 15 C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\Piikki.xnb 16 C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\box.xnb 17 C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\boss.xnb 18 C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\Jump17.xnb 19 C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\gun.xnb -
2016/24/MattiK/ZlandZ/ZlandZ/ZlandZ/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt
r7266 r7291 4 4 Content\kentta1.xnb 5 5 Content\vihu.xnb 6 Content\Lintu.xnb 7 Content\Piikki.xnb 8 Content\box.xnb 9 Content\boss.xnb 10 Content\Jump17.xnb 11 Content\gun.xnb -
2016/24/MattiK/ZlandZ/ZlandZ/ZlandZContent/ZlandZContent.contentproj
r7266 r7291 74 74 </Compile> 75 75 </ItemGroup> 76 <ItemGroup> 77 <Compile Include="Lintu.png"> 78 <Name>Lintu</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 </Compile> 82 </ItemGroup> 83 <ItemGroup> 84 <Compile Include="Piikki.png"> 85 <Name>Piikki</Name> 86 <Importer>TextureImporter</Importer> 87 <Processor>TextureProcessor</Processor> 88 </Compile> 89 </ItemGroup> 90 <ItemGroup> 91 <Compile Include="box.png"> 92 <Name>box</Name> 93 <Importer>TextureImporter</Importer> 94 <Processor>TextureProcessor</Processor> 95 </Compile> 96 </ItemGroup> 97 <ItemGroup> 98 <Compile Include="boss.png"> 99 <Name>boss</Name> 100 <Importer>TextureImporter</Importer> 101 <Processor>TextureProcessor</Processor> 102 </Compile> 103 </ItemGroup> 104 <ItemGroup> 105 <Compile Include="Jump17.wav"> 106 <Name>Jump17</Name> 107 <Importer>WavImporter</Importer> 108 <Processor>SoundEffectProcessor</Processor> 109 </Compile> 110 </ItemGroup> 111 <ItemGroup> 112 <Compile Include="gun.png"> 113 <Name>gun</Name> 114 <Importer>TextureImporter</Importer> 115 <Processor>TextureProcessor</Processor> 116 </Compile> 117 </ItemGroup> 76 118 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 77 119 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2016/24/MattiK/ZlandZ/ZlandZ/ZlandZContent/kentta1.txt
r7266 r7291 1 * 2 ## 3 4 * * 5 ## ## 6 7 * * 8 ## ## ## 9 10 * * * * 11 ## ## ## ## S 12 # S S S S S S S SS SS S SS S S 13 * * * * S ####### ####################################### 14 ## ## ## ## ## ### 15 16 N PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 1 2 3 4 5 N 6 7 8 S S 9 ##### 10 S 11 #### 12 S 13 ### 14 S S bb S S S S S SS SS S SS S S S 15 S b S S S S S ####### ####################################### #### #### ### 16 #### #### ## ## ## ## ## ## # 17 18 G b b b PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 17 19 ################################################################################################################################################
Note: See TracChangeset
for help on using the changeset viewer.