Changeset 3044 for 2012/24


Ignore:
Timestamp:
2012-06-14 23:17:07 (11 years ago)
Author:
akosrahi
Message:

ampuvan vihun kanssa antaa error coden muuten melkein valmis.
täytyisi velä lisätä vahinko ääni pelaajalle ja se olis siinä :D

Location:
2012/24/AkiR/Fight the Rambo/Fight the Rambo
Files:
6 added
8 edited

Legend:

Unmodified
Added
Removed
  • 2012/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/Fight the Rambo.csproj.Debug.cachefile

    r3042 r3044  
    1313Content\rambo3.xnb 
    1414Content\Nuhasotilas1.xnb 
    15 Content\shit.xnb 
    1615Content\kill.xnb 
    1716Content\GameStarts.xnb 
     
    1918Content\laake.xnb 
    2019Content\tunnari.xnb 
    21 Content\shit.wma 
     20Content\cash.xnb 
     21Content\shit.xnb 
     22Content\bullet.xnb 
     23Content\yappee.xnb 
    2224Content\tunnari.wma 
    2325Content\Nuhasotilas.png 
     
    2628Content\laake.png 
    2729Content\tunnari.mp3 
     30Content\shit.wav 
     31Content\bullet.wav 
    2832Content\tausta.png 
    2933kentta1.txt 
  • 2012/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/Peli.cs

    r3042 r3044  
    1717    GameObject pelaajanpaikka; 
    1818    PlatformCharacter vihollinen; 
     19    PlatformCharacter vihollinen2; 
    1920    PlatformCharacter Maali; 
    2021    PlatformCharacter Piikkilanka; 
     
    3536    SoundEffect eliminointiAani = LoadSoundEffect("kill"); 
    3637    SoundEffect alkuaani = LoadSoundEffect("GameStarts"); 
    37     SoundEffect Ammuskerattu = LoadSoundEffect("yes"); 
     38    SoundEffect Ammuskerattu = LoadSoundEffect("bullet"); 
     39    SoundEffect Kultakerattu = LoadSoundEffect("cash"); 
     40    SoundEffect Yappee = LoadSoundEffect("yappee"); 
    3841     
    3942     
     
    109112        kentta['G'] = lisaaMaali; 
    110113        kentta['E'] = lisaaVihollinen; 
     114        kentta['U'] = lisaaVihollinen2; 
    111115        kentta['#'] = lisaaTaso; 
    112116        kentta['N'] = lisaapelaajanPaikka; 
     
    158162        kentta['G'] = lisaaMaali; 
    159163        kentta['E'] = lisaaVihollinen; 
     164        kentta['U'] = lisaaVihollinen2; 
    160165        kentta['#'] = Lisaamaa; 
    161166        kentta['N'] = lisaapelaajanPaikka; 
     
    220225        pelaaja1.Weapon.ProjectileCollision = AmmusOsui; 
    221226        pelaaja1.Weapon.Ammo.Value = ammukset; 
     227        pelaaja1.Tag = "pelaaja"; 
    222228        pelaaja1.Weapon.Y = -2; 
    223229        pelaaja1.Weapon.X = 2.3; 
     
    235241        AddCollisionHandler(pelaaja1, "vihollinen", CollisionHandler.AddMeterValue(voimaMittari, -10)); 
    236242        AddCollisionHandler(pelaaja1, "Ansa", CollisionHandler.AddMeterValue(voimaMittari, -20)); 
     243         
    237244        
    238245        Vector oikea = new Vector(10000, 50); 
     
    243250        return pelaaja1; 
    244251    } 
     252 
     253    
     254 
    245255 
    246256    void lisaaNappaimet() 
     
    323333        return vihollinen; 
    324334    } 
    325      
    326  
    327     
     335 
     336    PlatformCharacter lisaaVihollinen2() 
     337    { 
     338        PlatformCharacter vihollinen2 = new PlatformCharacter(40, 80); 
     339        vihollinen2.Mass = 3.5; 
     340        vihollinen2.Image = vihollisenkuva; 
     341        vihollinen2.Tag = "vihollinen2"; 
     342        vihollinen2.IgnoresGravity = false; 
     343 
     344        vihollinen2.Weapon = new PlasmaCannon(50, 20); 
     345        vihollinen2.Weapon.ProjectileCollision = AmmusOsuiPelaajaan; 
     346        vihollinen2.Weapon.Y = -2; 
     347        vihollinen2.Weapon.X = 2.3; 
     348 
     349        vihollinen2.LeftIdleAnimation = new Animation(VihollinenpaikallaanVasemmalle); 
     350        vihollinen2.RightIdleAnimation = new Animation(VihollinenpaikallaanOikealle); 
     351        vihollinen2.LeftWalkingAnimation = new Animation(VihollinenKavelyVasemmalle); 
     352        vihollinen2.RightWalkingAnimation = new Animation(VihollinenKavelyOikealle); 
     353        vihollinen2.CanMoveOnAir = true; 
     354        vihollinen2.LeftWalkingAnimation.FPS = 10; 
     355        vihollinen2.RightWalkingAnimation.FPS = 10; 
     356        vihollinen2.LeftIdleAnimation.FPS = 10; 
     357        vihollinen2.RightIdleAnimation.FPS = 10; 
     358 
     359        Timer ajastin = new Timer(); 
     360        ajastin.Interval = 3.5; 
     361        ajastin.Timeout += delegate { VihollinenAmpuu();  }; 
     362        ajastin.Start(); 
     363 
     364 
     365        FollowerBrain seuraajanAivot = new FollowerBrain(); 
     366        seuraajanAivot.Target = pelaaja1; 
     367        seuraajanAivot.Speed = 100; 
     368        seuraajanAivot.StopWhenTargetClose = false; 
     369        seuraajanAivot.TargetFollowDistance = 30; 
     370        seuraajanAivot.FollowAlways = true; 
     371        seuraajanAivot.Active = true; 
     372        vihollinen2.Brain = seuraajanAivot; 
     373 
     374        Vector suunta = (pelaaja1.Position - vihollinen2.Position).Normalize(); 
     375        vihollinen2.Angle = pelaaja1.Angle; 
     376         
     377 
     378        AddCollisionHandler(vihollinen2, "seina", delegate(PhysicsObject tormaaja, PhysicsObject kohde) { vihollinen2.Jump(2000); }); 
     379 
     380 
     381        return vihollinen2; 
     382    } 
     383 
     384    void AmmusOsuiPelaajaan(PhysicsObject Ammus, PhysicsObject Kohde) 
     385    { 
     386        if (Kohde == pelaaja1) 
     387        { 
     388            Ammus.Destroy(); 
     389            voimaMittari.Value += -5; 
     390        } 
     391 
     392    } 
     393 
     394    void VihollinenAmpuu() 
     395    { 
     396       new PhysicsObject VihuAmmus = vihollinen2.Weapon.Shoot(); 
     397         
     398        if (VihuAmmus != null) 
     399        { 
     400            VihuAmmus.Size *= 0.5; 
     401            VihuAmmus.IgnoresGravity = true; 
     402            VihuAmmus.MaximumLifetime = TimeSpan.FromSeconds(4.1); 
     403            AddCollisionHandler(VihuAmmus, AmmusOsuiPelaajaan); 
     404        } 
     405    } 
    328406 
    329407    void KasitteleVihollinenKuoli(PhysicsObject Ammus, PhysicsObject kohde) 
     
    373451    PhysicsObject Lisaalaake() 
    374452    { 
    375         PhysicsObject Laake = new PhysicsObject(70, 30); 
     453        PhysicsObject Laake = new PhysicsObject(50, 40); 
    376454        Laake.Image = laakekuva; 
    377455        Laake.Mass = (50); 
     
    397475        pisteLaskuri.Value += 100; 
    398476        MessageDisplay.Add("100$"); 
     477        Kultakerattu.Play(); 
     478         
    399479        kohde.Destroy(); 
    400480    } 
     
    404484        voimaMittari.Value += 25; 
    405485        MessageDisplay.Add("Terveyttä nostettu"); 
     486        Yappee.Play(); 
    406487        kohde.Destroy(); 
    407488    } 
     
    558639        voimaMittari = new DoubleMeter(100); 
    559640        voimaMittari.MaxValue = 100; 
    560         if (voimaMittari.Value == 100) 
    561         { 
    562             MessageDisplay.Add("Täysi terveys"); 
    563         } 
    564         voimaMittari.LowerLimit += delegate { LopetaPeli(); }; 
     641        voimaMittari.LowerLimit += delegate { LopetaPeli(); };  
    565642 
    566643        ProgressBar voimaPalkki = new ProgressBar(300, 30); 
     
    605682        Begin(); 
    606683    } 
     684 
     685 
     686 
     687    public PhysicsObject VihuAmmus { get; set; } 
    607688} 
  • 2012/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/kentta1.txt

    r3042 r3044  
    11 
    22 
    3                            E                                                                E                                                                                 E 
     3                U           E                                                                E                                                                                 E 
    44 
    55 
     
    1313                                                                        
    1414                                                     MMMMMMMMMMMMMMMMMX          X       E        E  
    15                                                    M M                M     MMMMMMMMMMMMMMMMMMMMMMMX                     
     15               H                                   M M                M     MMMMMMMMMMMMMMMMMMMMMMMX                     
    1616               M    M                        M       M                M              M             MX  E 
    17   N                                                  M                M              M             MMMMMMMMMMM 
     17  N        A                                         M                M              M             MMMMMMMMMMM 
    1818     T T   M                           M             M                M              M                       M 
    1919                         M                           M                MMMM           M        MMMMMMMMMMMMMMMM 
  • 2012/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/obj/x86/Debug/ContentPipeline-{B0E0BEF2-BE44-4A05-9208-56A1391AC4FE}.xml

    r3042 r3044  
    127127      <Output>C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\Nuhasotilas1.xnb</Output> 
    128128      <Time>2012-06-14T16:15:36.1075301+03:00</Time> 
    129     </Item> 
    130     <Item> 
    131       <Source>shit.mp3</Source> 
    132       <Name>shit</Name> 
    133       <Importer>Mp3Importer</Importer> 
    134       <Processor>SongProcessor</Processor> 
    135       <Options>None</Options> 
    136       <Output>C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\shit.xnb</Output> 
    137       <Extra>C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\shit.wma</Extra> 
    138       <Time>2012-06-12T18:18:21.9704673+03:00</Time> 
    139129    </Item> 
    140130    <Item> 
     
    183173      <Extra>C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\tunnari.wma</Extra> 
    184174      <Time>2012-06-14T18:29:38.2805943+03:00</Time> 
     175    </Item> 
     176    <Item> 
     177      <Source>cash.wav</Source> 
     178      <Name>cash</Name> 
     179      <Importer>WavImporter</Importer> 
     180      <Processor>SoundEffectProcessor</Processor> 
     181      <Options>None</Options> 
     182      <Output>C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\cash.xnb</Output> 
     183      <Time>2012-06-14T21:06:20.1320374+03:00</Time> 
     184    </Item> 
     185    <Item> 
     186      <Source>shit.wav</Source> 
     187      <Name>shit</Name> 
     188      <Importer>WavImporter</Importer> 
     189      <Processor>SoundEffectProcessor</Processor> 
     190      <Options>None</Options> 
     191      <Output>C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\shit.xnb</Output> 
     192      <Time>2012-06-14T21:35:29.1296903+03:00</Time> 
     193    </Item> 
     194    <Item> 
     195      <Source>bullet.wav</Source> 
     196      <Name>bullet</Name> 
     197      <Importer>WavImporter</Importer> 
     198      <Processor>SoundEffectProcessor</Processor> 
     199      <Options>None</Options> 
     200      <Output>C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\bullet.xnb</Output> 
     201      <Time>2012-06-14T21:48:49.4997527+03:00</Time> 
     202    </Item> 
     203    <Item> 
     204      <Source>yappee.wav</Source> 
     205      <Name>yappee</Name> 
     206      <Importer>WavImporter</Importer> 
     207      <Processor>SoundEffectProcessor</Processor> 
     208      <Options>None</Options> 
     209      <Output>C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\yappee.xnb</Output> 
     210      <Time>2012-06-14T22:13:54.1859846+03:00</Time> 
    185211    </Item> 
    186212    <BuildSuccessful>true</BuildSuccessful> 
  • 2012/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/obj/x86/Debug/Fight the Rambo.csproj.FileListAbsolute.txt

    r3042 r3044  
    7272C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\kill.xnb 
    7373C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\GameStarts.xnb 
    74 C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\shit.wma 
    7574C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\Nuhasotilas.png 
    7675C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\Ammus.png 
     
    111110C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\tunnari.wma 
    112111C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\tunnari.mp3 
     112C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\cash.xnb 
     113C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\shit.wav 
     114C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\bullet.xnb 
     115C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\bullet.wav 
     116C:\My Temp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\yappee.xnb 
  • 2012/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/obj/x86/Debug/cachefile-{B0E0BEF2-BE44-4A05-9208-56A1391AC4FE}-targetpath.txt

    r3042 r3044  
    1313Content\rambo3.xnb 
    1414Content\Nuhasotilas1.xnb 
    15 Content\shit.xnb 
    16 Content\shit.wma 
    1715Content\kill.xnb 
    1816Content\GameStarts.xnb 
     
    2119Content\tunnari.xnb 
    2220Content\tunnari.wma 
     21Content\cash.xnb 
     22Content\shit.xnb 
     23Content\bullet.xnb 
     24Content\yappee.xnb 
    2325Content\Nuhasotilas.png 
    2426Content\Ammus.png 
     
    2628Content\laake.png 
    2729Content\tunnari.mp3 
     30Content\shit.wav 
     31Content\bullet.wav 
    2832Content\tausta.png 
  • 2012/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the RamboContent/Fight the RamboContent.contentproj

    r3042 r3044  
    5454  </ItemGroup> 
    5555  <ItemGroup> 
    56     <Compile Include="shit.mp3"> 
    57       <Name>shit</Name> 
    58       <Importer>Mp3Importer</Importer> 
    59       <Processor>SongProcessor</Processor> 
    60     </Compile> 
    61   </ItemGroup> 
    62   <ItemGroup> 
    6356    <Compile Include="goal.png"> 
    6457      <Name>goal</Name> 
     
    189182      <Processor>SongProcessor</Processor> 
    190183      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 
     184    </Compile> 
     185  </ItemGroup> 
     186  <ItemGroup> 
     187    <Compile Include="cash.wav"> 
     188      <Name>cash</Name> 
     189      <Importer>WavImporter</Importer> 
     190      <Processor>SoundEffectProcessor</Processor> 
     191    </Compile> 
     192  </ItemGroup> 
     193  <ItemGroup> 
     194    <Compile Include="shit.wav"> 
     195      <Name>shit</Name> 
     196      <Importer>WavImporter</Importer> 
     197      <Processor>SoundEffectProcessor</Processor> 
     198      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 
     199    </Compile> 
     200  </ItemGroup> 
     201  <ItemGroup> 
     202    <Compile Include="bullet.wav"> 
     203      <Name>bullet</Name> 
     204      <Importer>WavImporter</Importer> 
     205      <Processor>SoundEffectProcessor</Processor> 
     206      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 
     207    </Compile> 
     208  </ItemGroup> 
     209  <ItemGroup> 
     210    <Compile Include="yappee.wav"> 
     211      <Name>yappee</Name> 
     212      <Importer>WavImporter</Importer> 
     213      <Processor>SoundEffectProcessor</Processor> 
    191214    </Compile> 
    192215  </ItemGroup> 
Note: See TracChangeset for help on using the changeset viewer.