Changeset 8403 for 2016/koodauskerho/OttoK/peli2
- Timestamp:
- 2017-02-18 14:53:50 (4 years ago)
- Location:
- 2016/koodauskerho/OttoK/peli2
- Files:
-
- 1 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/koodauskerho/OttoK/peli2/peli2/peli2/obj/x86/Debug/ContentPipeline-{63C34160-7957-4F91-BEB4-9CD0C03BF303}.xml
r8396 r8403 9 9 <Options>None</Options> 10 10 <Output>C:\MyTemp\OttoK\peli2\peli2\peli2\bin\x86\Debug\Content\oranssialus.xnb</Output> 11 <Time>201 6-12-17T13:17:07.0209773+02:00</Time>11 <Time>2017-02-18T13:51:24.7399151+02:00</Time> 12 12 </Item> 13 13 <Item> … … 18 18 <Options>None</Options> 19 19 <Output>C:\MyTemp\OttoK\peli2\peli2\peli2\bin\x86\Debug\Content\vihreealus.xnb</Output> 20 <Time>201 6-12-17T13:17:07.0365774+02:00</Time>20 <Time>2017-02-18T13:51:12.6855151+02:00</Time> 21 21 </Item> 22 22 <Item> … … 45 45 <Options>None</Options> 46 46 <Output>C:\MyTemp\OttoK\peli2\peli2\peli2\bin\x86\Debug\Content\vihreepanos.xnb</Output> 47 <Time>2017-0 1-28T11:46:09.3009507+02:00</Time>47 <Time>2017-02-18T13:57:00.2727151+02:00</Time> 48 48 </Item> 49 49 <Item> … … 54 54 <Options>None</Options> 55 55 <Output>C:\MyTemp\OttoK\peli2\peli2\peli2\bin\x86\Debug\Content\oranssipanos.xnb</Output> 56 <Time>2017-0 1-28T11:46:13.7549507+02:00</Time>56 <Time>2017-02-18T13:56:55.1871151+02:00</Time> 57 57 </Item> 58 58 <Item> … … 63 63 <Options>None</Options> 64 64 <Output>C:\MyTemp\OttoK\peli2\peli2\peli2\bin\x86\Debug\Content\meteoriitti.xnb</Output> 65 <Time>2017-0 1-28T13:43:14.0054507+02:00</Time>65 <Time>2017-02-18T11:44:32.4229151+02:00</Time> 66 66 </Item> 67 67 <BuildSuccessful>true</BuildSuccessful> -
2016/koodauskerho/OttoK/peli2/peli2/peli2/peli2.cs
r8396 r8403 38 38 Image meteoriittikuva = LoadImage("meteoriitti"); 39 39 40 Alus vihreealus; 41 Alus oranssialus; 42 40 43 public override void Begin() 41 44 { … … 43 46 Level.Size = new Vector(1900, 1000); 44 47 45 Alusvihreealus = TeeAlus(400, 0, vihreealuskuva, Screen.Right - 150, Color.LightGreen);48 vihreealus = TeeAlus(400, 0, vihreealuskuva, Screen.Right - 150, Color.LightGreen); 46 49 vihreealus.Tag = "vihreealus"; 47 50 48 Alusoranssialus = TeeAlus(-400, 0, oranssialuskuva, Screen.Left + 150, Color.Orange);51 oranssialus = TeeAlus(-400, 0, oranssialuskuva, Screen.Left + 150, Color.Orange); 49 52 oranssialus.Tag = "oranssialus"; 50 53 … … 63 66 Keyboard.Listen(Key.LeftControl, ButtonState.Pressed, ammu, "Ammu", oranssialus); 64 67 68 Keyboard.Listen(Key.F1, ButtonState.Pressed, Konsoli, null); 69 65 70 Timer meteorcreater = new Timer(); 66 71 meteorcreater.Interval = RandomGen.NextDouble(6, 16); … … 75 80 76 81 Level.Background.Color = Color.Black; 77 Level.Background.CreateStars();78 82 Timer ajastin = new Timer(); 79 83 ajastin.Interval = 0.1; … … 101 105 } 102 106 107 void Konsoli() 108 { 109 InputWindow kysymysIkkuna = new InputWindow("Konsoli"); 110 kysymysIkkuna.TextEntered += ProcessInput; 111 Add(kysymysIkkuna); 112 } 113 void ProcessInput(InputWindow ikkuna) 114 { 115 string[] vastaus = ikkuna.InputBox.Text.Split(' '); 116 117 if (vastaus [0] == "SUPER") 118 { 119 // Keyboard.Listen(Key.LeftControl, ButtonState.Down, ammu, "Ammu", oranssialus); 120 Keyboard.Listen(Key.RightControl, ButtonState.Down, ammu, "Ammu", vihreealus); 121 } 122 } 103 123 void ammu(PhysicsObject pelaaja) 104 124 { … … 113 133 } 114 134 ammus.Angle = pelaaja.Angle + Angle.FromDegrees(90); 115 ammus.Velocity = Vector.FromLengthAndAngle(700, pelaaja.Angle + Angle.FromDegrees(90));116 ammus.Position = pelaaja.Position + Vector.FromLengthAndAngle(pelaaja.Width * 0.75, pelaaja.Angle + Angle.FromDegrees(90));135 ammus.Velocity = pelaaja.Velocity + Vector.FromLengthAndAngle(700, pelaaja.Angle + Angle.FromDegrees(90)); 136 ammus.Position = pelaaja.Position + Vector.FromLengthAndAngle(pelaaja.Width * 1.0, pelaaja.Angle + Angle.FromDegrees(90)); 117 137 ammus.Tag = "ammus"; 118 138 ammus.LifetimeLeft = TimeSpan.FromSeconds(10); … … 121 141 Alus TeeAlus(double x, double y, Image aluskuva, double xpalkinpaikka, Color palkinvari) 122 142 { 123 Alus alus = new Alus( 60, 70, alustulenkuva);143 Alus alus = new Alus(50, 70, alustulenkuva); 124 144 alus.Position = new Vector(x, y); 125 145 alus.Shape = Shape.FromImage(mustaluskuva); -
2016/koodauskerho/OttoK/peli2/peli2/peli2Content/peli2Content.contentproj
r8396 r8403 46 46 </ItemGroup> 47 47 <ItemGroup> 48 <Compile Include="oranssialus.png">49 <Name>oranssialus</Name>50 <Importer>TextureImporter</Importer>51 <Processor>TextureProcessor</Processor>52 </Compile>53 <Compile Include="vihreealus.png">54 <Name>vihreealus</Name>55 <Importer>TextureImporter</Importer>56 <Processor>TextureProcessor</Processor>57 </Compile>58 </ItemGroup>59 <ItemGroup>60 48 <Compile Include="mustalus.png"> 61 49 <Name>mustalus</Name> … … 72 60 </ItemGroup> 73 61 <ItemGroup> 74 <Compile Include="vihreepanos.png"> 75 <Name>vihreepanos</Name> 62 <Compile Include="meteoriitti.png"> 63 <Name>meteoriitti</Name> 64 <Importer>TextureImporter</Importer> 65 <Processor>TextureProcessor</Processor> 66 </Compile> 67 </ItemGroup> 68 <ItemGroup> 69 <Compile Include="vihreealus.png"> 70 <Name>vihreealus</Name> 71 <Importer>TextureImporter</Importer> 72 <Processor>TextureProcessor</Processor> 73 </Compile> 74 </ItemGroup> 75 <ItemGroup> 76 <Compile Include="oranssialus.png"> 77 <Name>oranssialus</Name> 76 78 <Importer>TextureImporter</Importer> 77 79 <Processor>TextureProcessor</Processor> … … 86 88 </ItemGroup> 87 89 <ItemGroup> 88 <Compile Include=" meteoriitti.png">89 <Name> meteoriitti</Name>90 <Compile Include="vihreepanos.png"> 91 <Name>vihreepanos</Name> 90 92 <Importer>TextureImporter</Importer> 91 93 <Processor>TextureProcessor</Processor>
Note: See TracChangeset
for help on using the changeset viewer.