- Timestamp:
- 2013-07-04 14:57:27 (10 years ago)
- Location:
- 2013/27/LeoL/Hounted Hause/Hounted Hause
- Files:
-
- 12 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2013/27/LeoL/Hounted Hause/Hounted Hause/Hounted Hause/Hounted_Hause.cs
r4397 r4433 12 12 Image avainKuva = LoadImage("Avain"); 13 13 Image örkkiKuva = LoadImage("Ghost"); 14 Color tasoväri; 14 15 15 16 PhysicsObject pelaaja; … … 17 18 //Pelin alussa ollaan kentässä 1 18 19 int kenttaNro = 1; 20 21 int avaimet = 0; 19 22 20 23 … … 27 30 public override void Begin() 28 31 { 29 SeuraavaKentta(); 30 31 32 MediaPlayer.Play("aloitusmusa"); 33 34 Level.Size = Screen.Size; 35 Level.Background.Image = LoadImage("tausta"); 36 Level.Background.FitToLevel(); 37 MultiSelectWindow alkuValikko = new MultiSelectWindow("Pelin alkuvalikko", 38 "Aloita peli", "Lopeta"); 39 Add(alkuValikko); 40 alkuValikko.AddItemHandler(0, SeuraavaKentta); 41 alkuValikko.AddItemHandler(1, Exit); 32 42 } 33 43 void SeuraavaKentta() … … 35 45 ClearAll(); 36 46 37 if (kenttaNro == 1) LuoKentta("kentta1"); 38 else if (kenttaNro == 2) LuoKentta("kentta2"); 39 else if (kenttaNro == 3) LuoKentta("kentta3"); 40 else if (kenttaNro == 4) LuoKentta("kentta4"); 41 else if (kenttaNro > 4) Exit(); 47 avaimet = 0; 42 48 MediaPlayer.Play("taustamusiikki"); 43 49 50 if (kenttaNro == 1) 51 { 52 tasoväri = Color.Green; 53 LuoKentta("kentta1"); 54 } 55 else if (kenttaNro == 2) 56 { 57 tasoväri = Color.Yellow; 58 LuoKentta("kentta2"); 59 } 60 else if (kenttaNro == 3) 61 { 62 tasoväri = Color.Red; 63 LuoKentta("kentta3"); 64 } 65 else if (kenttaNro == 4) 66 { 67 tasoväri = Color.Blue; 68 LuoKentta("kentta4"); 69 } 70 else if (kenttaNro == 5) 71 { 72 tasoväri = Color.Orange; 73 LuoKentta("kentta5"); 74 } 75 else if (kenttaNro == 6) 76 { 77 tasoväri = Color.Snow; 78 LuoKentta("kentta6"); 79 80 } 81 else if (kenttaNro == 7) 82 { 83 tasoväri = Color.Pink; 84 LuoKentta("kentta7"); 85 } 86 else if (kenttaNro == 8) 87 { 88 tasoväri = Color.Violet; 89 LuoKentta("kentta8"); 90 } 91 else if (kenttaNro == 9) 92 { 93 tasoväri = Color.Aqua; 94 LuoKentta("kentta9"); 95 } 96 else if (kenttaNro == 10) 97 { 98 tasoväri = Color.Brown; 99 LuoKentta("kentta10"); 100 } 101 else if (kenttaNro == 11) 102 { 103 tasoväri = Color.DarkGray; 104 LuoKentta("kentta11"); 105 } 106 else if (kenttaNro == 12) 107 { 108 tasoväri = Color.BloodRed; 109 LuoKentta("kentta12"); 110 } 111 else if (kenttaNro > 12) 112 { 113 114 kenttaNro = 1; 115 MediaPlayer.Stop(); DoNextUpdate(Begin); 116 return; 117 } 118 119 44 120 Camera.Follow(pelaaja); 45 Camera.ZoomFactor = 9.0;121 Camera.ZoomFactor = 1.0; 46 122 Camera.StayInLevel = true; 47 123 … … 51 127 ControllerOne.Listen(Button.DPadDown, ButtonState.Down, LiikutaPelaajaa, null, new Vector(0, -100), pelaaja); 52 128 53 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 54 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 55 } 129 PhoneBackButton.Listen(PauseValikko, "Lopeta peli"); 130 Keyboard.Listen(Key.Escape, ButtonState.Pressed, PauseValikko, "Lopeta peli"); 131 } 132 133 void PauseValikko() 134 { 135 IsPaused = true; 136 137 MultiSelectWindow pauseValikko = new MultiSelectWindow("Pause", 138 "Jatka", "Lopeta"); 139 Add(pauseValikko); 140 pauseValikko.AddItemHandler(0, JatkaPelia); 141 pauseValikko.AddItemHandler(1, MeneValikkoon); 142 } 143 144 void JatkaPelia() 145 { 146 IsPaused = false; 147 } 148 149 void MeneValikkoon() 150 { 151 IsPaused = false; 152 ClearAll(); 153 DoNextUpdate(Begin); 154 } 155 56 156 void LiikutaPelaajaa(Vector vektori, PhysicsObject pelaaja) 57 157 { … … 87 187 pelaaja.KineticFriction = 0.0; 88 188 AddCollisionHandler(pelaaja, "avain", TormaaAvaimeen); 189 AddCollisionHandler(pelaaja, "orkki", TormaaOrkkiin); 89 190 Add(pelaaja); 90 191 } … … 92 193 void LuoÖrkki(Vector paikka, double leveys, double korkeus) 93 194 { 94 PhysicsObject orkki = new PhysicsObject(30, 30);195 PhysicsObject orkki = new PhysicsObject(30, 30); 95 196 orkki.Shape = Shape.Rectangle; 96 197 orkki.Image = örkkiKuva; … … 99 200 orkki.Restitution = 0.0; 100 201 orkki.KineticFriction = 0.0; 202 orkki.Tag = "orkki"; 101 203 //orkki.CollisionIgnoreGroup = 1; 102 204 orkki.IgnoresCollisionResponse = true; 103 205 //AddCollisionHandler(orkki, "pelaaja", Tormaaorkkiin); 104 206 AddCollisionHandler(orkki, "taso", TormaaSeinaan); 105 207 Add(orkki); 106 208 //SatunnainenSuunta(orkki); 107 209 108 FollowerBrain aivot = new FollowerBrain( "pelaaja");210 FollowerBrain aivot = new FollowerBrain("pelaaja"); 109 211 orkki.Brain = aivot; 110 212 aivot.Speed = 50.50; … … 139 241 orkki.Acceleration = Vector.Zero; 140 242 orkki.Velocity = nopeus; 141 243 142 244 143 245 } … … 151 253 { 152 254 avain.Destroy(); 153 255 avaimet++; 256 257 if (avaimet == 3) 258 { 259 kenttaNro++; 260 SeuraavaKentta(); 261 } 154 262 } 155 263 … … 159 267 taso.Position = paikka; 160 268 Level.BackgroundColor = Color.Black; 161 taso.Color = new Color(15,3,11); 269 //taso.Color = new Color(15,3,11); 270 taso.Color = tasoväri; 162 271 taso.CollisionIgnoreGroup = 1; 163 272 taso.Restitution = 0.0; … … 184 293 pisteNaytto.X = Screen.Left + 100; 185 294 pisteNaytto.Y = Screen.Top - 100; 186 pisteNaytto.TextColor = Color. Red;187 pisteNaytto.Color = Color. Black;295 pisteNaytto.TextColor = Color.Violet; 296 pisteNaytto.Color = Color.Red; 188 297 189 298 pisteNaytto.BindTo(pisteLaskuri); 190 299 Add(pisteNaytto); 191 300 } 192 301 void TormaaOrkkiin(PhysicsObject tormaaja, PhysicsObject kohde) 302 { 303 SeuraavaKentta(); 304 } 193 305 } -
2013/27/LeoL/Hounted Hause/Hounted Hause/Hounted HauseContent/Hounted HauseContent.contentproj
r4397 r4433 74 74 </ItemGroup> 75 75 <ItemGroup> 76 <Compile Include=" taustamusiikki.mp3">77 <Name> taustamusiikki</Name>76 <Compile Include="musiikki.mp3"> 77 <Name>musiikki</Name> 78 78 <Importer>Mp3Importer</Importer> 79 79 <Processor>SongProcessor</Processor> … … 101 101 </Compile> 102 102 </ItemGroup> 103 <ItemGroup> 104 <Compile Include="taso 3 .mp3"> 105 <Name>taso 3</Name> 106 <Importer>Mp3Importer</Importer> 107 <Processor>SongProcessor</Processor> 108 </Compile> 109 </ItemGroup> 110 <ItemGroup> 111 <Compile Include="taustamusiikki.mp3"> 112 <Name>taustamusiikki</Name> 113 <Importer>Mp3Importer</Importer> 114 <Processor>SongProcessor</Processor> 115 </Compile> 116 </ItemGroup> 117 <ItemGroup> 118 <Compile Include="kentta5.png"> 119 <Name>kentta5</Name> 120 <Importer>TextureImporter</Importer> 121 <Processor>TextureProcessor</Processor> 122 </Compile> 123 </ItemGroup> 124 <ItemGroup> 125 <Compile Include="kentta6.png"> 126 <Name>kentta6</Name> 127 <Importer>TextureImporter</Importer> 128 <Processor>TextureProcessor</Processor> 129 </Compile> 130 </ItemGroup> 131 <ItemGroup> 132 <Compile Include="kentta7.png"> 133 <Name>kentta7</Name> 134 <Importer>TextureImporter</Importer> 135 <Processor>TextureProcessor</Processor> 136 </Compile> 137 </ItemGroup> 138 <ItemGroup> 139 <Compile Include="kentta8.png"> 140 <Name>kentta8</Name> 141 <Importer>TextureImporter</Importer> 142 <Processor>TextureProcessor</Processor> 143 </Compile> 144 </ItemGroup> 145 <ItemGroup> 146 <Compile Include="tausta.png"> 147 <Name>tausta</Name> 148 <Importer>TextureImporter</Importer> 149 <Processor>TextureProcessor</Processor> 150 </Compile> 151 </ItemGroup> 152 <ItemGroup> 153 <Compile Include="kentta9.png"> 154 <Name>kentta9</Name> 155 <Importer>TextureImporter</Importer> 156 <Processor>TextureProcessor</Processor> 157 </Compile> 158 </ItemGroup> 159 <ItemGroup> 160 <Compile Include="kentta10.png"> 161 <Name>kentta10</Name> 162 <Importer>TextureImporter</Importer> 163 <Processor>TextureProcessor</Processor> 164 </Compile> 165 </ItemGroup> 166 <ItemGroup> 167 <Compile Include="kentta11.png"> 168 <Name>kentta11</Name> 169 <Importer>TextureImporter</Importer> 170 <Processor>TextureProcessor</Processor> 171 </Compile> 172 </ItemGroup> 173 <ItemGroup> 174 <Compile Include="kentta12.png"> 175 <Name>kentta12</Name> 176 <Importer>TextureImporter</Importer> 177 <Processor>TextureProcessor</Processor> 178 </Compile> 179 </ItemGroup> 180 <ItemGroup> 181 <Compile Include="aloitusmusa.mp3"> 182 <Name>aloitusmusa</Name> 183 <Importer>Mp3Importer</Importer> 184 <Processor>SongProcessor</Processor> 185 </Compile> 186 </ItemGroup> 103 187 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 104 188 <!-- 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.