Changeset 4266 for 2013/26


Ignore:
Timestamp:
2013-06-27 14:51:24 (10 years ago)
Author:
mitaivas
Message:

Talletus.

Location:
2013/26/MaxL/Keulaa2
Files:
8 added
19 edited

Legend:

Unmodified
Added
Removed
  • 2013/26/MaxL/Keulaa2/Keulaa/Keulaa/Keulaa.cs

    r4255 r4266  
    99public class Keulaa : PhysicsGame 
    1010{ 
     11    List<PhysicsObject> tasot = new List<PhysicsObject>(); 
     12     
    1113    Image moponKuva = LoadImage("RM125"); 
    1214    Image rengaskuva = LoadImage("rengas"); 
     
    1921    Image kyparanKuva = LoadImage("Kypara"); 
    2022    Image vartalonKuva = LoadImage("Paita"); 
     23    Image maanKuva = LoadImage("Maa"); 
     24    Image maanAllaKuva = LoadImage("Maanalla"); 
    2125 
    2226    //PhysicsObject Vartalo; 
     
    3337    Vector taakse = new Vector(-5500, 0); 
    3438    double kaasu2 = -50; 
    35      
    36  
     39 
     40    Vector oikeaReuna; 
     41    Vector taustanReuna; 
    3742     
    3843     
    3944    public override void Begin() 
    4045    { 
    41          
     46 
    4247 
    4348        MultiSelectWindow alkuValikko = new MultiSelectWindow("Mopo peli", "Aloita", "Lopeta"); 
     
    4550        LuoOhjaimet(); 
    4651        LuoKentta(); 
    47   
    48         GameObject tausta = new GameObject(Screen.Width, Screen.Height); 
    49         tausta.Image = taustaKuva; 
    50         Add(tausta, -3); 
    51         Layers[-3].RelativeTransition = new Vector(0.5, 0.5); 
    52         GameObject tausta2 = new GameObject(Screen.Width, Screen.Height); 
    53         tausta2.Image = taustaKuva; 
    54         Add(tausta2, -3); 
    55         tausta2.X = tausta.Right; 
    56         GameObject pilvet = new GameObject(Screen.Width, Screen.Height); 
    57         pilvet.Image = pilvenKuva; 
    58         Add(tausta, -2); 
    59         Layers[-2].RelativeTransition = new Vector(0.2, 0.1); 
     52        LuoTausta(); 
     53 
     54        oikeaReuna = new Vector(Level.Right, -560); 
     55        taustanReuna = new Vector(Level.Right, -200); 
     56 
     57        Timer ajastin1 = new Timer(); 
     58        ajastin1.Interval = 0.1; 
     59        ajastin1.Timeout += LisaaTasoja; 
     60        ajastin1.Start(); 
     61 
     62        Timer ajastin2 = new Timer(); 
     63        ajastin2.Interval = 1.5; 
     64        ajastin2.Timeout += LisaaTaustoja; 
     65        ajastin2.Timeout += PoistaTasoja; 
     66        ajastin2.Start(); 
     67 
     68         
     69            
    6070 
    6171        Gravity = new Vector(0, -1000); 
    6272        Camera.Follow(mopo); 
    63          
    64          
     73 
     74 
    6575 
    6676    } 
     
    106116        //PhysicsObject Takarengas = new PhysicsObject(75, 75, Shape.Circle); 
    107117        Takarengas.CollisionIgnoreGroup = 1; 
    108         Takarengas.AngularDamping = 0.7; 
     118        Takarengas.AngularDamping = 0.96; 
    109119        Takarengas.KineticFriction = 1; 
    110120        Takarengas.Image = trengaskuva; 
     
    124134    } 
    125135 
     136    void LisaaTasoja() 
     137    { 
     138        if (Vector.Distance(mopo.Position, oikeaReuna) < 1500) 
     139        { 
     140            LuoTaso(oikeaReuna, 140, 140); 
     141            oikeaReuna.X += 140; 
     142        } 
     143 
     144 
     145    } 
     146 
     147    void PoistaTasoja() 
     148    { 
     149        for (int i = 0; i < tasot.Count; i++) 
     150        { 
     151            if (tasot[i].Right < mopo.X - Screen.Width) 
     152            { 
     153                tasot[i].Destroy(); 
     154                tasot.Remove(tasot[i]); 
     155            } 
     156 
     157        } 
     158     
     159    } 
     160    void LisaaTaustoja() 
     161    { 
     162        LuoTausta(); 
     163        taustanReuna.X += -600; 
     164 
     165    } 
     166 
    126167    void LuoAjaja() 
    127168    { 
     
    129170        Vartalo.Color = Color.Yellow; 
    130171        Vartalo.Y = mopo.Top-10; 
    131         Vartalo.X = -30; 
    132         AxleJoint VartaloLiitos = new AxleJoint(mopo, Vartalo, new Vector(-30, Vartalo.Bottom)); 
     172        Vartalo.X = -25; 
     173        AxleJoint VartaloLiitos = new AxleJoint(mopo, Vartalo, new Vector(-25, Vartalo.Bottom + 10)); 
    133174        Vartalo.Mass = 2; 
    134175        Vartalo.Image = vartalonKuva; 
     
    187228        Keyboard.Listen(Key.Down, ButtonState.Released, JarruPois, "Jarru!", Eturengas); 
    188229 
     230        Keyboard.Listen(Key.T, ButtonState.Pressed, Jarru, null, mopo, 0.0001); 
     231        Keyboard.Listen(Key.T, ButtonState.Released, JarruPois, null, mopo); 
     232 
    189233        Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Lopeta"); 
    190234    } 
     
    203247        PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 
    204248        taso.Position = paikka; 
    205         //taso.Image = groundImage; 
     249        taso.Image = maanKuva; 
    206250        //taso.CollisionIgnoreGroup = 1; 
    207251        Add(taso); 
    208252        taso.KineticFriction = 1; 
    209         PhysicsObject maa = Level.CreateBottomBorder(0.2, true); 
    210         maa.KineticFriction = 1; 
     253        //PhysicsObject maa = Level.CreateBottomBorder(0.2, true); 
     254        //maa.KineticFriction = 1; 
     255         
     256        tasot.Add(taso); 
    211257    } 
    212258 
     
    220266 
    221267        ruudut.Execute(140, 140); 
     268    } 
     269 
     270    void LuoTausta() 
     271    { 
     272        //GameObject tausta = new GameObject(Screen.Width, Screen.Height); 
     273        //tausta.Image = taustaKuva; 
     274        //Add(tausta, -3); 
     275        Level.Background.Image = taustaKuva; 
     276        Level.Background.TileToLevel(); 
     277        //Layers[-3].RelativeTransition = new Vector(0.5, 0.5); 
     278        GameObject pilvet = new GameObject(Screen.Width, Screen.Height); 
     279        pilvet.Image = pilvenKuva; 
     280        Add(pilvet, -2); 
     281        Layers[-2].RelativeTransition = new Vector(0.5, 0.4); 
    222282    } 
    223283 
  • 2013/26/MaxL/Keulaa2/Keulaa/Keulaa/Keulaa.csproj.Debug.cachefile

    r4255 r4266  
    1010Content\Kypara.xnb 
    1111Content\Paita.xnb 
     12Content\Maa.xnb 
     13Content\Maanalla.xnb 
  • 2013/26/MaxL/Keulaa2/Keulaa/Keulaa/obj/x86/Debug/Keulaa.csproj.FileListAbsolute.txt

    r4255 r4266  
    3535C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Kypara.xnb 
    3636C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Paita.xnb 
     37C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Maa.xnb 
     38C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Maanalla.xnb 
  • 2013/26/MaxL/Keulaa2/Keulaa/Keulaa/obj/x86/Debug/cachefile-{716DCBB6-30E1-436E-8D82-85A469FEA5A5}-targetpath.txt

    r4255 r4266  
    1010Content\Kypara.xnb 
    1111Content\Paita.xnb 
     12Content\Maa.xnb 
     13Content\Maanalla.xnb 
  • 2013/26/MaxL/Keulaa2/Keulaa/KeulaaContent/KeulaaContent.contentproj

    r4255 r4266  
    120120    </Compile> 
    121121  </ItemGroup> 
     122  <ItemGroup> 
     123    <Compile Include="Maa.png"> 
     124      <Name>Maa</Name> 
     125      <Importer>TextureImporter</Importer> 
     126      <Processor>TextureProcessor</Processor> 
     127    </Compile> 
     128  </ItemGroup> 
     129  <ItemGroup> 
     130    <Compile Include="Maanalla.png"> 
     131      <Name>Maanalla</Name> 
     132      <Importer>TextureImporter</Importer> 
     133      <Processor>TextureProcessor</Processor> 
     134    </Compile> 
     135  </ItemGroup> 
    122136  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    123137  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2013/26/MaxL/Keulaa2/Keulaa/KeulaaContent/obj/x86/Debug/ContentPipeline.xml

    r4255 r4266  
    1818      <Options>None</Options> 
    1919      <Output>C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Kentta.xnb</Output> 
    20       <Time>2013-06-27T09:40:28.4410222+03:00</Time> 
     20      <Time>2013-06-27T13:31:08.1482222+03:00</Time> 
    2121    </Item> 
    2222    <Item> 
     
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Frame.xnb</Output> 
    38       <Time>2013-06-27T09:40:28.5190222+03:00</Time> 
     38      <Time>2013-06-27T12:04:46.5434222+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    7272      <Options>None</Options> 
    7373      <Output>C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\KeulaTausta.xnb</Output> 
    74       <Time>2013-06-27T09:40:28.3786222+03:00</Time> 
     74      <Time>2013-06-27T14:50:25.7512222+03:00</Time> 
    7575    </Item> 
    7676    <Item> 
     
    9999      <Options>None</Options> 
    100100      <Output>C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Paita.xnb</Output> 
    101       <Time>2013-06-27T10:51:57.3778222+03:00</Time> 
     101      <Time>2013-06-27T11:55:17.8208222+03:00</Time> 
     102    </Item> 
     103    <Item> 
     104      <Source>Maa.png</Source> 
     105      <Name>Maa</Name> 
     106      <Importer>TextureImporter</Importer> 
     107      <Processor>TextureProcessor</Processor> 
     108      <Options>None</Options> 
     109      <Output>C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Maa.xnb</Output> 
     110      <Time>2013-06-27T13:46:06.9112222+03:00</Time> 
     111    </Item> 
     112    <Item> 
     113      <Source>Maanalla.png</Source> 
     114      <Name>Maanalla</Name> 
     115      <Importer>TextureImporter</Importer> 
     116      <Processor>TextureProcessor</Processor> 
     117      <Options>None</Options> 
     118      <Output>C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Maanalla.xnb</Output> 
     119      <Time>2013-06-27T13:35:35.7462222+03:00</Time> 
    102120    </Item> 
    103121    <BuildSuccessful>true</BuildSuccessful> 
Note: See TracChangeset for help on using the changeset viewer.