Changeset 311


Ignore:
Timestamp:
2009-08-05 14:58:55 (12 years ago)
Author:
tovakosk
Message:

oma peli reitti + tausta

Location:
topias_k/Square Defence beta
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • topias_k/Square Defence beta/Content/Content.contentproj

    r301 r311  
    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>4c76cd4d-ed5a-42de-a37e-049493c5dea6</ProjectGuid> 
     
    3434    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d" /> 
    3535  </ItemGroup> 
     36  <ItemGroup> 
     37    <Compile Include="Tausta.jpg"> 
     38      <Name>Tausta</Name> 
     39      <Importer>TextureImporter</Importer> 
     40      <Processor>TextureProcessor</Processor> 
     41    </Compile> 
     42  </ItemGroup> 
    3643</Project> 
  • topias_k/Square Defence beta/Peli.cs

    r301 r311  
    3232        { 
    3333            Level = Luokentta(); 
    34  
    35  
     34            Level.Background.Image = Content.Load<Texture2D>("tausta"); 
     35            //Level.Background.Scale = 1.3; 
    3636            ajastin = new Timer(); 
    3737            ajastin.Interval = 0.6; 
     
    4848        { 
    4949            Level kentta = new Level(this); 
    50             kentta.BackgroundColor = Color.Aqua; 
     50            //kentta.BackgroundColor = Color.Aqua; 
    5151            return kentta; 
    5252 
     
    5454        void LisaaVihut(Timer sender) 
    5555        { 
     56            //muistilista= 
     57            //reitti loppuun 
     58            //sitten tykit 
     59            //kaikki loput 
     60            
    5661 
    5762            IShape ympyra = Shapes.CreateCircle(15.0); 
    5863            vihu = new PhysicsObject(10.0, ympyra); 
    59             vihu.X = -700; 
    60             vihu.Y = 100; 
     64            vihu.X = Level.Left -30 ; 
     65            vihu.Y = 215; 
    6166            Level.Objects.Add(vihu); 
    6267 
     
    7075            AddCollisionHandler(vihu, Tultiinwaypointille); 
    7176 
    72             waypoint = luoWaypoint(-500, 100, 1); 
    73             waypoint = luoWaypoint(-500, 450, 2); 
     77            waypoint = luoWaypoint(-473, 215, 1); 
     78            waypoint = luoWaypoint(-490, 395, 2); 
    7479            waypoint = luoWaypoint(-250, 450, 3); 
    7580            waypoint = luoWaypoint(-250, 0, 4); 
     
    8893            waypoint = luoWaypoint(50, -400, 3); 
    8994 
    90             reitti = luoreitti(-600, 100, 200, 10); 
     95            
    9196         
    9297         
     
    128133        private PhysicsObject luoWaypoint(int x, int y, double mass) 
    129134        { 
    130             IShape wp = Shapes.CreateRectangle(2.0, 2.0); 
     135            IShape wp = Shapes.CreateRectangle(5.0, 5.0); 
    131136            PhysicsObject waypoint = new PhysicsObject(mass, wp); 
    132137            waypoint.IgnoresCollisionResponse = true; 
     
    138143            return waypoint; 
    139144        } 
    140         private PhysicsObject luoreitti(int x, int y, double u, double i) 
    141         { 
    142             IShape rei = Shapes.CreateRectangle( u, i ); 
    143             PhysicsObject reitti = new PhysicsObject( 1, rei ); 
    144             reitti.IgnoresCollisionResponse = true; 
    145             reitti.Visible = true; 
    146145 
    147             reitti.X = x; 
    148             reitti.Y = y; 
    149             Level.Objects.Add(reitti); 
    150             return reitti; 
    151         } 
    152146 
    153147    } 
Note: See TracChangeset for help on using the changeset viewer.