Changeset 3743


Ignore:
Timestamp:
2012-07-25 14:44:48 (11 years ago)
Author:
anlakane
Message:

Talletus.

Location:
2012/30/JereK
Files:
33 added
3 edited

Legend:

Unmodified
Added
Removed
  • 2012/30/JereK/FysiikkaPeli4/FysiikkaPeli4/FysiikkaPeli4/FysiikkaPeli4.cs

    r3717 r3743  
    2727    public override void Begin() 
    2828    { 
     29        ClearAll(); 
     30 
    2931        pallo = new PhysicsObject(40, 40); 
    3032        Add(pallo); 
     
    4143        alkuValikko.ItemSelected += PainettiinValikonNappia; 
    4244 
    43  
    4445        Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Lopeta peli"); 
    4546 
     
    5253        Add(pelaaja2); 
    5354        pelaaja2.Image = ukeli2; 
    54         pelaaja.Mass = 6; 
    55         pelaaja2.Mass = 6; 
     55        pelaaja.Mass = 5; 
     56        pelaaja2.Mass = 5; 
    5657 
    5758        PhysicsObject mali = PhysicsObject.CreateStaticObject(15.0, 200.0); 
     
    7374        maali.Color = Color.Blue; 
    7475 
    75  
    76  
    7776        PhysicsObject mali2 = PhysicsObject.CreateStaticObject(15.0, 200.0); 
    7877        mali2.Shape = Shape.Rectangle; 
     
    101100        puolustaja2.Mass = 0.2; 
    102101 
    103  
    104102        LuoPisteLaskuri(); 
    105  
    106103 
    107104        FollowerBrain seuraajanAivot = new FollowerBrain(pelaaja2); 
     
    110107        puolustaja.Brain = seuraajanAivot; 
    111108        puolustaja2.Brain = seuraajanAivot2; 
    112         seuraajanAivot2.Speed = 20; 
    113         seuraajanAivot.Speed = 20; 
    114  
    115  
     109        seuraajanAivot2.Speed = 80; 
     110        seuraajanAivot.Speed = 80; 
    116111 
    117112        PhysicsObject maali2 = PhysicsObject.CreateStaticObject(20.0, 180.0); 
     
    128123        AddCollisionHandler(pallo, "maali", PalloKeskelle); 
    129124 
    130         Keyboard.Listen(Key.Left, ButtonState.Down, 
    131           LiikutaPelaajaa, null, new Vector(-1000, 0)); 
    132         Keyboard.Listen(Key.Right, ButtonState.Down, 
    133           LiikutaPelaajaa, null, new Vector(1000, 0)); 
    134         Keyboard.Listen(Key.Up, ButtonState.Down, 
    135           LiikutaPelaajaa, null, new Vector(0, 1000)); 
    136         Keyboard.Listen(Key.Down, ButtonState.Down, 
    137           LiikutaPelaajaa, null, new Vector(0, -1000)); 
    138  
    139         Keyboard.Listen(Key.A, ButtonState.Down, 
    140           LiikutaPelaaja2, null, new Vector(-1000, 0)); 
    141         Keyboard.Listen(Key.D, ButtonState.Down, 
    142           LiikutaPelaaja2, null, new Vector(1000, 0)); 
    143         Keyboard.Listen(Key.W, ButtonState.Down, 
    144           LiikutaPelaaja2, null, new Vector(0, 1000)); 
    145         Keyboard.Listen(Key.S, ButtonState.Down, 
    146           LiikutaPelaaja2, null, new Vector(0, -1000)); 
    147  
    148  
    149  
    150         Level.CreateBorders(false); 
     125        Keyboard.Listen(Key.Left, ButtonState.Down, LiikutaPelaajaa, null, new Vector(-900, 0)); 
     126        Keyboard.Listen(Key.Right, ButtonState.Down, LiikutaPelaajaa, null, new Vector(900, 0)); 
     127        Keyboard.Listen(Key.Up, ButtonState.Down, LiikutaPelaajaa, null, new Vector(0, 900)); 
     128        Keyboard.Listen(Key.Down, ButtonState.Down, LiikutaPelaajaa, null, new Vector(0, -900)); 
     129 
     130        Keyboard.Listen(Key.A, ButtonState.Down, LiikutaPelaaja2, null, new Vector(-900, 0)); 
     131        Keyboard.Listen(Key.D, ButtonState.Down, LiikutaPelaaja2, null, new Vector(900, 0)); 
     132        Keyboard.Listen(Key.W, ButtonState.Down, LiikutaPelaaja2, null, new Vector(0, 900)); 
     133        Keyboard.Listen(Key.S, ButtonState.Down, LiikutaPelaaja2, null, new Vector(0, -900)); 
     134        Keyboard.Listen(Key.R, ButtonState.Pressed, Begin, null); 
     135 
     136        Level.CreateBorders(true); 
     137 
     138        PhysicsObject vasenYlakulma = PhysicsObject.CreateStaticObject(150, 150); 
     139        vasenYlakulma.Angle = Angle.FromDegrees(45); 
     140        vasenYlakulma.Position = new Vector(Level.Left, Level.Top); 
     141        Add(vasenYlakulma); 
     142        vasenYlakulma.Color = Color.Transparent; 
     143 
     144        PhysicsObject oikeaYlakulma = PhysicsObject.CreateStaticObject(150, 150); 
     145        oikeaYlakulma.Angle = Angle.FromDegrees(45); 
     146        oikeaYlakulma.Position = new Vector(Level.Right, Level.Top); 
     147        Add(oikeaYlakulma); 
     148        oikeaYlakulma.Color = Color.Transparent; 
     149 
     150        PhysicsObject alaYlakulma = PhysicsObject.CreateStaticObject(150, 150); 
     151        alaYlakulma.Angle = Angle.FromDegrees(45); 
     152        alaYlakulma.Position = new Vector(Level.Left, Level.Bottom); 
     153        Add(alaYlakulma); 
     154        alaYlakulma.Color = Color.Transparent; 
     155 
     156        PhysicsObject oikeaAlakulma = PhysicsObject.CreateStaticObject(150, 150); 
     157        oikeaAlakulma.Angle = Angle.FromDegrees(45); 
     158        oikeaAlakulma.Position = new Vector(Level.Right, Level.Bottom); 
     159        Add(oikeaAlakulma); 
     160        oikeaAlakulma.Color = Color.Transparent; 
     161 
    151162        Level.Background.Image = taustakuva; 
    152163        Camera.ZoomToLevel(); 
     
    154165        pelaaja.CanRotate = false; 
    155166        pelaaja2.CanRotate = false; 
    156  
    157167    } 
    158168 
  • 2012/30/JereK/ponfs/ponfs/ponfs/ponfs.cs

    r3720 r3743  
    4040        pallo.MomentOfInertia = Double.PositiveInfinity; 
    4141        pallo.Color = Color.Gold; 
     42        pallo.Image = LoadImage("troll"); 
    4243        Add(pallo); 
     44        pallo.CanRotate = false; 
    4345        AddCollisionHandler(pallo, KasittelePallonTormays); 
    4446 
     
    7779        maila.X = x; 
    7880        maila.Y = y; 
    79         maila.Restitution = 1.0; 
     81        maila.Restitution = 1.2; 
    8082        maila.KineticFriction = 0.0; 
    8183        maila.Color = Color.Rose; 
     
    9395    { 
    9496        IntMeter laskuri = new IntMeter(0); 
    95         laskuri.MaxValue = 10; 
     97        laskuri.MaxValue = 666; 
    9698         
    9799        Label naytto = new Label(); 
  • 2012/30/JereK/ponfs/ponfs/ponfsContent/ponfsContent.contentproj

    r3720 r3743  
    4444    <Reference Include="TextFileContentExtension" /> 
    4545  </ItemGroup> 
     46  <ItemGroup> 
     47    <Compile Include="troll.png"> 
     48      <Name>troll</Name> 
     49      <Importer>TextureImporter</Importer> 
     50      <Processor>TextureProcessor</Processor> 
     51    </Compile> 
     52  </ItemGroup> 
    4653  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    4754  <!--  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.