- Timestamp:
- 2010-07-09 13:07:27 (13 years ago)
- Location:
- 2010/27/juoshako/Br3ak 1t
- Files:
-
- 8 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/27/juoshako/Br3ak 1t/Content/Content.contentproj
r1149 r1235 1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> 2 2 <PropertyGroup> 3 3 <ProjectGuid>c3e53c07-d49e-4b6c-8534-dcfc9ec3c7d4</ProjectGuid> … … 34 34 <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d" /> 35 35 </ItemGroup> 36 <ItemGroup> 37 <Compile Include="Palikka.png"> 38 <Name>Palikka</Name> 39 <Importer>TextureImporter</Importer> 40 <Processor>TextureProcessor</Processor> 41 </Compile> 42 </ItemGroup> 43 <ItemGroup> 44 <Compile Include="Laatta.png"> 45 <Name>Laatta</Name> 46 <Importer>TextureImporter</Importer> 47 <Processor>TextureProcessor</Processor> 48 </Compile> 49 </ItemGroup> 50 <ItemGroup> 51 <Compile Include="Laatta %28vastavärit%29.png"> 52 <Name>Laatta %28vastavärit%29</Name> 53 <Importer>TextureImporter</Importer> 54 <Processor>TextureProcessor</Processor> 55 </Compile> 56 </ItemGroup> 57 <ItemGroup> 58 <Compile Include="n49_chandra_big.jpg"> 59 <Name>n49_chandra_big</Name> 60 <Importer>TextureImporter</Importer> 61 <Processor>TextureProcessor</Processor> 62 </Compile> 63 </ItemGroup> 64 <ItemGroup> 65 <Compile Include="button-3.wav"> 66 <Name>button-3</Name> 67 <Importer>WavImporter</Importer> 68 <Processor>SoundEffectProcessor</Processor> 69 </Compile> 70 </ItemGroup> 71 <ItemGroup> 72 <Compile Include="button-4.wav"> 73 <Name>button-4</Name> 74 <Importer>WavImporter</Importer> 75 <Processor>SoundEffectProcessor</Processor> 76 </Compile> 77 </ItemGroup> 78 <ItemGroup> 79 <Compile Include="Menu.png"> 80 <Name>Menu</Name> 81 <Importer>TextureImporter</Importer> 82 <Processor>TextureProcessor</Processor> 83 </Compile> 84 </ItemGroup> 85 <ItemGroup> 86 <Compile Include="midnight-ride.mp3"> 87 <Name>midnight-ride</Name> 88 <Importer>Mp3Importer</Importer> 89 <Processor>SongProcessor</Processor> 90 </Compile> 91 </ItemGroup> 36 92 </Project> -
2010/27/juoshako/Br3ak 1t/Peli.cs
r1193 r1235 5 5 using Jypeli.Assets; 6 6 7 8 9 /// <summary> 10 /// Br3ak1t 11 /// Tekijä: Juha-Matti Hakojärvi 12 /// </summary> 7 13 public class Laatta : PhysicsObject 8 14 { … … 27 33 const int ruudunKorkeus = 50; 28 34 29 Vector nopeusVasemmalle = new Vector (- 200.0, 0);30 Vector nopeusOikealle = new Vector( 200.0, 0);35 Vector nopeusVasemmalle = new Vector (-800.0, 0); 36 Vector nopeusOikealle = new Vector(800.0, 0); 31 37 32 38 PhysicsObject maila; … … 35 41 IntMeter pisteLaskuri; 36 42 43 SoundEffect osuuLaattaanAani; 44 SoundEffect TuhoaaLaatanAani; 45 37 46 List<Label> valikonKohdat; 47 48 const double pallonYNopeus = 800; 38 49 39 50 protected override void Begin() … … 50 61 LuoLaskuri(); 51 62 AsetaOhjaimet(); 63 LataaAanet(); 52 64 //LuoMaila(); 65 53 66 54 67 Vector impulssi = new Vector(0.0, 500.0); 55 68 pallo.Hit(impulssi); 56 69 } 70 71 void LataaAanet() 72 { 73 osuuLaattaanAani = LoadSoundEffect("button-3"); 74 TuhoaaLaatanAani = LoadSoundEffect("button-4"); 75 } 76 57 77 void Lopeta() 58 78 { 59 79 Exit(); 60 80 } 81 82 protected override void Update(Time time) 83 { 84 if ( pallo != null && Math.Abs(pallo.Velocity.Y) < pallonYNopeus) 85 { 86 pallo.Velocity = new Vector(pallo.Velocity.X, pallo.Velocity.Y * 1.1); 87 } 88 89 base.Update(time); 90 } 91 61 92 void LuoMaila() 62 93 { 63 94 maila = PhysicsObject.CreateStaticObject(300, 30); 64 //maila.Shape = Shapes.Circle;95 maila.Shape = Shapes.Rectangle; 65 96 maila.X = 0; 66 97 maila.Y = Level.Bottom + 100; … … 68 99 maila.KineticFriction = 1; 69 100 maila.Color = Color.Blue; 101 maila.Restitution = 1.0; 70 102 Add(maila); 71 103 } … … 77 109 ruudut['.'] = LuoTiili; 78 110 ruudut.Insert (ruudunLeveys, ruudunKorkeus); 111 Image tausta = LoadImage("n49_chandra_big"); 112 Level.Background.Image = tausta; 113 Level.Background.Scale = 4; 114 Level.Background.FitToLevel(); 79 115 Camera.ZoomToLevel(); 116 117 Level.BackgroundColor = Color.Black; 80 118 81 119 pallo = new PhysicsObject(40, 40); … … 83 121 pallo.X = 0; 84 122 pallo.Y = Level.Bottom+110; 85 pallo.Color = Color.Black; 123 pallo.Color = Color.Red; 124 pallo.KineticFriction = 0; 86 125 Add (pallo); 87 126 88 127 LuoMaila(); 89 128 MediaPlayer.Play("midnight-ride"); 129 90 130 AddCollisionHandler(pallo, KasittelePallonTormays); 131 Mouse.IsCursorVisible = false;MediaPlayer.Play("midnight-ride"); 132 91 133 } 92 134 PhysicsObject LuoPalikka() … … 97 139 palikka.Restitution = 1.0; 98 140 palikka.Tag = "palikka"; 141 palikka.Image = LoadImage ("Palikka"); 99 142 return palikka; 100 143 } 101 144 PhysicsObject LuoLaatta() 102 145 { 103 Laatta laatta = new Laatta(48 .0, 48.0);146 Laatta laatta = new Laatta(48, 48); 104 147 laatta.Tag = "laatta"; 148 laatta.Image = LoadImage("Laatta"); 149 laatta.Restitution = 1.0; 105 150 return laatta; 106 151 } … … 124 169 Timer.SingleShot(0.1, kohde.Destroy); 125 170 pisteLaskuri.Value++; 171 TuhoaaLaatanAani.Play(); 126 172 } 127 173 else 128 174 { 129 175 ((Laatta)kohde).OnkoJoOsuttuKerran = true; 130 kohde.Color = Color.Gray; 176 kohde.Image = LoadImage("Laatta (vastavärit)"); 177 osuuLaattaanAani.Play(); 131 178 } 132 179 … … 135 182 if (kohde.Tag.ToString() == "tiili") 136 183 { 137 MessageDisplay.Add("Peli loppui"); 184 MessageDisplay.Add("Peli loppui, paina ESC palataksesi päävalikkoon."); 185 MessageDisplay.TextColor = Color.Red; 138 186 PeliPaattyi(); 139 187 } … … 155 203 { 156 204 157 if (( nopeus.X < 0 ) && ( maila. X< Level.Left))205 if (( nopeus.X < 0 ) && ( maila.Left-50 < Level.Left)) 158 206 { 159 207 maila.Velocity = Vector.Zero; 160 208 return; 161 209 } 162 if (( nopeus.X > 0 ) && (maila. X> Level.Right))210 if (( nopeus.X > 0 ) && (maila.Right+50 > Level.Right)) 163 211 { 164 212 maila.Velocity = Vector.Zero; … … 181 229 Label pisteTeksti = new Label("Pisteitä"); 182 230 pisteTeksti.X = Screen.Left + 50; 183 pisteTeksti. X= Screen.Top - 100;231 pisteTeksti.Y = Screen.Top - 100; 184 232 pisteTeksti.TextColor = Color.Red; 185 233 Add(pisteTeksti); … … 197 245 { 198 246 ClearAll(); 247 199 248 Mouse.IsCursorVisible = true; 200 249 valikonKohdat = new List<Label>(); 201 250 Image tausta = LoadImage("Menu"); 251 Level.Background.Image = tausta; 202 252 Label kohta1 = new Label("Aloita uusi peli"); 203 253 kohta1.Position = new Vector(0, 40);
Note: See TracChangeset
for help on using the changeset viewer.