Changeset 6266 for 2015/26/SanteriP
- Timestamp:
- 2015-06-24 14:58:27 (8 years ago)
- Location:
- 2015/26/SanteriP/gunmayhem
- Files:
-
- 3 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/26/SanteriP/gunmayhem/gunmayhem/gunmayhem/gunmayhem.cs
r6239 r6266 10 10 { 11 11 const double nopeus = 200; 12 const double hyppyNopeus = 750;12 const double hyppyNopeus = 800; 13 13 const int RUUDUN_KOKO = 40; 14 14 … … 27 27 Image ruohokuva = LoadImage("ruoho"); 28 28 Image pommikuva = LoadImage("pommi"); 29 Image pilvikuva = LoadImage("pilvi"); 29 30 SoundEffect maaliAani = LoadSoundEffect("maali"); 30 31 … … 40 41 pisteLaskuri2 = LuoPistelaskuri(Screen.Left + 100); 41 42 42 Camera.Follow(pelaaja1 );43 Camera.Follow(pelaaja1,pelaaja2); 43 44 Camera.ZoomFactor = 1.2; 44 45 Camera.StayInLevel = true; … … 71 72 kentta.SetTileMethod('%', LisaaPommi); 72 73 kentta.SetTileMethod('"', Lisaapohja); 74 kentta.SetTileMethod('/', lisaapilvi); 73 75 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 74 76 Level.CreateBorders(); … … 82 84 taso.Image = ruohokuva; 83 85 Add(taso); 86 } 87 88 void lisaapilvi(Vector paikka, double leveys, double korkeus) 89 { 90 PhysicsObject pilvi = PhysicsObject.CreateStaticObject(leveys*4, korkeus); 91 pilvi.Position = paikka; 92 pilvi.Image = pilvikuva; 93 Add(pilvi); 84 94 } 85 95 … … 110 120 tahti.Tag = "tahti"; 111 121 Add(tahti); 122 } 123 void Tiputapommi(PlatformCharacter kuka) 124 { 125 PhysicsObject pommi = new PhysicsObject(LoadImage("pommi")); 126 pommi.Position = kuka.Position; 127 Add(pommi); 128 129 Timer ajastin = new Timer(); 130 ajastin.Interval = 2.0; 131 ajastin.Timeout += delegate 132 { 133 Explosion räjähdys = new Explosion(10); 134 räjähdys.Force = 5000; 135 räjähdys.Speed = 4000; 136 räjähdys.Position = pommi.Position; 137 Add(räjähdys); 138 139 pommi.Destroy(); 140 }; 141 ajastin.Start(1); 112 142 } 113 143 … … 171 201 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 172 202 173 Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja 1, -nopeus);174 Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja 1, nopeus);175 Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja 1, hyppyNopeus);176 Keyboard.Listen(Key.Enter, ButtonState.Down, AmmuAseella, "Ammu", pelaaja 1);177 178 179 Keyboard.Listen(Key.A, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja 2, -nopeus);180 Keyboard.Listen(Key.D, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja 2, nopeus);181 Keyboard.Listen(Key.W, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja 2, hyppyNopeus);182 Keyboard.Listen(Key.R, ButtonState.Down, AmmuAseella, "Ammu", pelaaja 2);183 203 Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja2, -nopeus); 204 Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja2, nopeus); 205 Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja2, hyppyNopeus); 206 Keyboard.Listen(Key.Enter, ButtonState.Down, AmmuAseella, "Ammu", pelaaja2); 207 Keyboard.Listen(Key.Down, ButtonState.Pressed, Tiputapommi, "Tiputa pommi", pelaaja2); 208 209 Keyboard.Listen(Key.A, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 210 Keyboard.Listen(Key.D, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 211 Keyboard.Listen(Key.W, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 212 Keyboard.Listen(Key.R, ButtonState.Down, AmmuAseella, "Ammu", pelaaja1); 213 Keyboard.Listen(Key.S, ButtonState.Pressed, Tiputapommi, "Tiputa pommi", pelaaja1); 184 214 185 215 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); … … 211 241 void Tormaapommiin(PhysicsObject hahmo, PhysicsObject pommi) 212 242 { 213 Explosion räjähdys = new Explosion(2 00);243 Explosion räjähdys = new Explosion(250); 214 244 räjähdys.Position = pommi.Position + new Vector(0, 10); 215 245 Add(räjähdys); … … 227 257 if (hahmo == pelaaja2) 228 258 { 229 pisteLaskuri1 .Value += 1;259 pisteLaskuri1 .Value += 1; 230 260 } 231 261 } -
2015/26/SanteriP/gunmayhem/gunmayhem/gunmayhem/gunmayhem.csproj.Debug.cachefile
r6239 r6266 8 8 Content\pelaaja2.xnb 9 9 Content\ase.xnb 10 Content\pilvi.xnb -
2015/26/SanteriP/gunmayhem/gunmayhem/gunmayhem/obj/x86/Debug/ContentPipeline-{B5D35D2A-3E3E-40F5-A3F8-C04AAA7ACEBD}.xml
r6239 r6266 54 54 <Options>None</Options> 55 55 <Output>C:\MyTemp\SanteriP\gunmayhem\gunmayhem\gunmayhem\bin\x86\Debug\Content\kentta1.xnb</Output> 56 <Time>2015-06-24T1 1:44:06.7247146+03:00</Time>56 <Time>2015-06-24T14:37:18.4439146+03:00</Time> 57 57 </Item> 58 58 <Item> … … 82 82 <Output>C:\MyTemp\SanteriP\gunmayhem\gunmayhem\gunmayhem\bin\x86\Debug\Content\ase.xnb</Output> 83 83 <Time>2015-06-24T11:33:31.5597146+03:00</Time> 84 </Item> 85 <Item> 86 <Source>pilvi.png</Source> 87 <Name>pilvi</Name> 88 <Importer>TextureImporter</Importer> 89 <Processor>TextureProcessor</Processor> 90 <Options>None</Options> 91 <Output>C:\MyTemp\SanteriP\gunmayhem\gunmayhem\gunmayhem\bin\x86\Debug\Content\pilvi.xnb</Output> 92 <Time>2015-06-24T13:08:48.5621146+03:00</Time> 84 93 </Item> 85 94 <BuildSuccessful>true</BuildSuccessful> -
2015/26/SanteriP/gunmayhem/gunmayhem/gunmayhem/obj/x86/Debug/cachefile-{B5D35D2A-3E3E-40F5-A3F8-C04AAA7ACEBD}-targetpath.txt
r6239 r6266 8 8 Content\pelaaja2.xnb 9 9 Content\ase.xnb 10 Content\pilvi.xnb -
2015/26/SanteriP/gunmayhem/gunmayhem/gunmayhem/obj/x86/Debug/gunmayhem.csproj.FileListAbsolute.txt
r6239 r6266 16 16 C:\MyTemp\SanteriP\gunmayhem\gunmayhem\gunmayhem\bin\x86\Debug\Content\pelaaja2.xnb 17 17 C:\MyTemp\SanteriP\gunmayhem\gunmayhem\gunmayhem\bin\x86\Debug\Content\ase.xnb 18 C:\MyTemp\SanteriP\gunmayhem\gunmayhem\gunmayhem\bin\x86\Debug\Content\pilvi.xnb -
2015/26/SanteriP/gunmayhem/gunmayhem/gunmayhemContent/gunmayhemContent.contentproj
r6239 r6266 102 102 </Compile> 103 103 </ItemGroup> 104 <ItemGroup> 105 <Compile Include="pilvi.png"> 106 <Name>pilvi</Name> 107 <Importer>TextureImporter</Importer> 108 <Processor>TextureProcessor</Processor> 109 </Compile> 110 </ItemGroup> 104 111 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 105 112 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2015/26/SanteriP/gunmayhem/gunmayhem/gunmayhemContent/kentta1.txt
r6239 r6266 1 1 2 2 3 4 5 6 / / / / 7 8 9 / / / 10 11 12 ### ### 13 14 ######............................###### 15 16 ##########%## ##%########## 17 18 E N 19 #########% %######### 3 20 4 21 5 6 7 ## ## ## 8 9 #### #### 10 ## 11 12 #### ####### 22 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 13 23 14 24 15 16 ###%## ##%######17 18 E N19 ########% %#########20 21 22 """""""""""""""""""""""""""""""""23 24
Note: See TracChangeset
for help on using the changeset viewer.