- Timestamp:
- 2010-07-09 13:07:46 (13 years ago)
- Location:
- 2010/27/Vekakart/Catch The Rainbow/Catch The Rainbow
- Files:
-
- 8 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/27/Vekakart/Catch The Rainbow/Catch The Rainbow/Content/Content.contentproj
r1217 r1238 62 62 </Compile> 63 63 </ItemGroup> 64 <ItemGroup> 65 <Compile Include="Chandler1.png"> 66 <Name>Chandler1</Name> 67 <Importer>TextureImporter</Importer> 68 <Processor>TextureProcessor</Processor> 69 </Compile> 70 </ItemGroup> 71 <ItemGroup> 72 <Compile Include="Chandler2.png"> 73 <Name>Chandler2</Name> 74 <Importer>TextureImporter</Importer> 75 <Processor>TextureProcessor</Processor> 76 </Compile> 77 </ItemGroup> 78 <ItemGroup> 79 <Compile Include="Oh yesh.wav"> 80 <Name>Oh yesh</Name> 81 <Importer>WavImporter</Importer> 82 <Processor>SoundEffectProcessor</Processor> 83 </Compile> 84 </ItemGroup> 85 <ItemGroup> 86 <Compile Include="Wanna c a rainbow.wav"> 87 <Name>Wanna c a rainbow</Name> 88 <Importer>WavImporter</Importer> 89 <Processor>SoundEffectProcessor</Processor> 90 </Compile> 91 </ItemGroup> 64 92 </Project> -
2010/27/Vekakart/Catch The Rainbow/Catch The Rainbow/Peli.cs
r1217 r1238 17 17 PlatformCharacter Max; 18 18 19 SoundEffect OhYes; 20 SoundEffect WCAR; 21 22 int Rainbowlaskuri = 5; 23 19 24 protected override void Begin() 20 25 { 21 26 ClearAll(); 27 OhYes = LoadSoundEffect("Oh yesh"); 28 WCAR = LoadSoundEffect("Wanna c a rainbow"); 22 29 //LuoMax(); 23 30 AsetaOhjaimet(); … … 50 57 PhysicsObject Rainbow = PhysicsObject.CreateStaticObject(25, 25); 51 58 Rainbow.Image = Image.FromFile("Rainbow.png"); 59 AddCollisionHandler(Rainbow, KasitteleRainbowTormays); 52 60 return Rainbow; 53 61 } … … 150 158 PhysicsObject LuoChandler() 151 159 { 152 Chandler = new PhysicsObject(20, 45); 153 //Chandler.Image = LoadImage ("Chandler1") 160 Chandler = PhysicsObject.CreateStaticObject(20, 45); 161 Chandler.Image = LoadImage ("Chandler1"); 162 Image[] chandlerinani = LoadImages("Chandler1", "Chandler2"); 163 Chandler.Animation = new Animation(chandlerinani); 164 Chandler.Animation.FPS = 2; 165 Chandler.Animation.Start(); 166 167 Timer ajastin = new Timer(); 168 ajastin.Tag = Chandler; 169 ajastin.Interval = 2.0; 170 ajastin.Trigger += Aani; 171 Add(ajastin); 172 ajastin.Start(); 154 173 return Chandler; 155 174 } … … 179 198 voiheittaa = true; 180 199 } 200 void KasitteleRainbowTormays(PhysicsObject Rainbow, PhysicsObject kohde) 201 { 202 if (kohde.Tag.ToString() == "Max") 203 { 204 Remove(Rainbow); 205 Rainbowlaskuri--; 206 207 OhYes.Play(); 208 if (Rainbowlaskuri == 0) 209 { 210 Begin(); 211 } 212 } 213 214 } 215 void Aani(Timer sender) 216 { 217 PhysicsObject bing = (PhysicsObject)sender.Tag; 218 double etaisyys = bing.X - Max.X; 219 if (etaisyys < 0) 220 { 221 etaisyys = etaisyys * -1; 222 } 223 if (etaisyys < 200) 224 { 225 WCAR.Play(); 226 } 227 } 181 228 }
Note: See TracChangeset
for help on using the changeset viewer.