Changeset 8876 for 2017/27


Ignore:
Timestamp:
2017-07-04 13:37:07 (2 years ago)
Author:
npo17_40
Message:
 
Location:
2017/27/EeliN/Selviytyja
Files:
4 added
11 edited

Legend:

Unmodified
Added
Removed
  • 2017/27/EeliN/Selviytyja/Selviytyja/Selviytyja/Selviytyja.cs

    r8864 r8876  
    1111    int Speed = 100; 
    1212    public Image idleRight = LoadImage("PlayerIdleRight_0"); 
    13     public Image puuimg = LoadImage("Tree_0"); 
     13    public Image treeLeaves = LoadImage("TreeLeaves"); 
     14    public Image treeTrunk = LoadImage("TreeTrunk"); 
    1415    public Image stoneimg = LoadImage("Stone_0"); 
    1516    private Image[] playerWalkR = LoadImages("PlayerWalkRight_0","PlayerWalkRight_1"); 
     
    2223        // TODO: Kirjoita ohjelmakoodisi tähän 
    2324        SmoothTextures = false; 
    24         Player ukko = new Player(50, 50); 
     25        Player ukko = new Player(22, 42); 
    2526        //ukko.MakeStatic(); 
    2627        ukko.Image = idleRight; 
     
    3637        //ukko.PlayerWalkL = Animation.Mirror(ukko.PlayerWalkR.cl); 
    3738        ukko.Restitution = 0; 
     39        ukko.MaxVelocity = 0; 
    3840        Level.Background.Color = Color.Black; 
    3941        Add(ukko); 
     
    6567    void MoveSideways(Player pelaaja, Vector direction) 
    6668    { 
    67         pelaaja.Velocity = new Vector(direction.X, pelaaja.Velocity.Y); 
     69        //pelaaja.Velocity = new Vector(direction.X, pelaaja.Velocity.Y); 
    6870        PlayerAnimation(pelaaja, direction); 
     71        pelaaja.Velocity += direction; 
    6972    } 
    7073 
    7174    void MoveVertically(Player pelaaja, Vector direction) 
    7275    { 
    73         pelaaja.Velocity = new Vector(pelaaja.Velocity.X, direction.Y); 
    74  
     76        //pelaaja.Velocity = new Vector(pelaaja.Velocity.X, direction.Y); 
    7577        PlayerAnimation(pelaaja, direction); 
     78        pelaaja.Velocity += direction; 
    7679    } 
    7780 
     
    101104    void LuoKivi(double x,double y) 
    102105    { 
    103         PhysicsObject stone = PhysicsObject.CreateStaticObject(40, 40); 
     106        PhysicsObject stone = PhysicsObject.CreateStaticObject(56, 50); 
    104107        stone.Image = stoneimg; 
    105108        stone.Shape = Shape.Circle; 
     109        stone.Restitution = 0; 
    106110        stone.X = x; 
    107111        stone.Restitution = 0; 
     
    111115        for (int i = 0; i < objektilista.Count-1; i++) 
    112116        { 
    113             if ((stone.Position - objektilista[i].Position).Magnitude < 90 ) 
     117            if ((stone.Position - objektilista[i].Position).Magnitude < 120 ) 
    114118            { 
    115119                objektilista.Remove(stone); 
     
    131135    void LuoPuu(double x, double y) 
    132136    { 
    133         PhysicsObject puu = PhysicsObject.CreateStaticObject(100, 100); 
    134         puu.Image = puuimg; 
     137        Tree puu = new Tree(80, 152); 
     138        puu.MakeStatic(); 
     139        puu.Image = treeTrunk; 
     140        puu.TopImage = treeLeaves; 
     141        puu.Restitution = 0; 
    135142        puu.X = x; 
    136143        puu.Y = y; 
     
    139146        for (int i = 0; i < objektilista.Count - 1; i++) 
    140147        { 
    141             if ((puu.Position - objektilista[i].Position).Magnitude < 90) 
     148            if ((puu.Position - objektilista[i].Position).Magnitude < 120) 
    142149            { 
    143150                objektilista.Remove(puu); 
     
    228235 
    229236} 
     237 
     238 
     239public class Tree : PhysicsObject 
     240{ 
     241    GameObject Lehti; 
     242    PhysicsObject runko; 
     243 
     244    public Image TopImage  
     245        {  
     246        get { return Lehti.Image; }  
     247        set { Lehti.Image = value;} 
     248        } 
     249 
     250 
     251    public Tree(double leveys, double korkeus) 
     252        : base (leveys, korkeus*0.5) 
     253    { 
     254        Lehti = new GameObject(leveys, korkeus*0.5); 
     255        Lehti.Bottom = this.Top; 
     256        this.Add(Lehti); 
     257    } 
     258 
     259} 
  • 2017/27/EeliN/Selviytyja/Selviytyja/Selviytyja/Selviytyja.csproj.Debug.cachefile

    r8864 r8876  
    55Content\Tree_0.xnb 
    66Content\Stone_0.xnb 
     7Content\TreeLeaves.xnb 
     8Content\TreeTrunk.xnb 
  • 2017/27/EeliN/Selviytyja/Selviytyja/Selviytyja/obj/x86/Debug/ContentPipeline-{3B3FCF0A-DF81-4674-AF8D-360E80F14224}.xml

    r8864 r8876  
    5656      <Time>2017-07-04T11:54:41.2164752+03:00</Time> 
    5757    </Item> 
     58    <Item> 
     59      <Source>TreeLeaves.png</Source> 
     60      <Name>TreeLeaves</Name> 
     61      <Importer>TextureImporter</Importer> 
     62      <Processor>TextureProcessor</Processor> 
     63      <Options>None</Options> 
     64      <Output>C:\MyTemp\EeliN\Selviytyja\Selviytyja\Selviytyja\bin\x86\Debug\Content\TreeLeaves.xnb</Output> 
     65      <Time>2017-07-04T13:16:50.7597747+03:00</Time> 
     66    </Item> 
     67    <Item> 
     68      <Source>TreeTrunk.png</Source> 
     69      <Name>TreeTrunk</Name> 
     70      <Importer>TextureImporter</Importer> 
     71      <Processor>TextureProcessor</Processor> 
     72      <Options>None</Options> 
     73      <Output>C:\MyTemp\EeliN\Selviytyja\Selviytyja\Selviytyja\bin\x86\Debug\Content\TreeTrunk.xnb</Output> 
     74      <Time>2017-07-04T13:17:40.2425019+03:00</Time> 
     75    </Item> 
    5876    <BuildSuccessful>true</BuildSuccessful> 
    5977    <Settings> 
  • 2017/27/EeliN/Selviytyja/Selviytyja/Selviytyja/obj/x86/Debug/Selviytyja.csproj.FileListAbsolute.txt

    r8864 r8876  
    1313C:\MyTemp\EeliN\Selviytyja\Selviytyja\Selviytyja\bin\x86\Debug\Content\Tree_0.xnb 
    1414C:\MyTemp\EeliN\Selviytyja\Selviytyja\Selviytyja\bin\x86\Debug\Content\Stone_0.xnb 
     15C:\MyTemp\EeliN\Selviytyja\Selviytyja\Selviytyja\bin\x86\Debug\Content\TreeLeaves.xnb 
     16C:\MyTemp\EeliN\Selviytyja\Selviytyja\Selviytyja\bin\x86\Debug\Content\TreeTrunk.xnb 
  • 2017/27/EeliN/Selviytyja/Selviytyja/Selviytyja/obj/x86/Debug/cachefile-{3B3FCF0A-DF81-4674-AF8D-360E80F14224}-targetpath.txt

    r8864 r8876  
    55Content\Tree_0.xnb 
    66Content\Stone_0.xnb 
     7Content\TreeLeaves.xnb 
     8Content\TreeTrunk.xnb 
  • 2017/27/EeliN/Selviytyja/Selviytyja/SelviytyjaContent/SelviytyjaContent.contentproj

    r8864 r8876  
    8787    </Compile> 
    8888  </ItemGroup> 
     89  <ItemGroup> 
     90    <Compile Include="TreeLeaves.png"> 
     91      <Name>TreeLeaves</Name> 
     92      <Importer>TextureImporter</Importer> 
     93      <Processor>TextureProcessor</Processor> 
     94    </Compile> 
     95  </ItemGroup> 
     96  <ItemGroup> 
     97    <Compile Include="TreeTrunk.png"> 
     98      <Name>TreeTrunk</Name> 
     99      <Importer>TextureImporter</Importer> 
     100      <Processor>TextureProcessor</Processor> 
     101    </Compile> 
     102  </ItemGroup> 
    89103  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    90104  <!--  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.