Changeset 599


Ignore:
Timestamp:
2010-06-09 11:57:01 (13 years ago)
Author:
jealmaki
Message:

Tein esineitä

Location:
2010/23/jealmaki/Save The Civilians
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • 2010/23/jealmaki/Save The Civilians/Content/Content.contentproj

    r558 r599  
    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>c64ef9ad-40ab-4916-9f4a-7f3a5d3919dc</ProjectGuid> 
     
    1818    <XnaPlatform>Windows</XnaPlatform> 
    1919  </PropertyGroup> 
    20  <ItemGroup> 
     20  <ItemGroup> 
    2121    <Compile Include="norsu.png"> 
    2222      <Name>norsu</Name> 
     
    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="Hymiö.png"> 
     51      <Name>Hymiö</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/23/jealmaki/Save The Civilians/Peli.cs

    r558 r599  
    1010    { 
    1111        const double nopeus = 200; 
    12         const double hyppyVoima = 40; 
     12        const double hyppyVoima = 5000; 
    1313 
    1414        IntMeter pisteLaskuri; 
     
    2222        protected override void Begin() 
    2323        { 
    24             PhysicsObject pallo = new PhysicsObject( 10.0, 10.0); 
    25             Add( pallo ); 
    2624            kenttaNro = 0; 
    2725            Level.Width = 2000; 
    2826            Level.Height = 1000; 
    2927 
     28 
     29            
     30 
     31             
    3032            // Luodaan pistelaskuri 
    3133            pisteLaskuri = new IntMeter(0); 
     
    4648            seuraavaKentta(); 
    4749            MessageDisplay.Add("Etsi olio!"); 
     50        } 
     51 
     52        void LuoKolmio(double leveys, double korkeus, int x, int y) 
     53        { 
     54            PhysicsObject kolmio = new PhysicsObject(leveys, korkeus); 
     55            kolmio.Shape = Shapes.Triangle; 
     56            kolmio.X = x; 
     57            kolmio.Y = y; 
     58            Add(kolmio); 
    4859        } 
    4960 
     
    6778        { 
    6879            Level.CreateBorders(); 
    69             Level.Background.CreateGradient(Color.Green, Color.Red); 
    70  
    71             lisaaTaso(-200, -350); 
     80            Level.Background.CreateGradient(Color.Green, Color.Black); 
     81            lisaaTaso(100, -300); 
     82            lisaaTaso(100, -200); 
     83            lisaaTaso(100, -100); 
     84            lisaaTaso(-100, -300); 
     85            lisaaTaso(-300, -150); 
     86            lisaaTaso(0, -300); 
    7287            lisaaTaso(0, -200); 
    73  
     88            lisaaTaso(0, -100); 
     89            lisaaTaso(100, -500); 
     90            lisaaTaso(100, -400); 
    7491            lisaaMaali(); 
    7592            lisaaPelaajat(); 
     93            lisaaEsine(); 
     94        } 
     95         
     96        void lisaaEsine() 
     97        { 
     98            PhysicsObject esine = new PhysicsObject(20, 10); 
     99            esine.Shape = Shapes.Rectangle; 
     100 
     101            Add(esine); 
    76102        } 
    77103 
    78104        void lisaaTaso(double x, double y) 
    79105        { 
    80             PhysicsObject taso = PhysicsObject.CreateStaticObject(100, 30); 
    81             taso.Color = Color.Green; 
     106            PhysicsObject taso = PhysicsObject.CreateStaticObject(100, 100); 
     107            taso.Color = Color.Brown; 
    82108            taso.X = x; 
    83109            taso.Y = y; 
    84110            Add(taso); 
    85111        } 
    86  
     112        void lisaaTaso1(double x, double y) 
     113        { 
     114            PhysicsObject taso = PhysicsObject.CreateStaticObject(500,10); 
     115            taso.Color = Color.Brown; 
     116            taso.X = x; 
     117            taso.Y = y; 
     118            Add(taso); 
     119        } 
     120         
    87121        void lisaaPelaajat() 
    88122        { 
    89123            pelaaja1 = new PlatformCharacter(40, 40); 
     124            pelaaja1.Image = LoadImage("hymiö"); 
    90125            pelaaja1.Mass = 4.0; 
    91126            //pelaaja1.; 
    92             pelaaja1.X = 100; 
     127            pelaaja1.X = -100; 
    93128            pelaaja1.Y = Level.Bottom + 120; 
    94129 
     
    100135        void lisaaMaali() 
    101136        { 
    102             PhysicsObject maali = PhysicsObject.CreateStaticObject(50, 50, Shapes.Circle); 
    103             maali.Tag = "maali"; 
    104             maali.IgnoresCollisionResponse = true; 
    105             maali.X = 30; 
    106             maali.Y = -60; 
    107137             
    108             Add(maali); 
    109138        } 
    110139 
     
    118147            Keyboard.Listen(Key.Up, ButtonState.Pressed, hyppaa, "Hyppää", pelaaja1, hyppyVoima); 
    119148 
    120             lisaaGamePadNappaimet(ControllerOne); 
    121149        } 
    122150 
    123         void lisaaGamePadNappaimet(GamePad controller) 
    124         { 
    125             controller.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 
    126  
    127             controller.Listen(Button.DPadLeft, ButtonState.Down, liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); 
    128             controller.Listen(Button.DPadRight, ButtonState.Down, liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 
    129             controller.Listen(Button.A, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", pelaaja1, hyppyVoima); 
    130         } 
     151         
     152   
     153             
     154         
    131155 
    132156        void liikuta(PlatformCharacter hahmo, double nopeus) 
Note: See TracChangeset for help on using the changeset viewer.