Changeset 2302


Ignore:
Timestamp:
2011-06-29 14:46:54 (12 years ago)
Author:
jahebahu
Message:

Talletus.

Location:
2011/26/HenriH
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • 2011/26/HenriH/Alien Empire/Alien Empire/Alien Empire/Peli.cs

    r2282 r2302  
    1111 
    1212    Image taustakuva = LoadImage("SpaceJAText_Modified"); 
     13    Image taustakuva2 = LoadImage("Space 1"); 
    1314    List<Label> valikonKohdat; 
    1415    PhysicsObject alus1; 
     
    1819    Image kiihdytys1 = LoadImage("alus1_kaasuttaa"); 
    1920    Image kiihdytys2 = LoadImage("alus2_kaasuttaa"); 
    20  
     21    Image plasma_ammus1 = LoadImage("plasma"); 
     22    Image plasma_ammus2 = LoadImage("plasma2"); 
     23    AssaultRifle Plasma1; 
     24    AssaultRifle Plasma2; 
    2125    public override void Begin() 
    2226    { 
    2327        // TODO: Kirjoita ohjelmakoodisi tähän 
    2428        Valikko(); 
    25         IsFullScreen = true; 
    26          
    27  
     29        
    2830    } 
    2931 
     
    3335        valikonKohdat = new List<Label>(); 
    3436 
     37        IsFullScreen = true; 
     38        Level.Background.Image = taustakuva; 
     39        Level.Background.FitToLevel(); 
     40        Camera.ZoomToLevel(); 
     41 
    3542        Label kohta1 = new Label("Aloita uusi peli"); 
    36         kohta1.Position = new Vector(0, 40); 
     43        kohta1.Position = new Vector(0, -80); 
    3744        valikonKohdat.Add(kohta1); 
    3845 
    3946        Label kohta2 = new Label("Lopeta"); 
    40         kohta2.Position = new Vector(0, -40); 
     47        kohta2.Position = new Vector(0, -160); 
    4148        valikonKohdat.Add(kohta2); 
    4249 
     
    6471            else 
    6572            { 
    66                 kohta.TextColor = Color.Black; 
     73                kohta.TextColor = Color.White; 
     74                kohta.Font = Font.DefaultLargeBold; 
    6775            } 
    6876        } 
     
    7583        
    7684        Camera.ZoomToLevel(); 
    77         Level.Background.Image = taustakuva; 
     85        Level.Background.Image = taustakuva2; 
    7886        Level.Background.FitToLevel(); 
    7987        Level.CreateBorders(); 
     
    9098        alus1.Restitution = 0.2; 
    9199        alus2.Restitution = 0.2; 
    92          
     100 
     101        Plasma1 = new AssaultRifle(20, 5); 
     102        Plasma2 = new AssaultRifle(20, 5); 
     103        alus1.Add(Plasma1); 
     104        alus2.Add(Plasma2); 
     105 
    93106        Add(alus1); 
    94107        Add(alus2); 
     
    102115        Keyboard.Listen(Key.W, ButtonState.Released, ajaalus2, null, alus2); 
    103116        Keyboard.Listen(Key.D, ButtonState.Down, kaannaalus4, "Käännä alusta Oikealle.", alus2); 
     117        Keyboard.Listen(Key.RightShift, ButtonState.Down, AmmuAseella, "Ammu pelaajan 1 asetta", Plasma1); 
     118        // Keyboard.Listen(Key.LeftShift, ButtonState.Down, AmmuAseella, "Ammu Pelaajan 2 asetta"); 
     119 
     120 
     121         
    104122    } 
    105123    void kiihdytaalus(PhysicsObject alus) 
     
    142160        alus2.Push(voima); 
    143161    } 
     162    void AmmuAseella(Weapon Plasma1) 
     163    { 
     164        PhysicsObject ammus = Plasma1.Shoot(); 
     165 
     166         
     167 
     168        if (ammus != null) 
     169        { 
     170            ammus.Size *= 3; 
     171            ammus.Image = plasma_ammus1; 
     172            Plasma1.Ammo.Value = 3000; 
     173            Plasma1.ProjectileCollision = AmmusOsui; 
     174        } 
     175    } 
     176    void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 
     177    { 
     178        ammus.Destroy(); 
     179        Explosion rajahdys = new Explosion(15); 
     180        rajahdys.Position = ammus.Position; 
     181        Add(rajahdys); 
     182    } 
    144183 
    145184} 
  • 2011/26/HenriH/Alien Empire/Alien Empire/Alien EmpireContent/Alien EmpireContent.contentproj

    r2282 r2302  
    188188    </Compile> 
    189189  </ItemGroup> 
     190  <ItemGroup> 
     191    <Compile Include="Space 1.png"> 
     192      <Name>Space 1</Name> 
     193      <Importer>TextureImporter</Importer> 
     194      <Processor>TextureProcessor</Processor> 
     195    </Compile> 
     196  </ItemGroup> 
    190197  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    191198  <!--  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.