Changeset 1382 for 2010/30


Ignore:
Timestamp:
2010-07-28 14:56:14 (9 years ago)
Author:
jumakall
Message:

Pallomasiina lisätty
The Bus Gamen pysäkkisysteemi aloitettu

Location:
2010/30/jumakall
Files:
13 added
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • 2010/30/jumakall/The_Bus_Game_codetesting/Content/Content.contentproj

    r1363 r1382  
    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>1700fd4b-6c18-4f1e-9161-155a5e8bd7fd</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="reittivalitsin.png"> 
     38      <Name>reittivalitsin</Name> 
     39      <Importer>TextureImporter</Importer> 
     40      <Processor>TextureProcessor</Processor> 
     41    </Compile> 
     42  </ItemGroup> 
    3643</Project> 
  • 2010/30/jumakall/The_Bus_Game_codetesting/Peli.cs

    r1363 r1382  
    66public class Peli : PhysicsGame 
    77{ 
     8    Image osotinkuva = LoadImage("reittivalitsin"); 
    89 
    910    PhysicsObject osoitin; 
     11    PhysicsObject pallo; 
     12    double palloja; 
     13    double vaihda; 
    1014 
    1115    protected override void Begin() 
     
    1317        osoitin = LuoOsoitin(); 
    1418        Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Sulje"); 
     19        pallo = LuoPallo(); 
     20 
     21        Mouse.Listen(MouseButton.Left, ButtonState.Down, Pam, "Luo räjähdys"); 
     22        Camera.ZoomToLevel(); 
     23        Gravity = new Vector(0.0, -500.0); 
     24        PhysicsObject vasenReuna = Level.CreateLeftBorder(); 
     25        vasenReuna.Restitution = 1.0; 
     26        vasenReuna.IsVisible = false; 
     27        PhysicsObject oikeaReuna = Level.CreateRightBorder(); 
     28        oikeaReuna.Restitution = 1.0; 
     29        oikeaReuna.IsVisible = false; 
     30        PhysicsObject ylaReuna = Level.CreateTopBorder(); 
     31        ylaReuna.Restitution = 1.0; 
     32        ylaReuna.IsVisible = false; 
     33        PhysicsObject alaReuna = Level.CreateBottomBorder(); 
     34        alaReuna.Restitution = 1.0; 
     35        alaReuna.IsVisible = false; 
     36        palloja = 0; 
     37        vaihda = 0; 
    1538    } 
    1639 
     
    1841    { 
    1942        base.Update(time); 
     43 
     44        if (vaihda == 10) 
     45        { 
     46            Level.BackgroundColor = RandomGen.NextColor(); 
     47            vaihda = 0; 
     48        } 
     49        vaihda++; 
     50        if (palloja <= 100) 
     51        { 
     52            LuoPallo(); 
     53            palloja++; 
     54        } 
    2055        if (osoitin != null) 
    2156        { 
     
    2964    PhysicsObject LuoOsoitin() 
    3065    { 
    31         PhysicsObject osoitin = new PhysicsObject(10.0, 10.0); 
     66        PhysicsObject osoitin = new PhysicsObject(25.0, 25.0); 
    3267        osoitin.Shape = Shapes.Circle; 
    3368        osoitin.Color = Color.White; 
     
    3570        osoitin.Y = Mouse.PositionOnScreen.Y; 
    3671        osoitin.Restitution = 1.0; 
     72        osoitin.Image = osotinkuva; 
    3773 
    3874        osoitin.IgnoresCollisionResponse = true; 
     
    4581        return osoitin; 
    4682    } 
     83 
     84    PhysicsObject LuoPallo() 
     85    { 
     86        PhysicsObject pallo = new PhysicsObject(20.00, 20.00); 
     87        pallo.Shape = Shapes.Circle; 
     88        pallo.Position = RandomGen.NextVector(Level.Right, Level.Bottom, Level.Left, Level.Top); 
     89        // RandomGen.NextDouble(Level.Right, Level.Left); RandomGen.NextDouble(Level.Top, Level.Bottom); 
     90        /*pallo.X = 0.0; 
     91        pallo.Y = 0.0;*/ 
     92        pallo.Color = RandomGen.NextColor(); 
     93 
     94        Add(pallo); 
     95 
     96        return pallo; 
     97    } 
     98 
     99    void Pam() 
     100    { 
     101        Explosion rajahdys = new Explosion(100.0); 
     102        rajahdys.Position = Mouse.PositionOnScreen; 
     103        Add(rajahdys); 
     104 
     105        //Lisäasetukset 
     106        // 
     107        //rajahdys.Speed = 500.0; 
     108        //rajahdys.Force = 10000; 
     109        //rajahdys.ShockwaveColor = Color.Yellow; 
     110    } 
    47111} 
Note: See TracChangeset for help on using the changeset viewer.