Changeset 1366 for 2010


Ignore:
Timestamp:
2010-07-28 11:32:04 (9 years ago)
Author:
lesejuku
Message:
 
Location:
2010/30/lesejuku/Somalia 1993
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • 2010/30/lesejuku/Somalia 1993/Content/Content.contentproj

    r1344 r1366  
    1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> 
     1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> 
    22  <PropertyGroup> 
    33    <ProjectGuid>2f5a2ec4-a623-4cb0-a6d1-0a389cadd6d8</ProjectGuid> 
     
    4747    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d" /> 
    4848  </ItemGroup> 
     49  <ItemGroup> 
     50    <Compile Include="Black Hawk.png"> 
     51      <Name>Black Hawk</Name> 
     52      <Importer>TextureImporter</Importer> 
     53      <Processor>TextureProcessor</Processor> 
     54    </Compile> 
     55  </ItemGroup> 
    4956  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    5057  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2010/30/lesejuku/Somalia 1993/Peli.cs

    r1344 r1366  
    33using Jypeli.Widgets; 
    44using Jypeli.Assets; 
     5using Jypeli.Effects; 
    56 
    67public class Tasohyppely : PhysicsGame 
    78{ 
     9    PhysicsObject helikopteri; 
     10    double helikopterinNopeus; 
     11    Image helikopterinKuva = LoadImage("Black Hawk"); 
     12     
    813    protected override void Begin() 
    914    { 
     15        LuoKentta(); 
    1016 
     17         
     18        Gravity = new Vector( 23.0, -800.0 ); 
     19 
     20        Vector impulssi = new Vector(500.0, 0.0); 
     21        helikopteri.Hit(impulssi); 
    1122    } 
    1223 
    1324    void LuoKentta() 
    1425    { 
     26        helikopteri = new PhysicsObject(40.0, 40.0); 
     27        helikopteri.Shape = Shapes.Circle; 
     28        helikopteri.Mass = 10.0; 
     29        helikopteri.Image = helikopterinKuva; 
     30        helikopteri.Color = Color.Gray; 
     31        helikopteri.X = -200.0; 
     32        helikopteri.Y = 0.0; 
     33        helikopterinNopeus = 200; 
     34        helikopteri.Size = new Vector(55, 55); 
     35        Add(helikopteri); 
     36 
     37        AssaultRifle machinegun = new AssaultRifle(20, 20); 
     38        machinegun.Use(); 
     39        Keyboard.Listen( Key.Space, ButtonState.Down, machinegun.Use, "Ammu" ); 
     40        machinegun.Ammo.Value = int.MaxValue; 
     41        machinegun.BulletCollision = LuotiOsuu; 
     42 
     43        int pMaxMaara = 200; 
     44 
     45        //ExplosionSystem rajahdys = new ExplosionSystem(LoadImage("rajahdys_kuva"), pMaxMaara); 
     46        //double x = 0;  
     47        //double y = 0; 
     48        //int pMaara = 50; 
     49        //rajahdys.AddEffect(x, y, pMaara); 
     50         
     51        Level.BackgroundColor = Color.Blue; 
     52        Camera.ZoomToLevel(); 
     53        helikopteri.Restitution = 1.0; 
     54         
     55 
     56    } 
     57     const double pallonNopeus = 500; 
     58 
     59     void LuotiOsuu( PhysicsObject ammus, PhysicsObject kohde) 
     60     { 
     61     } 
     62 
     63    protected override void Update( Time time ) 
     64    { 
     65        if ( helikopteri != null && Math.Abs( helikopteri.Velocity.X ) < helikopterinNopeus ) 
     66        { 
     67            helikopteri.Velocity = new Vector( helikopteri.Velocity.X * 1.1, helikopteri.Velocity.Y ); 
     68        } 
     69 
     70        base.Update( time ); 
    1571    } 
    1672} 
Note: See TracChangeset for help on using the changeset viewer.