Changeset 3726 for 2012/26


Ignore:
Timestamp:
2012-07-24 14:59:50 (11 years ago)
Author:
alvirmas
Message:

Talletus.

Location:
2012/26/AleksanteriV
Files:
5 added
5 edited

Legend:

Unmodified
Added
Removed
  • 2012/26/AleksanteriV/Polla ja Rosvo/Poliisi ja Rosvo/Poliisi ja Rosvo/Poliisi ja Rosvo/Poliisi_ja_Rosvo.cs

    r3699 r3726  
    7979                } 
    8080            }; 
    81             valikko.Color = Color.Green; 
     81            valikko.Color = Color.White; 
    8282            Level.BackgroundColor = Color.Black; 
    8383            Add(valikko); 
     
    109109 
    110110            }; 
    111             valikko.Color = Color.Green; 
     111            valikko.Color = Color.White; 
    112112            Level.BackgroundColor = Color.Black; 
    113113            Add(valikko); 
     
    118118            valikko = new MultiSelectWindow("4 pelaajaa", "Kenttä 1", "Kenttä 2", "Kenttä 3", "kentta 4"); 
    119119            valikko.ItemSelected += delegate(int valinta) 
     120             
    120121            { 
    121122                switch (valinta) 
     
    136137 
    137138            }; 
    138             valikko.Color = Color.Green; 
     139            valikko.Color = Color.White; 
    139140            Level.BackgroundColor = Color.Black; 
    140141            Add(valikko); 
     
    154155 
    155156        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    156         Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
     157        Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Lopeta peli"); 
    157158        Keyboard.Listen(Key.Space, ButtonState.Pressed, Begin, "aloita alusta"); 
    158159        //Image taustaKuva = LoadImage("moi"); 
  • 2012/26/AleksanteriV/Water wey/Water wey/Water wey/Water_wey.cs

    r3699 r3726  
    1111    //------------------------------------------------------------- PhysicsObject 
    1212    PhysicsObject vesi; 
    13         PhysicsObject pelaaja; 
    14         double voima = 100000; 
     13    PhysicsObject pelaaja; 
     14    PhysicsObject pelaaja2; 
     15    double voima = 1000000; 
     16    PhysicsObject kala; 
    1517 
    1618    public override void Begin() 
    1719    { 
    18         PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    19         Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
     20        //PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
     21        Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Lopeta peli");//Confirm 
    2022        // Keyboard.Listen(Key.Right, ButtonState.Pressed, Gravity, new Vector(-100, 0); 
    21          
    22          
    23         
     23        luopelaaja2(); 
    2424        luopelaaja(); 
     25        loukala(); 
     26        loukala(); 
    2527        lisaaohjaimet(); 
    2628 
    27         Gravity = new Vector(0, -100); 
     29       // Gravity = new Vector(0, -500); 
    2830        Level.CreateBorders(); 
    29         int i = 0; 
     31        IsFullScreen = true; 
     32        Level.Background.Image = LoadImage("underwater"); 
     33        Level.Background.FitToLevel(); 
     34        Camera.ZoomToLevel(); 
    3035 
    31         while (i < 1000) 
    32        { 
    33            vesi = new PhysicsObject(10, 10); 
    34            vesi.Shape = Shape.Circle; 
    35            vesi.Color = Color.Blue; 
    36            vesi.Mass = 0.5; 
    37            vesi.X = RandomGen.NextDouble(Level.Left, Level.Right); 
    38            vesi.Y = RandomGen.NextDouble(Level.Bottom, Level.Top); 
    39           Add(vesi); 
    40           i++; 
     36        int Laskuri = 0; 
     37 
     38        while (Laskuri < 1000) 
     39        { 
     40            vesi = new PhysicsObject(25, 25); 
     41            vesi.Shape = Shape.Circle; 
     42 
     43            vesi.Color = new Color(0, 0, 100, 5); 
     44            vesi.Mass = 0.5; 
     45            vesi.X = RandomGen.NextDouble(Level.Left, Level.Right); 
     46            vesi.Y = RandomGen.NextDouble(Level.Bottom, Level.Top); 
     47            Add(vesi); 
     48            Laskuri++; 
    4149        } 
    4250    } 
    4351    //-----------------------------------------------------------------------Aliohjelmat 
    44         void luopelaaja()//Vector paikka, double leveys, double korkeus 
     52    void luopelaaja()//Vector paikka, double leveys, double korkeus 
    4553    { 
    46         pelaaja = new PhysicsObject(50, 50); 
    47         //pelaaja.Shape = Shape.; 
    48         //pelaaja.Position = paikka; 
     54        pelaaja = new PhysicsObject(100, 50); 
     55        pelaaja.Shape = Shape.FromImage(LoadImage("KALA2")); 
     56        pelaaja.Position = new Vector(-100, -100); 
    4957        pelaaja.Mass = 100; 
    50         pelaaja.Image = LoadImage("Untitled"); 
     58        pelaaja.Image = LoadImage("KALA2"); 
    5159        //(pelaaja.Tag = "";) 
    5260        Add(pelaaja); 
    53          
     61 
    5462 
    5563        // AddCollisionHandler(pelaaja, "palikka", PysaytaPelaaja); 
    5664    } 
    57         void lisaaohjaimet() 
    58         { 
    59             Keyboard.Listen(Key.Left, ButtonState.Down, LiikutaPelaajaa, null, new Vector(-voima, 0)); 
    60             Keyboard.Listen(Key.Right, ButtonState.Down, LiikutaPelaajaa, null, new Vector(voima, 0)); 
    61             Keyboard.Listen(Key.Up, ButtonState.Down, LiikutaPelaajaa, null, new Vector(0, voima)); 
    62             Keyboard.Listen(Key.Down, ButtonState.Down, LiikutaPelaajaa, null, new Vector(0, -voima)); 
     65    void luopelaaja2()//Vector paikka, double leveys, double korkeus 
     66    { 
     67        pelaaja2 = new PhysicsObject(100, 50); 
     68        pelaaja2.Shape = Shape.FromImage(LoadImage("KALA2")); 
     69        pelaaja2.Position = new Vector(-100, 100); 
     70        pelaaja2.Mass = 100; 
     71        pelaaja2.Image = LoadImage("KALA2"); 
     72        //(pelaaja.Tag = "";) 
     73        Add(pelaaja2); 
    6374 
    64             //Keyboard.Listen(Key.Left, ButtonState.Released, PysaytaPelaajaX, null); 
    65             //Keyboard.Listen(Key.Right, ButtonState.Released, PysaytaPelaajaX, null); 
    66             //Keyboard.Listen(Key.Up, ButtonState.Released, PysaytaPelaajaY, null); 
    67             //Keyboard.Listen(Key.Down, ButtonState.Released, PysaytaPelaajaY, null); 
    68         } 
    69     void LiikutaPelaajaa(Vector liikuttaja) 
     75 
     76        // AddCollisionHandler(pelaaja, "palikka", PysaytaPelaaja); 
     77    } 
     78    void loukala() 
    7079    { 
    71         //if (pelaajia > 2) 
    72         //{ 
    73         //    liikuttaja = liikuttaja + Vector.FromLengthAndAngle(20, liikuttaja.Angle); 
    74         //} 
    75         pelaaja.Push(liikuttaja); 
    76         pelaaja.Angle = liikuttaja.Angle + Angle.FromDegrees(90); 
     80        double x = RandomGen.NextDouble(0.0, 500.0); 
     81        double y = RandomGen.NextDouble(0.0, 300.0); 
     82 
     83        kala = new PhysicsObject(100, 50); 
     84        FollowerBrain seuraajanAivot = new FollowerBrain(pelaaja, pelaaja2); 
     85        seuraajanAivot.TurnWhileMoving = true; 
     86        kala.Brain = seuraajanAivot; 
     87        seuraajanAivot.Speed = 200; 
     88        kala.Mass = 50; 
     89        kala.X = x; 
     90        kala.Y = y; 
     91        kala.Shape = Shape.FromImage(LoadImage("kala")); 
     92        kala.Image = LoadImage("kala"); 
     93        Add(kala); 
    7794    } 
     95 
     96    //---------------------------------------------------------------Ohjaimet 
     97 
     98    void lisaaohjaimet() 
     99    { 
     100        //-------------------------------------------------------------------------------------1 
     101        Keyboard.Listen(Key.Left, ButtonState.Down, kaannaPelaajaa, null, 4.0); 
     102        Keyboard.Listen(Key.Left, ButtonState.Released, kaannaPelaajaa, null, 0.0); 
     103        Keyboard.Listen(Key.Right, ButtonState.Down, kaannaPelaajaa, null, -4.0); 
     104        Keyboard.Listen(Key.Right, ButtonState.Released, kaannaPelaajaa, null, -0.0); 
     105        Keyboard.Listen(Key.Up, ButtonState.Down, LiikutaPelaajaa, null ); 
     106            //---------------------------------------------------------------------------------2 
     107        Keyboard.Listen(Key.A, ButtonState.Down, kaannaPelaajaa2, null, 4.0); 
     108        Keyboard.Listen(Key.A, ButtonState.Released, kaannaPelaajaa2, null, 0.0); 
     109        Keyboard.Listen(Key.D, ButtonState.Down, kaannaPelaajaa2, null, -4.0); 
     110        Keyboard.Listen(Key.D, ButtonState.Released, kaannaPelaajaa2, null, -0.0); 
     111        Keyboard.Listen(Key.W, ButtonState.Down, LiikutaPelaajaa2, null); 
     112        //Keyboard.Listen(Key.Down, ButtonState.Pressed, LiikutaPelaajaa, null, new Vector(0, -voima)); 
     113 
     114        //Keyboard.Listen(Key.Left, ButtonState.Released, PysaytaPelaajaX, null); 
     115        //Keyboard.Listen(Key.Right, ButtonState.Released, PysaytaPelaajaX, null); 
     116        //Keyboard.Listen(Key.Up, ButtonState.Released, PysaytaPelaajaY, null); 
     117        //Keyboard.Listen(Key.Down, ButtonState.Released, PysaytaPelaajaY, null); 
     118    } 
     119    void kaannaPelaajaa(double nopeus) 
     120    { 
     121        pelaaja.AngularVelocity = nopeus; 
     122    } 
     123    void LiikutaPelaajaa() 
     124    { 
     125        Vector pelaajanSuunta = Vector.FromLengthAndAngle(50000.0, pelaaja.Angle); 
     126        pelaaja.Push(pelaajanSuunta); 
     127    } 
     128 
     129    void kaannaPelaajaa2(double nopeus) 
     130    { 
     131        pelaaja2.AngularVelocity = nopeus; 
     132    } 
     133    void LiikutaPelaajaa2() 
     134    { 
     135        Vector pelaajanSuunta2 = Vector.FromLengthAndAngle(50000.0, pelaaja2.Angle); 
     136        pelaaja2.Push(pelaajanSuunta2); 
     137    } 
     138    //------------------------------------------------------------- 
     139 
     140     
    78141} 
  • 2012/26/AleksanteriV/Water wey/Water wey/Water weyContent/Water weyContent.contentproj

    r3699 r3726  
    5151    </Compile> 
    5252  </ItemGroup> 
     53  <ItemGroup> 
     54    <Compile Include="kala.png"> 
     55      <Name>kala</Name> 
     56      <Importer>TextureImporter</Importer> 
     57      <Processor>TextureProcessor</Processor> 
     58    </Compile> 
     59  </ItemGroup> 
     60  <ItemGroup> 
     61    <Compile Include="pelaaja.png"> 
     62      <Name>pelaaja</Name> 
     63      <Importer>TextureImporter</Importer> 
     64      <Processor>TextureProcessor</Processor> 
     65    </Compile> 
     66  </ItemGroup> 
     67  <ItemGroup> 
     68    <Compile Include="underwater.jpg"> 
     69      <Name>underwater</Name> 
     70      <Importer>TextureImporter</Importer> 
     71      <Processor>TextureProcessor</Processor> 
     72    </Compile> 
     73  </ItemGroup> 
     74  <ItemGroup> 
     75    <Compile Include="haka.png"> 
     76      <Name>haka</Name> 
     77      <Importer>TextureImporter</Importer> 
     78      <Processor>TextureProcessor</Processor> 
     79    </Compile> 
     80  </ItemGroup> 
     81  <ItemGroup> 
     82    <Compile Include="KALA2.png"> 
     83      <Name>KALA2</Name> 
     84      <Importer>TextureImporter</Importer> 
     85      <Processor>TextureProcessor</Processor> 
     86    </Compile> 
     87  </ItemGroup> 
    5388  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    5489  <!--  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.