Changeset 1215
- Timestamp:
- 2010-07-09 11:06:09 (11 years ago)
- Location:
- 2010/27/viaawipi/samsh cubes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/27/viaawipi/samsh cubes/Content/Content.contentproj
r1195 r1215 82 82 </Compile> 83 83 </ItemGroup> 84 <ItemGroup> 85 <Compile Include="sm26.mp3"> 86 <Name>sm26</Name> 87 <Importer>Mp3Importer</Importer> 88 <Processor>SongProcessor</Processor> 89 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 90 </Compile> 91 </ItemGroup> 92 <ItemGroup> 93 <Compile Include="jump.wav"> 94 <Name>jump</Name> 95 <Importer>WavImporter</Importer> 96 <Processor>SoundEffectProcessor</Processor> 97 </Compile> 98 </ItemGroup> 99 <ItemGroup> 100 <Compile Include="plzbmfire.wav"> 101 <Name>plzbmfire</Name> 102 <Importer>WavImporter</Importer> 103 <Processor>SoundEffectProcessor</Processor> 104 </Compile> 105 </ItemGroup> 106 <ItemGroup> 107 <Compile Include="icebfire.wav"> 108 <Name>icebfire</Name> 109 <Importer>WavImporter</Importer> 110 <Processor>SoundEffectProcessor</Processor> 111 </Compile> 112 </ItemGroup> 113 <ItemGroup> 114 <Compile Include="power beam.wav"> 115 <Name>power beam</Name> 116 <Importer>WavImporter</Importer> 117 <Processor>SoundEffectProcessor</Processor> 118 </Compile> 119 </ItemGroup> 84 120 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 85 121 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2010/27/viaawipi/samsh cubes/Peli.cs
r1195 r1215 27 27 protected override void Begin() 28 28 { 29 30 29 31 isku1 = new IntMeter(0); 30 32 isku2 = new IntMeter(0); … … 39 41 void seuraavaKentta() 40 42 { 43 41 44 ClearAll(); 45 MediaPlayer.Play("sm26"); 42 46 43 47 isku1 = new IntMeter(20); … … 77 81 78 82 Timer ajastin = new Timer(); 79 ajastin.Interval = 1 ;83 ajastin.Interval = 10; 80 84 ajastin.Trigger += HeitaKranaatti; 81 85 Add(ajastin); … … 121 125 Keyboard.Listen(Key.Right, ButtonState.Down, liikuta, "Liikkuu oikealle", pelaaja1, nopeus); 122 126 Keyboard.Listen(Key.Up, ButtonState.Pressed, hyppaa, "Hyppää", pelaaja1, hyppyVoima); 123 Keyboard.Listen(Key.Down, ButtonState.Pressed, iske1, " tiputa");127 Keyboard.Listen(Key.Down, ButtonState.Pressed, iske1, "hit"); 124 128 125 129 … … 129 133 Keyboard.Listen(Key.D, ButtonState.Down, liikuta, "Liikkuu oikealle", pelaaja2, nopeus); 130 134 Keyboard.Listen(Key.W, ButtonState.Pressed, hyppaa, "Hyppää", pelaaja2, hyppyVoima); 131 Keyboard.Listen(Key.S, ButtonState.Pressed, iske2, " tiputa");135 Keyboard.Listen(Key.S, ButtonState.Pressed, iske2, "hit"); 132 136 133 Keyboard.Listen(Key.Enter, ButtonState.Pressed, seuraavaKentta , "Hyppää"); 134 135 136 lisaaGamePadNappaimet(ControllerOne); 137 } 138 139 void lisaaGamePadNappaimet(GamePad controller) 140 { 141 controller.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 142 143 controller.Listen(Button.DPadLeft, ButtonState.Down, liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); 144 controller.Listen(Button.DPadRight, ButtonState.Down, liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 145 controller.Listen(Button.A, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", pelaaja1, hyppyVoima); 137 Keyboard.Listen(Key.Enter, ButtonState.Pressed, seuraavaKentta , "restart"); 146 138 } 147 139 … … 154 146 { 155 147 hahmo.Jump(voima); 148 PlaySound("power beam"); 149 150 156 151 } 157 152 … … 179 174 isku1.Value +=RandomGen.NextInt(1,10); 180 175 pelaaja2.Hit(new Vector(aba.X * isku1, aba.Y * isku1)); 176 PlaySound("plzbmfire"); 181 177 } 182 178 … … 190 186 isku2.Value += RandomGen.NextInt(1, 10); 191 187 pelaaja1.Hit(new Vector(aba.X * isku2, aba.Y * isku2)); 188 PlaySound("icebfire"); 192 189 } 193 190 … … 195 192 void HeitaKranaatti(Timer sender) 196 193 { 197 198 Explosion rajahdys = new Explosion(RandomGen.NextDouble(10,50)); 199 rajahdys.X = RandomGen.NextDouble(Level.Left, Level.Right); 200 rajahdys.Force = 500; 201 rajahdys.Y = RandomGen.NextDouble(Level.Left, Level.Right); 202 Add(rajahdys); 194 for (int i = 0; i < RandomGen.NextInt(1, 100); i++) 195 { 196 197 198 Grenade kranaatti = new Grenade(RandomGen.NextDouble(0.5,4)); 199 kranaatti.X = RandomGen.NextDouble(Level.Left, Level.Right); 200 kranaatti.Y = Level.Top - 10; 201 kranaatti.FuseTime = TimeSpan.FromSeconds(RandomGen.NextDouble(0,3.0)); 202 kranaatti.ExplosionForce = 2500; 203 kranaatti.ExplosionRadius = 50; 204 kranaatti.ExplosionSpeed = 100; 205 206 Add(kranaatti); 207 Vector heittoVoima = Vector.FromLengthAndAngle(RandomGen.NextDouble(5000, 10000), Angle.Degrees(RandomGen.NextDouble(180, 360))); 208 kranaatti.Hit(heittoVoima); 209 } 210 203 211 204 212 } -
2010/27/viaawipi/samsh cubes/kennta.txt
r1199 r1215 3 3 4 4 5 # # 6 # # 7 # # # 5 ### 6 # # 8 7 9 ## # ## 10 ### 11 ## ##### ## 8 ####### 9 10 ## ######### ## 11 #####
Note: See TracChangeset
for help on using the changeset viewer.