Changeset 5943


Ignore:
Timestamp:
2015-06-09 14:47:37 (4 years ago)
Author:
lesejuku
Message:
 
Location:
2015/24/LeeviK/AS Bandit Experience
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • 2015/24/LeeviK/AS Bandit Experience/AS Bandit Experience/AS Bandit Experience/AS Bandit Experience.csproj

    r5921 r5943  
    111111  </ItemGroup> 
    112112  <ItemGroup> 
     113    <Compile Include="Ase.cs" /> 
     114    <Compile Include="Loner.cs" /> 
    113115    <Compile Include="Ohjelma.cs" /> 
    114116    <Compile Include="AS_Bandit_Experience.cs" /> 
  • 2015/24/LeeviK/AS Bandit Experience/AS Bandit Experience/AS Bandit Experience/AS Bandit Experience.csproj.Debug.cachefile

    r5921 r5943  
    1 Content\bandit.xnb 
    21Content\death.xnb 
     2Content\banditAKS.xnb 
     3Content\banditNASSE.xnb 
     4Content\lonerAKS.xnb 
     5Content\lonerNASSE.xnb 
     6Content\vodka.xnb 
  • 2015/24/LeeviK/AS Bandit Experience/AS Bandit Experience/AS Bandit Experience/AS_Bandit_Experience.cs

    r5921 r5943  
    99public class AS_Bandit_Experience : PhysicsGame 
    1010{ 
    11     AssaultRifle banditAse; 
    12      
     11    PhysicsObject bandit; 
     12    GameObject banditKadet; 
     13    Ase banditAse; 
     14    bool ladataankoAsetta = false; 
     15    PhysicsObject Vodka; 
     16 
     17    const double HAHMOJEN_LEVEYS = 80; 
     18    const double HAHMOJEN_KORKEUS = 80; 
     19 
    1320    public override void Begin() 
    1421    { 
    15         Level.BackgroundColor = Color.HotPink; 
    16         //ANUUUUU CHEEKI BREEKI IV DAMKE 
    17         IsFullScreen = true; 
     22        Level.Background.Color = Color.HotPink; 
     23        //IsFullScreen = true; 
     24        Mouse.IsCursorVisible = true; 
    1825        //MediaPlayer.Play(""); //CHEEKI BREEKI ATMOSFEARIC MUSIC 
    19          
    20         PhysicsObject bandit = new PhysicsObject(40, 40); 
    21         bandit.Shape = Shape.Circle; 
     26        Camera.Zoom(4.0); 
     27 
     28        Layers[-1].RelativeTransition = new Vector(1.0, 1.0); 
     29 
     30        bandit = new PhysicsObject(HAHMOJEN_LEVEYS, HAHMOJEN_KORKEUS); 
     31        Image PelaajanKuva = LoadImage("banditNASSE"); 
     32       bandit.Shape = Shape.FromImage(PelaajanKuva); 
    2233        bandit.Mass = 8.0; 
    23         Image PelaajanKuva = LoadImage("bandit"); 
    2434        bandit.LinearDamping = 0.75; 
    2535        bandit.Image = PelaajanKuva; 
    2636        Add(bandit); 
    27         banditAse = new AssaultRifle(30, 10); 
    28         banditAse.Ammo.Value = 30; 
     37 
     38        banditKadet = new GameObject(HAHMOJEN_LEVEYS, HAHMOJEN_KORKEUS); 
     39        banditKadet.Shape = Shape.Circle; 
     40        Image KadetKuva = LoadImage("banditAKS"); 
     41        banditKadet.Image = KadetKuva; 
     42        Add(banditKadet, -1); 
     43 
     44 
     45        banditAse = new Ase(HAHMOJEN_LEVEYS, HAHMOJEN_KORKEUS, 30, int.MaxValue, 4.0); //koko, lipaskoko, reserviluodit, latausnopeus 
     46        banditAse.FireRate = 11.6; //metriä sekunnissa 
     47        banditAse.Power.Value = 720; //ensimmäisen luodin lähtönopeus 
     48        banditAse.Power.DefaultValue = 720; //muiden luotien lähtönopeus 
     49        banditAse.AttackSound = null; //väliaikainen 
     50        banditAse.X = -22.0; 
     51        banditAse.Y = -6.5; 
     52        banditAse.Image = null; 
     53        banditAse.IsVisible = false; 
    2954        bandit.Add(banditAse); 
    3055 
    31         //Camera.Follow( bandit ); 
     56        PhysicsObject Vodka = new PhysicsObject(2.5, 9); 
     57        Vodka.Shape = Shape.Circle; 
     58        Vodka.X = 100.0; 
     59        Vodka.Y = 20.0; 
     60        Image vodkaKuva = LoadImage("vodka"); 
     61        Vodka.Image = vodkaKuva; 
     62        Add(Vodka); 
     63 
     64        AddCollisionHandler(bandit, Vodka, ViinaRalli); 
     65        // Camera.Follow(bandit); 
     66 
    3267        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    3368        Keyboard.Listen(Key.A, ButtonState.Down, LiikutaBandit, null, new Vector(-1000, 0), bandit); 
     
    3671        Keyboard.Listen(Key.S, ButtonState.Down, LiikutaBandit, null, new Vector(0, -1000), bandit); 
    3772        Keyboard.Listen(Key.Space, ButtonState.Pressed, bandit.Destroy, null); //Tuhoaa Pelaajan testinä 
     73        Keyboard.Listen(Key.R, ButtonState.Pressed, LataaAse, null, banditAse); 
    3874        Mouse.Listen(MouseButton.Left, ButtonState.Down, AmmuAseella, "Ammu", banditAse); 
     75        Mouse.ListenMovement(0.0, Tahtaa, "Tähtää aseella", bandit); 
    3976 
    40     }    
     77        LuoLoner(new Vector(100.0, 0.0)); 
     78    } 
     79 
     80    protected override void Update(Time time) 
     81    { 
     82        banditKadet.Position = bandit.Position; 
     83        banditKadet.Angle = bandit.Angle; 
     84        base.Update(time); 
     85    } 
    4186 
    4287    void LiikutaBandit(Vector vektori, PhysicsObject bandit) 
     
    4691 
    4792    } 
    48       
     93 
    4994    void AmmuAseella(AssaultRifle ase) 
    5095    { 
     96        if (ladataankoAsetta) return; 
     97 
    5198        PhysicsObject ammus = ase.Shoot(); 
    5299 
    53100        if (ammus != null) 
    54         {    
     101        { 
     102            ammus.Size *= 0.2; 
    55103        } 
    56104    } 
    57105 
    58 } 
     106    void LataaAse(Ase ladattavaAse) 
     107    { 
     108        if (ladataankoAsetta) return; 
     109        ladataankoAsetta = true; 
     110 
     111        Timer.SingleShot(ladattavaAse.ReloadTime, delegate 
     112        { 
     113            ladattavaAse.Reload(); 
     114            ladataankoAsetta = false; 
     115        }); 
     116    } 
     117 
     118    void Tahtaa(AnalogState hiirenliike, PhysicsObject bandit) 
     119    { 
     120        Vector suunta = (Mouse.PositionOnWorld - bandit.AbsolutePosition).Normalize(); 
     121        bandit.Angle = suunta.Angle; 
     122    } 
     123 
     124    Loner LuoLoner(Vector paikka) 
     125    { 
     126        Loner loner = new Loner(HAHMOJEN_LEVEYS, HAHMOJEN_KORKEUS, 100.0, bandit); 
     127        loner.Position = paikka; 
     128        Image VihollisenKuva = LoadImage("lonerNASSE"); 
     129        loner.Image = VihollisenKuva; 
     130        loner.Shape = Shape.FromImage(VihollisenKuva); 
     131        Add(loner); 
     132        return loner; 
     133    } 
     134    void LuoVodka() 
     135    { 
     136 
     137    } 
     138 
     139    void ViinaRalli(PhysicsObject tormaaja, PhysicsObject kohde) 
     140    { 
     141        kohde.Destroy(); 
     142        MessageDisplay.Add("Vodka collected!"); 
     143    } 
    59144 
    60145 
    61  
    62  
    63  
    64  
    65  
    66  
    67  
    68  
    69  
    70  
     146} 
  • 2015/24/LeeviK/AS Bandit Experience/AS Bandit Experience/AS Bandit Experience/obj/x86/Debug/AS Bandit Experience.csproj.FileListAbsolute.txt

    r5921 r5943  
    77C:\MyTemp\LeeviK\AS Bandit Experience\AS Bandit Experience\AS Bandit Experience\obj\x86\Debug\AS Bandit Experience.exe 
    88C:\MyTemp\LeeviK\AS Bandit Experience\AS Bandit Experience\AS Bandit Experience\obj\x86\Debug\AS Bandit Experience.pdb 
    9 C:\MyTemp\LeeviK\AS Bandit Experience\AS Bandit Experience\AS Bandit Experience\bin\x86\Debug\Content\bandit.xnb 
    109C:\MyTemp\LeeviK\AS Bandit Experience\AS Bandit Experience\AS Bandit Experience\bin\x86\Debug\Content\death.xnb 
     10C:\MyTemp\LeeviK\AS Bandit Experience\AS Bandit Experience\AS Bandit Experience\bin\x86\Debug\Content\banditAKS.xnb 
     11C:\MyTemp\LeeviK\AS Bandit Experience\AS Bandit Experience\AS Bandit Experience\bin\x86\Debug\Content\banditNASSE.xnb 
     12C:\MyTemp\LeeviK\AS Bandit Experience\AS Bandit Experience\AS Bandit Experience\bin\x86\Debug\Content\lonerAKS.xnb 
     13C:\MyTemp\LeeviK\AS Bandit Experience\AS Bandit Experience\AS Bandit Experience\bin\x86\Debug\Content\lonerNASSE.xnb 
     14C:\MyTemp\LeeviK\AS Bandit Experience\AS Bandit Experience\AS Bandit Experience\bin\x86\Debug\Content\vodka.xnb 
  • 2015/24/LeeviK/AS Bandit Experience/AS Bandit Experience/AS Bandit Experience/obj/x86/Debug/ContentPipeline-{CF2287A8-9A13-468B-8E64-AE02CEDFA772}.xml

    r5921 r5943  
    22<XnaContent xmlns:Pipeline="Microsoft.Xna.Framework.Content.Pipeline"> 
    33  <Asset Type="Pipeline:BuildItemCollection"> 
    4     <Item> 
    5       <Source>bandit.png</Source> 
    6       <Name>bandit</Name> 
    7       <Importer>TextureImporter</Importer> 
    8       <Processor>TextureProcessor</Processor> 
    9       <Options>None</Options> 
    10       <Output>C:\MyTemp\LeeviK\AS Bandit Experience\AS Bandit Experience\AS Bandit Experience\bin\x86\Debug\Content\bandit.xnb</Output> 
    11       <Time>2015-06-08T14:34:48.4526556+03:00</Time> 
    12     </Item> 
    134    <Item> 
    145      <Source>death.png</Source> 
     
    1910      <Output>C:\MyTemp\LeeviK\AS Bandit Experience\AS Bandit Experience\AS Bandit Experience\bin\x86\Debug\Content\death.xnb</Output> 
    2011      <Time>2015-06-08T14:13:12.3186556+03:00</Time> 
     12    </Item> 
     13    <Item> 
     14      <Source>banditAKS.png</Source> 
     15      <Name>banditAKS</Name> 
     16      <Importer>TextureImporter</Importer> 
     17      <Processor>TextureProcessor</Processor> 
     18      <Options>None</Options> 
     19      <Output>C:\MyTemp\LeeviK\AS Bandit Experience\AS Bandit Experience\AS Bandit Experience\bin\x86\Debug\Content\banditAKS.xnb</Output> 
     20      <Time>2015-06-09T13:09:40.7002246+03:00</Time> 
     21    </Item> 
     22    <Item> 
     23      <Source>banditNASSE.png</Source> 
     24      <Name>banditNASSE</Name> 
     25      <Importer>TextureImporter</Importer> 
     26      <Processor>TextureProcessor</Processor> 
     27      <Options>None</Options> 
     28      <Output>C:\MyTemp\LeeviK\AS Bandit Experience\AS Bandit Experience\AS Bandit Experience\bin\x86\Debug\Content\banditNASSE.xnb</Output> 
     29      <Time>2015-06-09T13:20:45.2766756+03:00</Time> 
     30    </Item> 
     31    <Item> 
     32      <Source>lonerAKS.png</Source> 
     33      <Name>lonerAKS</Name> 
     34      <Importer>TextureImporter</Importer> 
     35      <Processor>TextureProcessor</Processor> 
     36      <Options>None</Options> 
     37      <Output>C:\MyTemp\LeeviK\AS Bandit Experience\AS Bandit Experience\AS Bandit Experience\bin\x86\Debug\Content\lonerAKS.xnb</Output> 
     38      <Time>2015-06-09T13:42:51.9213268+03:00</Time> 
     39    </Item> 
     40    <Item> 
     41      <Source>lonerNASSE.png</Source> 
     42      <Name>lonerNASSE</Name> 
     43      <Importer>TextureImporter</Importer> 
     44      <Processor>TextureProcessor</Processor> 
     45      <Options>None</Options> 
     46      <Output>C:\MyTemp\LeeviK\AS Bandit Experience\AS Bandit Experience\AS Bandit Experience\bin\x86\Debug\Content\lonerNASSE.xnb</Output> 
     47      <Time>2015-06-09T13:42:51.923327+03:00</Time> 
     48    </Item> 
     49    <Item> 
     50      <Source>vodka.png</Source> 
     51      <Name>vodka</Name> 
     52      <Importer>TextureImporter</Importer> 
     53      <Processor>TextureProcessor</Processor> 
     54      <Options>None</Options> 
     55      <Output>C:\MyTemp\LeeviK\AS Bandit Experience\AS Bandit Experience\AS Bandit Experience\bin\x86\Debug\Content\vodka.xnb</Output> 
     56      <Time>2015-06-09T14:18:32.2063339+03:00</Time> 
    2157    </Item> 
    2258    <BuildSuccessful>true</BuildSuccessful> 
  • 2015/24/LeeviK/AS Bandit Experience/AS Bandit Experience/AS Bandit Experience/obj/x86/Debug/cachefile-{CF2287A8-9A13-468B-8E64-AE02CEDFA772}-targetpath.txt

    r5921 r5943  
    1 Content\bandit.xnb 
    21Content\death.xnb 
     2Content\banditAKS.xnb 
     3Content\banditNASSE.xnb 
     4Content\lonerAKS.xnb 
     5Content\lonerNASSE.xnb 
     6Content\vodka.xnb 
  • 2015/24/LeeviK/AS Bandit Experience/AS Bandit Experience/AS Bandit ExperienceContent/AS Bandit ExperienceContent.contentproj

    r5921 r5943  
    4646  </ItemGroup> 
    4747  <ItemGroup> 
    48     <Compile Include="bandit.png"> 
    49       <Name>bandit</Name> 
     48    <Compile Include="death.png"> 
     49      <Name>death</Name> 
    5050      <Importer>TextureImporter</Importer> 
    5151      <Processor>TextureProcessor</Processor> 
     
    5353  </ItemGroup> 
    5454  <ItemGroup> 
    55     <Compile Include="death.png"> 
    56       <Name>death</Name> 
     55    <Compile Include="banditAKS.png"> 
     56      <Name>banditAKS</Name> 
     57      <Importer>TextureImporter</Importer> 
     58      <Processor>TextureProcessor</Processor> 
     59    </Compile> 
     60  </ItemGroup> 
     61  <ItemGroup> 
     62    <Compile Include="banditNASSE.png"> 
     63      <Name>banditNASSE</Name> 
     64      <Importer>TextureImporter</Importer> 
     65      <Processor>TextureProcessor</Processor> 
     66    </Compile> 
     67  </ItemGroup> 
     68  <ItemGroup> 
     69    <Compile Include="lonerAKS.png"> 
     70      <Name>lonerAKS</Name> 
     71      <Importer>TextureImporter</Importer> 
     72      <Processor>TextureProcessor</Processor> 
     73    </Compile> 
     74    <Compile Include="lonerNASSE.png"> 
     75      <Name>lonerNASSE</Name> 
     76      <Importer>TextureImporter</Importer> 
     77      <Processor>TextureProcessor</Processor> 
     78    </Compile> 
     79  </ItemGroup> 
     80  <ItemGroup> 
     81    <Compile Include="vodka.png"> 
     82      <Name>vodka</Name> 
    5783      <Importer>TextureImporter</Importer> 
    5884      <Processor>TextureProcessor</Processor> 
Note: See TracChangeset for help on using the changeset viewer.