Changeset 8680 for 2016


Ignore:
Timestamp:
2017-06-14 15:06:27 (12 months ago)
Author:
npo17_1
Message:
 
Location:
2016/koodauskerho/OttoK
Files:
103 added
1 deleted
21 edited

Legend:

Unmodified
Added
Removed
  • 2016/koodauskerho/OttoK/Catboarding/Catboarding/Catboarding/Catboarding.cs

    r8612 r8680  
    66using Jypeli.Effects; 
    77using Jypeli.Widgets; 
    8  
    98public class Catboarding : PhysicsGame 
    109{ 
     
    1211    const double hyppyNopeus = 750; 
    1312    const int RUUDUN_KOKO = 40; 
     13    bool osuu = false; 
    1414 
    1515    PhysicsObject pelaaja1; 
     16    PhysicsObject Kissa; 
    1617 
    1718    Image LumilaudanKuva = LoadImage("Snowboard"); 
    1819    Image tahtiKuva = LoadImage("tahti"); 
    19     Image tkenttäKuva = LoadImage("tkenttä"); 
     20    Image KissanKuva = LoadImage("Cat"); 
    2021 
    2122    SoundEffect maaliAani = LoadSoundEffect("maali"); 
     
    2324    public override void Begin() 
    2425    { 
    25         SmoothTextures = false; 
     26        SmoothTextures = true; 
    2627        Gravity = new Vector(0, -1000); 
    27         Level.CreateBorders(); 
     28        //Level.CreateBorders(); 
    2829 
    2930        LuoKentta(); 
     
    3233        Camera.Follow(pelaaja1); 
    3334        Camera.ZoomFactor = 1.2; 
    34         Camera.ZoomToAllObjects(); 
     35        //Camera.ZoomToAllObjects(); 
    3536        Camera.StayInLevel = true; 
     37        IsFullScreen = true; 
     38        LisaaKissa(172/2, 82/2); 
    3639    } 
    3740 
    3841    void LuoKentta() 
    3942    { 
    40         //TileMap kentta = TileMap.FromLevelAsset("kentta1"); 
    41         //kentta.SetTileMethod('#', LisaaTaso); 
     43        TileMap kentta = TileMap.FromLevelAsset("kentta1"); 
     44        kentta.SetTileMethod('#', LisaaTaso); 
    4245        //kentta.SetTileMethod('*', LisaaTahti); 
    4346        //kentta.SetTileMethod('N', LisaaPelaaja); 
    44         //kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    45         LisaaPelaaja(new Vector(-420,300),50,50); 
    46         Level.Background.CreateGradient(Color.White, Color.SkyBlue); 
     47        LisaaPelaaja(new Vector(-420,30),50,50); 
     48        Level.Background.CreateGradient(Color.LightBlue, Color.SkyBlue); 
    4749 
    48         double[] korkeudet = new double[] { 10, 12, 15, 20, 20, 17, 10, 12, 13, 12, 13, 23, 20, 34, 45, 67, 78, 89, 88, 98, 89, 87, 67, 56, 54,  }; 
    49         Surface maasto = new Surface(1000,korkeudet, 1.0); 
    50         maasto.Y = Level.Bottom + 200; 
     50        double[] korkeudet = new double[] {900, 740, 740, 740, 740, 740, 740, 740, 740, 740, 740, 740, 900}; 
     51        Surface maasto = new Surface(5000,korkeudet, 1.0); 
     52        maasto.Y = 0-350; 
     53        maasto.X = -125; 
    5154        maasto.Color = Color.White; 
    52         maasto.KineticFriction = 0.08; 
    53         maasto.StaticFriction = 0.08; 
     55        maasto.KineticFriction = 0.03; 
     56        maasto.StaticFriction = 0.1; 
    5457     
    5558        Add(maasto); 
     59        Level.Width = maasto.Width; 
     60 
    5661    } 
    5762 
     
    8186        pelaaja1.Image = LumilaudanKuva; 
    8287        pelaaja1.CanRotate = true; 
    83         pelaaja1.MaxAngularVelocity = 15; 
     88        //pelaaja1.MaxAngularVelocity = 15; 
    8489        Add(pelaaja1); 
     90        AddCollisionHandler(pelaaja1, tarkista); 
     91    } 
     92 
     93    void LisaaKissa(double leveys, double korkeus) 
     94    { 
     95        Kissa = new PhysicsObject(leveys, korkeus, Shape.FromImage(KissanKuva)); 
     96        Kissa.Position = new Vector(pelaaja1.X, pelaaja1.Y+20); 
     97        Kissa.Image = KissanKuva; 
     98        Add(Kissa); 
     99        AxleJoint Liitos = new AxleJoint(pelaaja1, Kissa); 
     100        Add(Liitos); 
     101    } 
     102 
     103    protected override void Update(Time time) 
     104    { 
     105        Kissa.Angle = pelaaja1.Angle; 
     106        base.Update(time); 
     107    } 
     108     
     109         
     110 
     111    void tarkista(PhysicsObject p1, PhysicsObject p2) 
     112    { 
     113        osuu = true; 
     114 
    85115    } 
    86116 
     
    118148    void Hyppaa(PhysicsObject hahmo, double nopeus) 
    119149    { 
    120         if(hahmo.Velocity.Y > -5 && hahmo.Velocity.Y < 5) 
    121         hahmo.Hit(new Vector(0, 2000)); 
     150        if(osuu) 
     151        { 
     152            hahmo.Hit(new Vector(0, 2000)); 
     153            osuu = false; 
     154        } 
    122155    } 
    123156 
  • 2016/koodauskerho/OttoK/Catboarding/Catboarding/Catboarding/Catboarding.csproj.Debug.cachefile

    r8612 r8680  
    33Content\kentta1.xnb 
    44Content\Snowboard.xnb 
     5Content\Cat.xnb 
  • 2016/koodauskerho/OttoK/Catboarding/Catboarding/Catboarding/obj/x86/Debug/Catboarding.csproj.FileListAbsolute.txt

    r8612 r8680  
    1111C:\MyTemp\OttoK\Catboarding\Catboarding\Catboarding\obj\x86\Debug\Catboarding.csprojResolveAssemblyReference.cache 
    1212C:\MyTemp\OttoK\Catboarding\Catboarding\Catboarding\bin\x86\Debug\Content\Snowboard.xnb 
     13C:\MyTemp\OttoK\Catboarding\Catboarding\Catboarding\bin\x86\Debug\Content\Cat.xnb 
  • 2016/koodauskerho/OttoK/Catboarding/Catboarding/Catboarding/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r8612 r8680  
    2727      <Options>None</Options> 
    2828      <Output>C:\MyTemp\OttoK\Catboarding\Catboarding\Catboarding\bin\x86\Debug\Content\kentta1.xnb</Output> 
    29       <Time>2017-06-13T11:29:15.7414052+03:00</Time> 
     29      <Time>2017-06-14T11:54:08.9564078+03:00</Time> 
    3030    </Item> 
    3131    <Item> 
     
    3737      <Output>C:\MyTemp\OttoK\Catboarding\Catboarding\Catboarding\bin\x86\Debug\Content\Snowboard.xnb</Output> 
    3838      <Time>2017-06-13T13:34:24.6696596+03:00</Time> 
     39    </Item> 
     40    <Item> 
     41      <Source>Cat.png</Source> 
     42      <Name>Cat</Name> 
     43      <Importer>TextureImporter</Importer> 
     44      <Processor>TextureProcessor</Processor> 
     45      <Options>None</Options> 
     46      <Output>C:\MyTemp\OttoK\Catboarding\Catboarding\Catboarding\bin\x86\Debug\Content\Cat.xnb</Output> 
     47      <Time>2017-06-14T14:00:59.4773567+03:00</Time> 
    3948    </Item> 
    4049    <BuildSuccessful>true</BuildSuccessful> 
  • 2016/koodauskerho/OttoK/Catboarding/Catboarding/Catboarding/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r8612 r8680  
    33Content\kentta1.xnb 
    44Content\Snowboard.xnb 
     5Content\Cat.xnb 
  • 2016/koodauskerho/OttoK/Catboarding/Catboarding/CatboardingContent/CatboardingContent.contentproj

    r8612 r8680  
    6969    </Compile> 
    7070  </ItemGroup> 
     71  <ItemGroup> 
     72    <Compile Include="Cat.png"> 
     73      <Name>Cat</Name> 
     74      <Importer>TextureImporter</Importer> 
     75      <Processor>TextureProcessor</Processor> 
     76    </Compile> 
     77  </ItemGroup> 
    7178  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    7279  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2016/koodauskerho/OttoK/Catboarding/Catboarding/CatboardingContent/kentta1.txt

    r8612 r8680  
    2323 
    2424 
    25 ###########          #####                            #####    # 
    26 #                                            ### 
    27                              #    #                            ######### 
     25 
     26 
     27 
    2828##################################################################################### 
  • 2016/koodauskerho/OttoK/PalikkaPeli/PalikkaPeli/PalikkaPeli/PalikkaPeli.cs

    r8496 r8680  
    7676            Explosion expl = new Explosion(200); 
    7777            expl.Position = kranut[i].Position; 
    78             kranut[i].Destroy(); 
     78            //kranut[i].Destroy(); 
    7979            Add(expl); 
    8080        } 
  • 2016/koodauskerho/OttoK/PalikkaPeli/PalikkaPeli/PalikkaPeli/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r8496 r8680  
    99      <Options>None</Options> 
    1010      <Output>C:\MyTemp\OttoK\PalikkaPeli\PalikkaPeli\PalikkaPeli\bin\x86\Debug\Content\maali.xnb</Output> 
    11       <Time>2017-06-12T09:56:18.4385116+03:00</Time> 
     11      <Time>2017-06-13T09:45:18.0894681+03:00</Time> 
    1212    </Item> 
    1313    <Item> 
     
    1818      <Options>None</Options> 
    1919      <Output>C:\MyTemp\OttoK\PalikkaPeli\PalikkaPeli\PalikkaPeli\bin\x86\Debug\Content\norsu.xnb</Output> 
    20       <Time>2017-06-12T09:56:18.5625896+03:00</Time> 
     20      <Time>2017-06-13T09:45:18.2144698+03:00</Time> 
    2121    </Item> 
    2222    <Item> 
     
    2727      <Options>None</Options> 
    2828      <Output>C:\MyTemp\OttoK\PalikkaPeli\PalikkaPeli\PalikkaPeli\bin\x86\Debug\Content\tahti.xnb</Output> 
    29       <Time>2017-06-12T09:56:18.6705893+03:00</Time> 
     29      <Time>2017-06-13T09:45:18.323847+03:00</Time> 
    3030    </Item> 
    3131    <Item> 
     
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\OttoK\PalikkaPeli\PalikkaPeli\PalikkaPeli\bin\x86\Debug\Content\Palikkakyborgi.xnb</Output> 
    38       <Time>2017-06-12T09:56:18.476391+03:00</Time> 
     38      <Time>2017-06-13T09:45:18.1207179+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    4545      <Options>None</Options> 
    4646      <Output>C:\MyTemp\OttoK\PalikkaPeli\PalikkaPeli\PalikkaPeli\bin\x86\Debug\Content\palikka.xnb</Output> 
    47       <Time>2017-06-12T09:56:18.4455121+03:00</Time> 
     47      <Time>2017-06-13T09:45:18.0894681+03:00</Time> 
    4848    </Item> 
    4949    <Item> 
     
    5454      <Options>None</Options> 
    5555      <Output>C:\MyTemp\OttoK\PalikkaPeli\PalikkaPeli\PalikkaPeli\bin\x86\Debug\Content\Pahispalikka.xnb</Output> 
    56       <Time>2017-06-12T09:56:18.4511599+03:00</Time> 
     56      <Time>2017-06-13T09:45:18.1050928+03:00</Time> 
    5757    </Item> 
    5858    <Item> 
     
    6363      <Options>None</Options> 
    6464      <Output>C:\MyTemp\OttoK\PalikkaPeli\PalikkaPeli\PalikkaPeli\bin\x86\Debug\Content\pommi.xnb</Output> 
    65       <Time>2017-06-12T09:56:18.457393+03:00</Time> 
     65      <Time>2017-06-13T09:45:18.1050928+03:00</Time> 
    6666    </Item> 
    6767    <Item> 
     
    7272      <Options>None</Options> 
    7373      <Output>C:\MyTemp\OttoK\PalikkaPeli\PalikkaPeli\PalikkaPeli\bin\x86\Debug\Content\kentta1.xnb</Output> 
    74       <Time>2017-06-12T09:56:18.4703913+03:00</Time> 
     74      <Time>2017-06-13T09:45:18.1207179+03:00</Time> 
    7575    </Item> 
    7676    <BuildSuccessful>true</BuildSuccessful> 
     
    121121      <Assembly> 
    122122        <Key>C:\WINDOWS\Microsoft.Net\assembly\GAC_32\Microsoft.Xna.Framework.Content.Pipeline\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Content.Pipeline.dll</Key> 
    123         <Value>2017-06-07T09:35:17.6821896+03:00</Value> 
     123        <Value>2017-06-12T10:55:39.9577749+03:00</Value> 
    124124      </Assembly> 
    125125    </Assemblies> 
Note: See TracChangeset for help on using the changeset viewer.