Changeset 8403 for 2016


Ignore:
Timestamp:
2017-02-18 14:53:50 (19 months ago)
Author:
tesatapa
Message:
 
Location:
2016/koodauskerho/OttoK
Files:
4 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  
    99      <Options>None</Options> 
    1010      <Output>C:\MyTemp\OttoK\peli2\peli2\peli2\bin\x86\Debug\Content\oranssialus.xnb</Output> 
    11       <Time>2016-12-17T13:17:07.0209773+02:00</Time> 
     11      <Time>2017-02-18T13:51:24.7399151+02:00</Time> 
    1212    </Item> 
    1313    <Item> 
     
    1818      <Options>None</Options> 
    1919      <Output>C:\MyTemp\OttoK\peli2\peli2\peli2\bin\x86\Debug\Content\vihreealus.xnb</Output> 
    20       <Time>2016-12-17T13:17:07.0365774+02:00</Time> 
     20      <Time>2017-02-18T13:51:12.6855151+02:00</Time> 
    2121    </Item> 
    2222    <Item> 
     
    4545      <Options>None</Options> 
    4646      <Output>C:\MyTemp\OttoK\peli2\peli2\peli2\bin\x86\Debug\Content\vihreepanos.xnb</Output> 
    47       <Time>2017-01-28T11:46:09.3009507+02:00</Time> 
     47      <Time>2017-02-18T13:57:00.2727151+02:00</Time> 
    4848    </Item> 
    4949    <Item> 
     
    5454      <Options>None</Options> 
    5555      <Output>C:\MyTemp\OttoK\peli2\peli2\peli2\bin\x86\Debug\Content\oranssipanos.xnb</Output> 
    56       <Time>2017-01-28T11:46:13.7549507+02:00</Time> 
     56      <Time>2017-02-18T13:56:55.1871151+02:00</Time> 
    5757    </Item> 
    5858    <Item> 
     
    6363      <Options>None</Options> 
    6464      <Output>C:\MyTemp\OttoK\peli2\peli2\peli2\bin\x86\Debug\Content\meteoriitti.xnb</Output> 
    65       <Time>2017-01-28T13:43:14.0054507+02:00</Time> 
     65      <Time>2017-02-18T11:44:32.4229151+02:00</Time> 
    6666    </Item> 
    6767    <BuildSuccessful>true</BuildSuccessful> 
  • 2016/koodauskerho/OttoK/peli2/peli2/peli2/peli2.cs

    r8396 r8403  
    3838    Image meteoriittikuva = LoadImage("meteoriitti"); 
    3939 
     40    Alus vihreealus; 
     41    Alus oranssialus; 
     42 
    4043    public override void Begin() 
    4144    { 
     
    4346        Level.Size = new Vector(1900, 1000); 
    4447 
    45         Alus vihreealus = TeeAlus(400, 0, vihreealuskuva, Screen.Right - 150, Color.LightGreen); 
     48        vihreealus = TeeAlus(400, 0, vihreealuskuva, Screen.Right - 150, Color.LightGreen); 
    4649        vihreealus.Tag = "vihreealus"; 
    4750 
    48         Alus oranssialus = TeeAlus(-400, 0, oranssialuskuva, Screen.Left + 150, Color.Orange); 
     51        oranssialus = TeeAlus(-400, 0, oranssialuskuva, Screen.Left + 150, Color.Orange); 
    4952        oranssialus.Tag = "oranssialus"; 
    5053 
     
    6366        Keyboard.Listen(Key.LeftControl, ButtonState.Pressed, ammu, "Ammu", oranssialus); 
    6467 
     68        Keyboard.Listen(Key.F1, ButtonState.Pressed, Konsoli, null); 
     69 
    6570        Timer meteorcreater = new Timer(); 
    6671        meteorcreater.Interval = RandomGen.NextDouble(6, 16); 
     
    7580 
    7681        Level.Background.Color = Color.Black; 
    77         Level.Background.CreateStars(); 
    7882        Timer ajastin = new Timer(); 
    7983        ajastin.Interval = 0.1; 
     
    101105    } 
    102106 
     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    } 
    103123    void ammu(PhysicsObject pelaaja) 
    104124    { 
     
    113133        } 
    114134        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)); 
    117137        ammus.Tag = "ammus"; 
    118138        ammus.LifetimeLeft = TimeSpan.FromSeconds(10); 
     
    121141    Alus TeeAlus(double x, double y, Image aluskuva, double xpalkinpaikka, Color palkinvari) 
    122142    { 
    123         Alus alus = new Alus(60, 70, alustulenkuva); 
     143        Alus alus = new Alus(50, 70, alustulenkuva); 
    124144        alus.Position = new Vector(x, y); 
    125145        alus.Shape = Shape.FromImage(mustaluskuva); 
  • 2016/koodauskerho/OttoK/peli2/peli2/peli2Content/peli2Content.contentproj

    r8396 r8403  
    4646  </ItemGroup> 
    4747  <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> 
    6048    <Compile Include="mustalus.png"> 
    6149      <Name>mustalus</Name> 
     
    7260  </ItemGroup> 
    7361  <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> 
    7678      <Importer>TextureImporter</Importer> 
    7779      <Processor>TextureProcessor</Processor> 
     
    8688  </ItemGroup> 
    8789  <ItemGroup> 
    88     <Compile Include="meteoriitti.png"> 
    89       <Name>meteoriitti</Name> 
     90    <Compile Include="vihreepanos.png"> 
     91      <Name>vihreepanos</Name> 
    9092      <Importer>TextureImporter</Importer> 
    9193      <Processor>TextureProcessor</Processor> 
Note: See TracChangeset for help on using the changeset viewer.