- Timestamp:
- 2012-07-05 14:51:25 (11 years ago)
- Location:
- 2012/27/JesseK
- Files:
-
- 65 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/27/JesseK/omapeli/omapeli/omapeli/omapeli.cs
r3550 r3600 21 21 PlatformCharacter ukko; 22 22 // PhysicsObject taso; 23 SoundEffect hyppyAani = LoadSoundEffect("smb_jumpsmall1"); 24 SoundEffect kolikkoAani = LoadSoundEffect("smb_coin1"); 25 SoundEffect huutoAani = LoadSoundEffect("scream"); 26 23 27 public override void Begin() 24 28 { 25 29 idleVasen = Image.Mirror(idleOikea); 26 27 30 LuoKentta(); 28 31 LuoPelaaja(); … … 31 34 Gravity = new Vector(0, -1100); 32 35 33 Camera.ZoomFactor = 1.3; 36 MediaPlayer.Play("taustamusa"); 37 MediaPlayer.Volume = 0.2; 38 MediaPlayer.IsRepeating = true; 39 40 41 Camera.ZoomFactor = 1; 34 42 Camera.Follow(ukko); 35 43 AddCollisionHandler<PlatformCharacter, PhysicsObject>(ukko, KolikkoKeratty); 36 44 AddCollisionHandler<PlatformCharacter, PhysicsObject>(ukko, SieniOsuma); 37 45 } 38 46 39 47 void LuoPelaaja() 40 48 { … … 69 77 koro1.Shape = Shape.Rectangle; 70 78 Add(koro1); 79 71 80 // Myrkkysienen tekeminen -- Myrkkysienen koko: 25 x 25 72 81 LuoMyrkkysieni(-150.0, Level.Bottom + 12.5); … … 75 84 LuoMyrkkysieni(0.0, Level.Bottom + 12.5); 76 85 LuoMyrkkysieni(100.0, Level.Bottom + 112.0); 86 LuoMyrkkysieni(Level.Right - 631.5, Level.Bottom + 325.0); 87 LuoMyrkkysieni(Level.Right - 590, Level.Bottom + 285.0); 88 LuoMyrkkysieni(Level.Right - 440, Level.Bottom + 555.0); 89 LuoMyrkkysieni(Level.Right - 380, Level.Bottom + 555.0); 90 LuoMyrkkysieni(Level.Right - 320, Level.Bottom + 555.0); 77 91 // Tasojen tekeminen -- Tason koko: 23 x 9 78 92 LuoTaso(-150, Level.Bottom + 40.0); … … 93 107 LuoLiikkuvaTaso(Level.Right - 530, Level.Bottom + 310.0); 94 108 LuoTaso(Level.Right - 560, Level.Bottom + 310.0); 109 LuoTaso(Level.Right - 590, Level.Bottom + 270.0); 110 LuoTaso(Level.Right - 620, Level.Bottom + 310.0); 111 LuoTaso(Level.Right - 643, Level.Bottom + 310.0); 112 LuoTaso(Level.Right - 666, Level.Bottom + 310.0); 113 LuoTaso(Level.Right - 660, Level.Bottom + 240.0); 114 LuoTaso(Level.Right - 608.5, Level.Bottom + 200.0); 115 LuoTaso(Level.Right - 690, Level.Bottom + 270.0); 116 LuoTaso(Level.Right - 750, Level.Bottom + 270.0); 117 LuoTaso(Level.Right - 820, Level.Bottom + 300.0); 118 LuoTaso(Level.Right - 860, Level.Bottom + 330.0); 119 LuoTaso(Level.Right - 883, Level.Bottom + 330.0); 120 LuoTaso(Level.Right - 906, Level.Bottom + 330.0); 121 LuoTaso(Level.Right - 929, Level.Bottom + 330.0); 122 LuoTaso(Level.Right - 952, Level.Bottom + 330.0); 123 LuoTaso(Level.Right - 975, Level.Bottom + 330.0); 124 LuoTaso(Level.Right - 975, Level.Bottom + 390.0); 125 LuoTaso(Level.Right - 952, Level.Bottom + 450.0); 126 LuoTaso(Level.Right - 975, Level.Bottom + 510.0); 127 LuoTaso(Level.Right - 900, Level.Bottom + 550.0); 128 LuoTaso(Level.Right - 850, Level.Bottom + 550.0); 129 LuoTaso(Level.Right - 827, Level.Bottom + 541.0); 130 LuoTaso(Level.Right - 804, Level.Bottom + 532.0); 131 LuoTaso(Level.Right - 782, Level.Bottom + 523.0); 132 LuoTaso(Level.Right - 700, Level.Bottom + 523.0); 133 LuoTaso(Level.Right - 620, Level.Bottom + 523.0); 134 LuoTaso(Level.Right - 550, Level.Bottom + 523.0); 135 LuoTaso(Level.Right - 470, Level.Bottom + 540.0); 136 LuoTaso(Level.Right - 440, Level.Bottom + 540.0); 137 LuoTaso(Level.Right - 410, Level.Bottom + 540.0); 138 LuoTaso(Level.Right - 380, Level.Bottom + 540.0); 139 LuoTaso(Level.Right - 350, Level.Bottom + 540.0); 140 LuoTaso(Level.Right - 320, Level.Bottom + 540.0); 141 LuoTaso(Level.Right - 290, Level.Bottom + 540.0); 142 LuoTaso(Level.Right - 260, Level.Bottom + 540.0); 143 LuoTaso(Level.Right - 237, Level.Bottom + 549.0); 144 LuoTaso(Level.Right - 214, Level.Bottom + 558.0); 145 LuoTaso(Level.Right - 191, Level.Bottom + 567.0); 146 LuoTaso(Level.Right - 168, Level.Bottom + 576.0); 147 LuoTaso(Level.Right - 145, Level.Bottom + 576.0); 148 LuoTaso(Level.Right - 122, Level.Bottom + 576.0); 149 LuoTaso(Level.Right - 99, Level.Bottom + 576.0); 150 LuoTaso(Level.Right - 76, Level.Bottom + 576.0); 151 LuoTaso(Level.Right - 53, Level.Bottom + 576.0); 152 LuoTaso(Level.Right - 30, Level.Bottom + 576.0); 153 LuoTaso(Level.Right - 7, Level.Bottom + 576.0); 95 154 // Kolikon tekeminen -- Kolikon koko: 12 x 12 96 155 LuoKolikko(-150.0, Level.Bottom + 53.0, "kolikko"); … … 102 161 LuoKolikko(Level.Right - 219.0, Level.Bottom + 232.5, "kolikko"); 103 162 LuoKolikko(Level.Right - 262.0, Level.Bottom + 282.5, "kolikko"); 163 LuoKolikko(Level.Right - 560.0, Level.Bottom + 322.0, "kolikko"); 164 LuoKolikko(Level.Right - 666.0, Level.Bottom + 322.0, "kolikko"); 165 LuoKolikko(Level.Right - 608.0, Level.Bottom + 212.0, "kolikko"); 166 LuoKolikko(Level.Right - 975, Level.Bottom + 402.0, "kolikko"); 167 LuoKolikko(Level.Right - 952, Level.Bottom + 462.0, "kolikko"); 168 104 169 Level.CreateBorders(); 105 170 106 107 171 PhysicsObject kyltti = PhysicsObject.CreateStaticObject(100, 50); 108 172 kyltti.X = -350; … … 111 175 kyltti.Image = LoadImage("hqinfo"); 112 176 kyltti.CollisionIgnoreGroup = 1; 113 Add(kyltti );177 Add(kyltti, -1); 114 178 } 115 179 … … 143 207 pistelaskuri.Value += 1; 144 208 kohde.Destroy(); 209 kolikkoAani.Play(); 145 210 } 146 211 } … … 152 217 ukko.X = -500; 153 218 ukko.Y = Level.Bottom; 219 huutoAani.Play(); 154 220 } 155 221 } … … 164 230 Label pisteNaytto = new Label(); 165 231 pisteNaytto.Title = "Kolikot"; 166 pisteNaytto.X = Screen. Left +100;232 pisteNaytto.X = Screen.Right - 100; 167 233 pisteNaytto.Y = Screen.Top - 100; 168 234 pisteNaytto.TextColor = Color.Black; … … 180 246 { 181 247 ukko.Jump(hyppy); 248 hyppyAani.Play(); 182 249 } 183 250 … … 189 256 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 190 257 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 258 Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 191 259 } 192 260 -
2012/27/JesseK/omapeli/omapeli/omapeliContent/omapeliContent.contentproj
r3550 r3600 112 112 </Compile> 113 113 </ItemGroup> 114 <ItemGroup> 115 <Compile Include="taustaloop.mp3"> 116 <Name>taustaloop</Name> 117 <Importer>Mp3Importer</Importer> 118 <Processor>SongProcessor</Processor> 119 </Compile> 120 </ItemGroup> 121 <ItemGroup> 122 <Compile Include="orchestral swing.mp3"> 123 <Name>orchestral swing</Name> 124 <Importer>Mp3Importer</Importer> 125 <Processor>SongProcessor</Processor> 126 </Compile> 127 </ItemGroup> 128 <ItemGroup> 129 <Compile Include="huuto.mp3"> 130 <Name>huuto</Name> 131 <Importer>Mp3Importer</Importer> 132 <Processor>SongProcessor</Processor> 133 </Compile> 134 </ItemGroup> 135 <ItemGroup> 136 <Compile Include="taustamusa.mp3"> 137 <Name>taustamusa</Name> 138 <Importer>Mp3Importer</Importer> 139 <Processor>SongProcessor</Processor> 140 </Compile> 141 </ItemGroup> 142 <ItemGroup> 143 <Compile Include="smb_coin1.wav"> 144 <Name>smb_coin1</Name> 145 <Importer>WavImporter</Importer> 146 <Processor>SoundEffectProcessor</Processor> 147 </Compile> 148 <Compile Include="smb_jumpsmall1.wav"> 149 <Name>smb_jumpsmall1</Name> 150 <Importer>WavImporter</Importer> 151 <Processor>SoundEffectProcessor</Processor> 152 </Compile> 153 </ItemGroup> 154 <ItemGroup> 155 <Compile Include="scream.wav"> 156 <Name>scream</Name> 157 <Importer>WavImporter</Importer> 158 <Processor>SoundEffectProcessor</Processor> 159 </Compile> 160 </ItemGroup> 114 161 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 115 162 <!-- 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.