Changeset 7019 for 2015/30


Ignore:
Timestamp:
2015-07-24 11:37:22 (8 years ago)
Author:
novaanan
Message:
 
Location:
2015/30/NoelV/peli0.0.0.3/turhakepeli
Files:
4 added
13 edited

Legend:

Unmodified
Added
Removed
  • 2015/30/NoelV/peli0.0.0.3/turhakepeli/turhakepeli/turhakepeli/obj/x86/Debug/cachefile-{8C608BBB-CC9B-467B-9EA1-3FA736E42C66}-targetpath.txt

    r6972 r7019  
    5757Content\hahmo.anim.xnb 
    5858Content\pimeys.xnb 
     59Content\vihunHyokkaus.xnb 
     60Content\tykki.xnb 
    5961Content\pelaaja.png 
    6062Content\valikko.png 
  • 2015/30/NoelV/peli0.0.0.3/turhakepeli/turhakepeli/turhakepeli/obj/x86/Debug/turhakepeli.csproj.FileListAbsolute.txt

    r6972 r7019  
    330330C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\banana.xnb 
    331331C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\pimeys.xnb 
     332C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\vihunHyokkaus.xnb 
     333C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\tykki.xnb 
  • 2015/30/NoelV/peli0.0.0.3/turhakepeli/turhakepeli/turhakepeli/turhakepeli.cs

    r6990 r7019  
    66using Jypeli.Effects; 
    77using Jypeli.Widgets; 
     8 
     9///@author Noel Väänänen 
     10/// <summary> 
     11/// Beer Wizzard 
     12/// </summary> 
    813 
    914public class turhakepeli : PhysicsGame 
     
    5459    Image ammuksenKuva = LoadImage("banana"); 
    5560    Image pimeysKuva = LoadImage("pimeys"); 
     61    Image VihunHyokkaus = LoadImage("vihunHyokkaus"); 
     62    Image TykinKuva = LoadImage("tykki"); 
    5663 
    5764    FollowerBrain seuraajanAivot; 
     
    5966    bool saakoAmpua = true; 
    6067 
    61     bool vihunHyokkausAjastin = true; 
     68    PhysicsObject tykki; 
     69 
     70    //bool vihunHyokkausAjastin = true; 
    6271 
    6372 
     
    7988    Image taustaKuva = LoadImage("maa"); 
    8089    Timer energianKasvattaja; 
     90    Timer TykkiAmpuu; 
    8191 
    8292    public override void Begin() 
    8393    { 
    8494        //SetWindowSize(1900, 1060, false);  
    85         IsFullScreen = false; 
     95        IsFullScreen = true; 
    8696        AloitaPeli(); 
    8797        
     
    173183                AddCollisionHandler(ammus, "manaLaatikko", HyokkausOsuu); 
    174184                AddCollisionHandler(ammus, "muuri", HyokkausOsuu); 
     185                AddCollisionHandler(ammus, "tykki", HyokkausOsuu); 
    175186 
    176187                saakoAmpua = false; 
     
    344355        ruudut.SetTileMethod(new Color(99, 39, 48), LuoPatsaanJalat); 
    345356        ruudut.SetTileMethod(new Color(222, 255, 222), LuoKalja); 
     357        ruudut.SetTileMethod(new Color(110, 160, 160), LuoTykki); 
    346358 
    347359 
     
    371383 
    372384    } 
     385 
     386 
     387 
    373388    void LuoKypara(Vector paikka, double leveys, double korkeus) 
    374389    { 
     
    409424      Add(pisteNaytto); 
    410425  } 
     426 
     427  void LuoTykki(Vector paikka, double leveys, double korkeus) 
     428  { 
     429      tykki = new PhysicsObject(leveys, korkeus); 
     430      tykki.Position = paikka; 
     431      tykki.Image = TykinKuva; 
     432      tykki.MakeStatic(); 
     433      tykki.Tag = "tykki"; 
     434      Add(tykki); 
     435 
     436       
     437 
     438      TykkiAmpuu = new Timer(); 
     439      TykkiAmpuu.Interval = 2.5; 
     440 
     441      TykkiAmpuu.Timeout += delegate { AmmuTykilla(); }; 
     442 
     443      TykkiAmpuu.Start(); 
     444 
     445       
     446 
     447  } 
     448 
     449  void AmmuTykilla() 
     450  { 
     451      LuoTykinAmmus(new Vector(0, 10000)); 
     452      LuoTykinAmmus(new Vector(0, -10000)); 
     453      LuoTykinAmmus(new Vector(10000, 0)); 
     454      LuoTykinAmmus(new Vector(-10000, 0)); 
     455  } 
     456 
     457 
     458 
     459  void LuoTykinAmmus(Vector ammuksenSuunta) 
     460  { 
     461      PhysicsObject tykinAmmus = new PhysicsObject(20, 20); 
     462      tykinAmmus.Position = tykki.Position; 
     463      tykinAmmus.Tag = "vihunHyokkaus"; 
     464      tykinAmmus.LifetimeLeft = TimeSpan.FromSeconds(1.5); 
     465      tykinAmmus.CanRotate = false; 
     466      tykinAmmus.IgnoresCollisionResponse = true; 
     467      tykinAmmus.Image = VihunHyokkaus; 
     468      Add(tykinAmmus, -3); 
     469      tykinAmmus.Push(ammuksenSuunta); 
     470 
     471      AddCollisionHandler(tykinAmmus, "muuri", HyokkausOsuu); 
     472 
     473  } 
     474 
     475    
    411476 
    412477    void LuoAlaseina(Vector paikka, double leveys, double korkeus) 
     
    569634    hitbox.X = pelaaja.X; 
    570635    hitbox.Tag = "pelaajaHitbox"; 
    571     //hitbox.Color = Color.Transparent; 
     636    hitbox.Color = Color.Transparent; 
    572637    hitbox.CollisionIgnoreGroup = 5; 
    573638    //hitbox.Image = hyokkauksenKuva; 
     
    632697        vihollinen.Restitution = 0.0; 
    633698        vihollinen.Tag = "vihu"; 
     699        bool vihunHyokkausAjastin = true; 
    634700        //vihollinen.Color = Color.Red; 
    635701        //vihollinen.Color = new Color(63, 0, 63); 
     
    639705        seuraajanAivot.Speed = 70.0; 
    640706        seuraajanAivot.DistanceFar = 500; 
    641         seuraajanAivot.DistanceClose = 60; 
     707        seuraajanAivot.DistanceClose = 65; 
    642708        seuraajanAivot.TurnWhileMoving = false; 
    643709 
     
    648714            if (vihunHyokkausAjastin == true) 
    649715            { 
    650                 PhysicsObject vihunHyokkaus = new PhysicsObject(100, 100); 
     716                PhysicsObject vihunHyokkaus = new PhysicsObject(140, 140); 
    651717                vihunHyokkaus.Position = vihollinen.Position; 
    652718                vihunHyokkaus.Tag = "vihunHyokkaus"; 
    653719                vihunHyokkaus.LifetimeLeft = TimeSpan.FromSeconds(0.5); 
    654                 Add(vihunHyokkaus); 
    655  
     720                vihunHyokkaus.CanRotate = false; 
     721                vihunHyokkaus.IgnoresCollisionResponse = true; 
     722                vihunHyokkaus.Shape = Shape.Circle; 
     723                vihunHyokkaus.Image = VihunHyokkaus; 
     724                Add(vihunHyokkaus, -3); 
     725                AxleJoint liitos = new AxleJoint(vihollinen, vihunHyokkaus); 
    656726                vihunHyokkausAjastin = false; 
    657  
    658                 Timer.SingleShot(0.5, delegate { vihunHyokkausAjastin = true; }); 
     727                Timer.SingleShot(0.9, delegate { vihunHyokkausAjastin = true; }); 
    659728            } 
    660729         
     
    888957            hyokkaus.Destroy(); 
    889958        } 
     959        if (kohde.Tag.Equals("muuri")) 
     960        { 
     961            hyokkaus.Destroy(); 
     962        } 
     963        if (hyokkaus.Tag.Equals("ammus")) 
     964        { 
     965            if (kohde.Tag.Equals("tykki")) 
     966            { 
     967                hyokkaus.Destroy(); 
     968            } 
     969        } 
     970 
    890971 
    891972 
     
    903984        if ((kohde as Vihu).ElamaLaskuri.Value <= 0) 
    904985        { 
    905             //4LuoEnkka(kohde.Position, 60, 60); 
     986            //LuoEnkka(kohde.Position, 60, 60); 
    906987            kohde.Destroy(); 
    907988            vihollistenMaara.Value--; 
     
    10281109        Mouse.IsCursorVisible = false; 
    10291110 
    1030         if (kenttaNro == 1) LuoKentta("kentta02"); 
     1111        if (kenttaNro == 1) LuoKentta("kentta"); 
    10311112        else if (kenttaNro == 2) LuoKentta("kentta02"); 
    10321113        else if (kenttaNro == 3) LuoKentta("kentta03"); 
     
    10941175 
    10951176            
    1096             enkkaLaskuri.Value--; 
     1177            enkkaLaskuri.Value -= 5; 
    10971178            //vihu.Stop(); 
    10981179         } 
  • 2015/30/NoelV/peli0.0.0.3/turhakepeli/turhakepeli/turhakepeli/turhakepeli.csproj.Debug.cachefile

    r6972 r7019  
    5757Content\hahmo.anim.xnb 
    5858Content\pimeys.xnb 
     59Content\vihunHyokkaus.xnb 
     60Content\tykki.xnb 
    5961Content\pelaaja.png 
    6062Content\valikko.png 
  • 2015/30/NoelV/peli0.0.0.3/turhakepeli/turhakepeli/turhakepeliContent/obj/x86/Debug/ContentPipeline.xml

    r6972 r7019  
    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-23T11:12:41.8391906+03:00</Time> 
     11      <Time>2015-07-24T10:40:05.4636776+03:00</Time> 
    1212    </Item> 
    1313    <Item> 
     
    523523      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\pimeys.xnb</Output> 
    524524      <Time>2015-07-23T11:41:36.0098395+03:00</Time> 
     525    </Item> 
     526    <Item> 
     527      <Source>vihunHyokkaus.png</Source> 
     528      <Name>vihunHyokkaus</Name> 
     529      <Importer>TextureImporter</Importer> 
     530      <Processor>TextureProcessor</Processor> 
     531      <Options>None</Options> 
     532      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\vihunHyokkaus.xnb</Output> 
     533      <Time>2015-07-24T09:53:22.2040726+03:00</Time> 
     534    </Item> 
     535    <Item> 
     536      <Source>tykki.png</Source> 
     537      <Name>tykki</Name> 
     538      <Importer>TextureImporter</Importer> 
     539      <Processor>TextureProcessor</Processor> 
     540      <Options>None</Options> 
     541      <Output>C:\MyTemp\NoelV\peli0.0.0.3\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\tykki.xnb</Output> 
     542      <Time>2015-07-24T11:12:36.4855267+03:00</Time> 
    525543    </Item> 
    526544    <BuildSuccessful>true</BuildSuccessful> 
  • 2015/30/NoelV/peli0.0.0.3/turhakepeli/turhakepeli/turhakepeliContent/turhakepeliContent.contentproj

    r6972 r7019  
    465465    </Compile> 
    466466  </ItemGroup> 
     467  <ItemGroup> 
     468    <Compile Include="vihunHyokkaus.png"> 
     469      <Name>vihunHyokkaus</Name> 
     470      <Importer>TextureImporter</Importer> 
     471      <Processor>TextureProcessor</Processor> 
     472    </Compile> 
     473  </ItemGroup> 
     474  <ItemGroup> 
     475    <Compile Include="tykki.png"> 
     476      <Name>tykki</Name> 
     477      <Importer>TextureImporter</Importer> 
     478      <Processor>TextureProcessor</Processor> 
     479    </Compile> 
     480  </ItemGroup> 
    467481  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    468482  <!--  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.