Changeset 6901 for 2015


Ignore:
Timestamp:
2015-07-22 11:44:38 (8 years ago)
Author:
novaanan
Message:
 
Location:
2015/30/NoelV/peli0.0.0.3/turhakepeli
Files:
42 edited

Legend:

Unmodified
Added
Removed
  • 2015/30/NoelV/peli0.0.0.3/turhakepeli/turhakepeli/turhakepeli/turhakepeli.cs

    r6878 r6901  
    1313    IntMeter vihollistenMaara = new IntMeter(0, 0, 0); 
    1414    IntMeter ampumisLaskuri = new IntMeter(0, 0, 10); 
    15     PhysicsObject pelaaja; 
     15    public PhysicsObject pelaaja; 
    1616    PhysicsObject turhake; 
    1717    PhysicsObject muuri; 
     
    5353    Image LaatikkoYla3 = LoadImage("laatikkoYla3"); 
    5454 
     55    bool saakoAmpua = true; 
     56 
    5557 
    5658 
     
    7577    { 
    7678        //SetWindowSize(1900, 1060, false);  
    77         IsFullScreen = true; 
     79        IsFullScreen = false; 
    7880        AloitaPeli(); 
    7981        
     
    119121        Keyboard.Listen(Key.A, ButtonState.Released, Liiku, null, Vector.Zero); 
    120122        Keyboard.Listen(Key.Space, ButtonState.Pressed, Hyokkaa, null); 
    121         Keyboard.Listen(Key.LeftShift, ButtonState.Down, Lataa, null); 
    122         Keyboard.Listen(Key.LeftShift, ButtonState.Released, Ammu, null); 
     123        //Keyboard.Listen(Key.LeftShift, ButtonState.Down, Lataa, null); 
     124        //Keyboard.Listen(Key.LeftShift, ButtonState.Released, Ammu, null); 
     125        Keyboard.Listen(Key.Up, ButtonState.Down, LuoAmmus, null, new Vector(0, 100000)); 
     126        Keyboard.Listen(Key.Down, ButtonState.Down, LuoAmmus, null, new Vector(0, -100000)); 
     127        Keyboard.Listen(Key.Left, ButtonState.Down, LuoAmmus, null, new Vector(-100000, 0)); 
     128        Keyboard.Listen(Key.Right, ButtonState.Down, LuoAmmus, null, new Vector(100000, 0)); 
     129         
     130 
     131 
     132 
     133 
    123134 
    124135 
    125136        Keyboard.Listen(Key.Escape, ButtonState.Pressed, KysyPoistumista, "Lopeta peli"); 
    126137    } 
    127     void Ammu() 
    128     { 
    129  
    130     } 
     138     
     139 
     140 
     141    void LuoAmmus(Vector suunta) 
     142    { 
     143        if (saakoAmpua == true) 
     144        { 
     145            PhysicsObject ammus = new PhysicsObject(10.0, 10.0); 
     146            ammus.Position = pelaaja.Position; 
     147            ammus.Tag = "ammus"; 
     148            ammus.Push(suunta); 
     149            ammus.CollisionIgnoreGroup = 5; 
     150            ammus.CanRotate = false; 
     151            ammus.Lifetime =  
     152            Add(ammus); 
     153 
     154            AddCollisionHandler(ammus, "vihu", HyokkausOsuu); 
     155            AddCollisionHandler(ammus, "laatikko", HyokkausOsuu); 
     156            AddCollisionHandler(ammus, "potionLaatikko", HyokkausOsuu); 
     157            AddCollisionHandler(ammus, "manaLaatikko", HyokkausOsuu); 
     158 
     159            saakoAmpua = false; 
     160 
     161            Timer.SingleShot(0.5, delegate { saakoAmpua = true; }); 
     162 
     163        } 
     164         
     165    } 
     166 
    131167    void Lataa() 
    132168    { 
     
    503539    hitbox.X = pelaaja.X; 
    504540    hitbox.Color = Color.Transparent; 
     541    hitbox.CollisionIgnoreGroup = 5; 
    505542    //hitbox.Image = hyokkauksenKuva; 
    506543    //hitbox.CollisionIgnoreGroup = 1; 
     
    656693    { 
    657694        laatikko laatikko = new laatikko(paikka, leveys, 30, alaOsanKuva, ylaOsanKuva, "laatikko"); 
    658          
    659          
    660695     
    661696        //laatikko.Tag = "laatikko"; 
    662697        Add(laatikko); 
    663  
    664         AxleJoint liitos = new AxleJoint(laatikko); 
    665         Add(liitos); 
    666698    } 
    667699    private void LuoManaLaatikko(Vector paikka, double leveys, double korkeus) 
     
    780812    void HyokkausOsuu(PhysicsObject hyokkaus, PhysicsObject kohde) 
    781813    { 
     814 
    782815        if (kohde.Tag.Equals("vihu")) 
    783816        { 
     
    799832            OsuManaLaatikkoon(kohde as laatikko); 
    800833 
     834        } 
     835 
     836        //tuhoa jos ammus 
     837        if (hyokkaus.Tag.Equals("ammus")) 
     838        { 
     839            hyokkaus.Destroy(); 
    801840        } 
    802841 
     
    11821221        : base(leveys, korkeus) 
    11831222    { 
     1223        this.MakeStatic(); 
    11841224        this.Position = paikka; 
    11851225        this.CanRotate = false; 
     
    11931233 
    11941234        Timer kerroksenVaihtaja = new Timer(); 
    1195         kerroksenVaihtaja.Interval = 0.001; 
    1196  
    1197              
    1198  
     1235        kerroksenVaihtaja.Interval = 3; 
     1236        kerroksenVaihtaja.Timeout += delegate 
     1237        { 
     1238            if (((turhakepeli)Game.Instance).pelaaja != null) 
     1239                { 
     1240                   
     1241                if (((turhakepeli)Game.Instance).pelaaja.Position.Y < this.Position.Y) 
     1242                { 
     1243                    this.TuhoaLaatikko(); 
     1244                    ((turhakepeli)Game.Instance).Add(this, 3); 
     1245                    ((turhakepeli)Game.Instance).Add(this.ylaOsa, 3); 
     1246                } 
     1247                else 
     1248                { 
     1249                    this.TuhoaLaatikko(); 
     1250                    ((turhakepeli)Game.Instance).Add(this, 3); 
     1251                    ((turhakepeli)Game.Instance).Add(this.ylaOsa, 3); 
     1252                } 
     1253                } 
     1254        }; 
     1255        //kerroksenVaihtaja.Start(); 
    11991256    } 
    12001257    public void VaihdaKuva(Image alaOsanUusiKuva, Image ylaOsanUusiKuva) 
  • 2015/30/NoelV/peli0.0.0.3/turhakepeli/turhakepeli/turhakepeliContent/obj/x86/Debug/ContentPipeline.xml

    r6878 r6901  
    99      <Options>None</Options> 
    1010      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\kentta.xnb</Output> 
    11       <Time>2015-07-21T11:29:48.3054038+03:00</Time> 
     11      <Time>2015-07-21T11:29:50+03:00</Time> 
    1212    </Item> 
    1313    <Item> 
     
    6363      <Options>None</Options> 
    6464      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\maa.xnb</Output> 
    65       <Time>2015-04-19T20:09:40+03:00</Time> 
     65      <Time>2015-07-21T19:12:38+03:00</Time> 
    6666    </Item> 
    6767    <Item> 
     
    7272      <Options>None</Options> 
    7373      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\ala.xnb</Output> 
    74       <Time>2015-05-08T21:03:22+03:00</Time> 
     74      <Time>2015-07-21T16:49:44+03:00</Time> 
    7575    </Item> 
    7676    <Item> 
     
    8181      <Options>None</Options> 
    8282      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\Sivu.xnb</Output> 
    83       <Time>2015-05-08T20:57:34+03:00</Time> 
     83      <Time>2015-07-21T17:18:28+03:00</Time> 
    8484    </Item> 
    8585    <Item> 
     
    9090      <Options>None</Options> 
    9191      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\oikeaYla.xnb</Output> 
    92       <Time>2015-05-15T19:02:22+03:00</Time> 
     92      <Time>2015-07-21T17:18:36+03:00</Time> 
    9393    </Item> 
    9494    <Item> 
     
    108108      <Options>None</Options> 
    109109      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\oikeaAla.xnb</Output> 
    110       <Time>2015-05-15T18:59:36+03:00</Time> 
     110      <Time>2015-07-21T18:05:38+03:00</Time> 
    111111    </Item> 
    112112    <Item> 
     
    117117      <Options>None</Options> 
    118118      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\vasenAla.xnb</Output> 
    119       <Time>2015-05-15T18:51:56+03:00</Time> 
     119      <Time>2015-07-21T18:05:38+03:00</Time> 
    120120    </Item> 
    121121    <Item> 
     
    126126      <Options>None</Options> 
    127127      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\vasenYla.xnb</Output> 
    128       <Time>2015-05-15T19:04:24+03:00</Time> 
     128      <Time>2015-07-21T17:18:36+03:00</Time> 
    129129    </Item> 
    130130    <Item> 
     
    171171      <Options>None</Options> 
    172172      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\enkka.xnb</Output> 
    173       <Time>2015-03-26T22:39:22+02:00</Time> 
     173      <Time>2015-07-21T18:18:58+03:00</Time> 
    174174    </Item> 
    175175    <Item> 
     
    360360      <Options>None</Options> 
    361361      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\YlempiOikeaAla.xnb</Output> 
    362       <Time>2015-05-15T18:57:42+03:00</Time> 
     362      <Time>2015-07-21T18:11:06+03:00</Time> 
    363363    </Item> 
    364364    <Item> 
     
    369369      <Options>None</Options> 
    370370      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\YlempiOikeaYla.xnb</Output> 
    371       <Time>2015-05-15T19:01:08+03:00</Time> 
     371      <Time>2015-07-21T18:11:06+03:00</Time> 
    372372    </Item> 
    373373    <Item> 
     
    378378      <Options>None</Options> 
    379379      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\YlempiVasenAla.xnb</Output> 
    380       <Time>2015-05-15T18:53:58+03:00</Time> 
     380      <Time>2015-07-21T18:11:06+03:00</Time> 
    381381    </Item> 
    382382    <Item> 
     
    387387      <Options>None</Options> 
    388388      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\YlempiVasenYla.xnb</Output> 
    389       <Time>2015-05-15T19:03:36+03:00</Time> 
     389      <Time>2015-07-21T18:11:06+03:00</Time> 
    390390    </Item> 
    391391    <Item> 
     
    396396      <Options>None</Options> 
    397397      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\YlempiKeski.xnb</Output> 
    398       <Time>2015-05-08T22:20:44+03:00</Time> 
     398      <Time>2015-07-21T18:11:28+03:00</Time> 
    399399    </Item> 
    400400    <Item> 
     
    441441      <Options>None</Options> 
    442442      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\laatikkoAla.xnb</Output> 
    443       <Time>2015-07-21T11:06:42.3282038+03:00</Time> 
     443      <Time>2015-07-21T11:06:44+03:00</Time> 
    444444    </Item> 
    445445    <Item> 
     
    450450      <Options>None</Options> 
    451451      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\laatikkoYla.xnb</Output> 
    452       <Time>2015-07-21T11:06:07.6962038+03:00</Time> 
     452      <Time>2015-07-21T11:06:08+03:00</Time> 
    453453    </Item> 
    454454    <Item> 
     
    459459      <Options>None</Options> 
    460460      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\kalja.xnb</Output> 
    461       <Time>2015-07-21T10:32:59.5549471+03:00</Time> 
     461      <Time>2015-07-21T16:37:40+03:00</Time> 
    462462    </Item> 
    463463    <Item> 
     
    468468      <Options>None</Options> 
    469469      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\laatikkoYla2.xnb</Output> 
    470       <Time>2015-07-21T11:49:43.7546038+03:00</Time> 
     470      <Time>2015-07-21T11:49:44+03:00</Time> 
    471471    </Item> 
    472472    <Item> 
     
    477477      <Options>None</Options> 
    478478      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\laatikkoAla2.xnb</Output> 
    479       <Time>2015-07-21T11:50:09.9002038+03:00</Time> 
     479      <Time>2015-07-21T11:50:10+03:00</Time> 
    480480    </Item> 
    481481    <Item> 
     
    486486      <Options>None</Options> 
    487487      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\laatikkoAla3.xnb</Output> 
    488       <Time>2015-07-21T13:30:37.3898043+03:00</Time> 
     488      <Time>2015-07-21T13:30:38+03:00</Time> 
    489489    </Item> 
    490490    <Item> 
     
    495495      <Options>None</Options> 
    496496      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\laatikkoYla3.xnb</Output> 
    497       <Time>2015-07-21T13:29:41.9162043+03:00</Time> 
     497      <Time>2015-07-21T13:29:42+03:00</Time> 
    498498    </Item> 
    499499    <BuildSuccessful>true</BuildSuccessful> 
Note: See TracChangeset for help on using the changeset viewer.