Changeset 2282
- Timestamp:
- 2011-06-29 12:55:57 (12 years ago)
- Location:
- 2011/26/HenriH/Alien Empire/Alien Empire
- Files:
-
- 26 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/26/HenriH/Alien Empire/Alien Empire/Alien Empire/Peli.cs
r2233 r2282 15 15 PhysicsObject alus2; 16 16 Image olionkuva = LoadImage("alus1"); 17 Image olionkuva2 = LoadImage("alus2"); 18 Image kiihdytys1 = LoadImage("alus1_kaasuttaa"); 19 Image kiihdytys2 = LoadImage("alus2_kaasuttaa"); 17 20 18 21 public override void Begin() … … 20 23 // TODO: Kirjoita ohjelmakoodisi tähän 21 24 Valikko(); 22 25 IsFullScreen = true; 23 26 24 27 25 28 } 29 26 30 void Valikko() 27 31 { … … 69 73 ClearAll(); 70 74 // Tähän tulee kaikki kentän luomiset ym. alustukset... 71 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Valikko, "Palaa valikkoon"); 75 76 Camera.ZoomToLevel(); 72 77 Level.Background.Image = taustakuva; 73 78 Level.Background.FitToLevel(); 79 Level.CreateBorders(); 74 80 alus1 = new PhysicsObject(50.0, 50.0); 75 81 alus2 = new PhysicsObject(50.0, 50.0); 82 alus1.X = 300; 83 alus1.Y = 150; 84 alus2.X = 150; 85 alus2.Y = 300; 86 alus1.Image = olionkuva; 87 alus2.Image = olionkuva2; 88 alus1.AngularDamping = 0.50; 89 alus2.AngularDamping = 0.50; 90 alus1.Restitution = 0.2; 91 alus2.Restitution = 0.2; 92 93 Add(alus1); 94 Add(alus2); 95 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Valikko, "Palaa valikkoon"); 96 Keyboard.Listen(Key.Up, ButtonState.Down, kiihdytaalus, "Kiihdytä alusta 1", alus1); 97 Keyboard.Listen(Key.Up, ButtonState.Released, ajaalus, null, alus1); 98 Keyboard.Listen(Key.Left, ButtonState.Down, kaannaalus, "Käännä alusta 1 Vasemmalle.", alus1); 99 Keyboard.Listen(Key.Right, ButtonState.Down, kaannaalus2, "Käännä alusta 1 Oikealle.", alus1); 100 Keyboard.Listen(Key.A, ButtonState.Down, kaannaalus3, "Käännä alusta 2 Vasemmalle.", alus2); 101 Keyboard.Listen(Key.W, ButtonState.Down, kiihdytaalus2, "Kiihdytä alusta 2", alus2); 102 Keyboard.Listen(Key.W, ButtonState.Released, ajaalus2, null, alus2); 103 Keyboard.Listen(Key.D, ButtonState.Down, kaannaalus4, "Käännä alusta Oikealle.", alus2); 76 104 } 105 void kiihdytaalus(PhysicsObject alus) 106 { 107 alus.Image = kiihdytys1; 108 Vector voima = Vector.FromLengthAndAngle(1000, alus.Angle); 109 alus.Push(voima); 110 } 111 112 void ajaalus(PhysicsObject alus) 113 { 114 alus.Image = olionkuva; 115 } 116 void kaannaalus(PhysicsObject alus) 117 { 118 alus.Angle += Angle.FromDegrees(5); 119 120 } 121 void kaannaalus2(PhysicsObject alus) 122 { 123 alus.Angle -= Angle.FromDegrees(5); 124 } 125 void kaannaalus3(PhysicsObject alus2) 126 { 127 alus2.Angle += Angle.FromDegrees(5); 128 } 129 130 void kaannaalus4(PhysicsObject alus2) 131 { 132 alus2.Angle -= Angle.FromDegrees(5); 133 } 134 void ajaalus2(PhysicsObject alus2) 135 { 136 alus2.Image = olionkuva2; 137 } 138 void kiihdytaalus2(PhysicsObject alus2) 139 { 140 alus2.Image = kiihdytys2; 141 Vector voima = Vector.FromLengthAndAngle(1000, alus2.Angle); 142 alus2.Push(voima); 143 } 144 77 145 } -
2011/26/HenriH/Alien Empire/Alien Empire/Alien EmpireContent/Alien EmpireContent.contentproj
r2233 r2282 50 50 </ItemGroup> 51 51 <ItemGroup> 52 <Compile Include="alus1kuva.png"> 53 <Name>alus1kuva</Name> 54 <Importer>TextureImporter</Importer> 55 <Processor>TextureProcessor</Processor> 56 </Compile> 57 </ItemGroup> 58 <ItemGroup> 52 59 <Compile Include="alus1.png"> 53 60 <Name>alus1</Name> 61 <Importer>TextureImporter</Importer> 62 <Processor>TextureProcessor</Processor> 63 </Compile> 64 <Compile Include="alus12.png"> 65 <Name>alus12</Name> 66 <Importer>TextureImporter</Importer> 67 <Processor>TextureProcessor</Processor> 68 </Compile> 69 <Compile Include="alus121.png"> 70 <Name>alus121</Name> 71 <Importer>TextureImporter</Importer> 72 <Processor>TextureProcessor</Processor> 73 </Compile> 74 <Compile Include="alus122.png"> 75 <Name>alus122</Name> 76 <Importer>TextureImporter</Importer> 77 <Processor>TextureProcessor</Processor> 78 </Compile> 79 <Compile Include="alus12_kaasuttaa.png"> 80 <Name>alus12_kaasuttaa</Name> 81 <Importer>TextureImporter</Importer> 82 <Processor>TextureProcessor</Processor> 83 </Compile> 84 <Compile Include="alus1_kaasuttaa.png"> 85 <Name>alus1_kaasuttaa</Name> 86 <Importer>TextureImporter</Importer> 87 <Processor>TextureProcessor</Processor> 88 </Compile> 89 <Compile Include="alus2.png"> 90 <Name>alus2</Name> 91 <Importer>TextureImporter</Importer> 92 <Processor>TextureProcessor</Processor> 93 </Compile> 94 <Compile Include="alus22.png"> 95 <Name>alus22</Name> 96 <Importer>TextureImporter</Importer> 97 <Processor>TextureProcessor</Processor> 98 </Compile> 99 <Compile Include="alus221.png"> 100 <Name>alus221</Name> 101 <Importer>TextureImporter</Importer> 102 <Processor>TextureProcessor</Processor> 103 </Compile> 104 <Compile Include="alus222.png"> 105 <Name>alus222</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 </Compile> 109 <Compile Include="alus22_kaasuttaa.png"> 110 <Name>alus22_kaasuttaa</Name> 111 <Importer>TextureImporter</Importer> 112 <Processor>TextureProcessor</Processor> 113 </Compile> 114 <Compile Include="alus2_kaasuttaa.png"> 115 <Name>alus2_kaasuttaa</Name> 116 <Importer>TextureImporter</Importer> 117 <Processor>TextureProcessor</Processor> 118 </Compile> 119 <Compile Include="asteroidi.png"> 120 <Name>asteroidi</Name> 121 <Importer>TextureImporter</Importer> 122 <Processor>TextureProcessor</Processor> 123 </Compile> 124 <Compile Include="avaruus.jpg"> 125 <Name>avaruus</Name> 126 <Importer>TextureImporter</Importer> 127 <Processor>TextureProcessor</Processor> 128 </Compile> 129 <Compile Include="galaksi.png"> 130 <Name>galaksi</Name> 131 <Importer>TextureImporter</Importer> 132 <Processor>TextureProcessor</Processor> 133 </Compile> 134 <Compile Include="lisaase1.png"> 135 <Name>lisaase1</Name> 136 <Importer>TextureImporter</Importer> 137 <Processor>TextureProcessor</Processor> 138 </Compile> 139 <Compile Include="lisaase2.png"> 140 <Name>lisaase2</Name> 141 <Importer>TextureImporter</Importer> 142 <Processor>TextureProcessor</Processor> 143 </Compile> 144 <Compile Include="lisaase3.png"> 145 <Name>lisaase3</Name> 146 <Importer>TextureImporter</Importer> 147 <Processor>TextureProcessor</Processor> 148 </Compile> 149 <Compile Include="lisaase4.png"> 150 <Name>lisaase4</Name> 151 <Importer>TextureImporter</Importer> 152 <Processor>TextureProcessor</Processor> 153 </Compile> 154 <Compile Include="plasma.png"> 155 <Name>plasma</Name> 156 <Importer>TextureImporter</Importer> 157 <Processor>TextureProcessor</Processor> 158 </Compile> 159 <Compile Include="plasma2.png"> 160 <Name>plasma2</Name> 161 <Importer>TextureImporter</Importer> 162 <Processor>TextureProcessor</Processor> 163 </Compile> 164 <Compile Include="plasma3.png"> 165 <Name>plasma3</Name> 166 <Importer>TextureImporter</Importer> 167 <Processor>TextureProcessor</Processor> 168 </Compile> 169 <Compile Include="special.png"> 170 <Name>special</Name> 171 <Importer>TextureImporter</Importer> 172 <Processor>TextureProcessor</Processor> 173 </Compile> 174 <Compile Include="special2.png"> 175 <Name>special2</Name> 176 <Importer>TextureImporter</Importer> 177 <Processor>TextureProcessor</Processor> 178 </Compile> 179 <Compile Include="special22.png"> 180 <Name>special22</Name> 181 <Importer>TextureImporter</Importer> 182 <Processor>TextureProcessor</Processor> 183 </Compile> 184 <Compile Include="special23.png"> 185 <Name>special23</Name> 54 186 <Importer>TextureImporter</Importer> 55 187 <Processor>TextureProcessor</Processor>
Note: See TracChangeset
for help on using the changeset viewer.