Changeset 6217


Ignore:
Timestamp:
2015-06-23 22:41:48 (4 years ago)
Author:
sieerinn
Message:

Kuvia. Kuvia kaikkialla.

Location:
2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun
Files:
126 added
2 edited

Legend:

Unmodified
Added
Removed
  • 2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun.cs

    r6216 r6217  
    7272 
    7373    private Image cartImage = LoadImage("cart"); 
    74     private Image milkImage = LoadImage("tonkka"); 
     74    private Image milkImage = LoadImage("tonkkaitem"); 
    7575     
    7676    private Image cartWheelImage = LoadImage("cartwheel"); 
     
    7979    private Image smokeImage2 = LoadImage("smoke2"); 
    8080 
     81    private Image forestBackgroundImage = LoadImage("forestbackground"); 
     82 
    8183    private Animation crawl; 
    8284    private Animation blaze; 
     85 
     86    private Animation pitchforkAttack; 
     87    private Animation pitchforkWalk; 
     88    private Animation milkThrow; 
     89    private Animation milkWalk; 
     90    private Animation normalWalk; 
     91    private Animation playerIdle; 
    8392    #endregion  
    8493 
     
    91100    public override void Begin() 
    92101    { 
    93         IntroSequence(); 
     102        //IntroSequence(); 
    94103        //MainMenu(); 
    95         //StartGame(); 
     104        StartGame(); 
    96105    } 
    97106 
     
    221230        CreateLevel(); 
    222231        ScreenSettings(); 
     232 
     233        // Taustatestailua. 
     234        GameObject forestBackground = new GameObject(Level.Width, Level.Height); 
     235        forestBackground.Image = forestBackgroundImage; 
     236        forestBackground.TextureWrapSize = new Vector(5, 1); 
     237        Add(forestBackground, -3); 
     238        Layers[-3].RelativeTransition = new Vector(0.5, 1.0); 
     239        Level.Background.CreateGradient(Color.Black, Color.SkyBlue); 
    223240 
    224241        // Testailen tässä kärryn luomista. 
     
    243260        crawl = LoadAnimation("crawl"); 
    244261        blaze = LoadAnimation("flame"); 
     262        pitchforkAttack = LoadAnimation("attack"); 
     263        pitchforkWalk = LoadAnimation("hanko"); 
     264        milkThrow = LoadAnimation("heitto"); 
     265        milkWalk = LoadAnimation("tonkka"); 
     266        normalWalk = LoadAnimation("pwalk"); 
     267        playerIdle = LoadAnimation("idle"); 
    245268    } 
    246269 
     
    285308        //level.SetTileMethod(Color.Azure, CreateDummy, Color.Azure);   //TODO: CreateSmoke 
    286309        //level.SetTileMethod(Color.Orange, CreateDummy, Color.Orange); //TODO: CreateTombstone 
     310        level.Optimize(Color.Black, Color.Brown); 
    287311        level.Execute(TILE_SIZE, TILE_SIZE); 
    288         level.Optimize(Color.Black, Color.Brown); 
     312         
    289313 
    290314        //TileMap level = TileMap.FromLevelAsset("level" + levelNumber); 
     
    419443        player.Position = position + new Vector(0, height * 0.5); 
    420444        player.Color = Color.White; 
     445        player.AnimWalk = new Animation(normalWalk); 
     446        player.AnimIdle = new Animation(playerIdle); 
    421447        players.Add(player); 
    422448        startingPlayers.Add(player); 
     
    427453            billy.Life.Value--; 
    428454 
    429         } 
    430         ); 
     455        }); 
    431456 
    432457        player.Life.LowerLimit += delegate  
     
    460485        if (wheat) 
    461486        { 
    462             GameObject wheatBlock = new GameObject(width * 1.5, height * 3); 
     487            GameObject wheatBlock = new GameObject(width * 1.5, height * 2); 
    463488            wheatBlock.Image = foregroundDecorations[0]; 
    464             wheatBlock.Position = visibleGround.Position; 
     489            wheatBlock.X = visibleGround.X; 
     490            wheatBlock.Bottom = visibleGround.Bottom; 
     491            wheatBlock.TextureWrapSize = new Vector(width / TILE_SIZE, height / TILE_SIZE); 
    465492            Add(wheatBlock, 2); 
    466493        } 
     
    479506    void SetControls() 
    480507    { 
    481         Keyboard.Listen(Key.A, ButtonState.Down, delegate { startingPlayers[0].Walk(-300); }, "Player 1 moves left"); 
    482         Keyboard.Listen(Key.D, ButtonState.Down, delegate { startingPlayers[0].Walk(300); }, "Player 1 moves right"); 
     508        double speed = 180; // TODO: Siirrä tämä johonkin. 
     509        Keyboard.Listen(Key.A, ButtonState.Down, delegate { startingPlayers[0].Walk(-speed); }, "Player 1 moves left"); 
     510        Keyboard.Listen(Key.D, ButtonState.Down, delegate { startingPlayers[0].Walk(speed); }, "Player 1 moves right"); 
    483511        Keyboard.Listen(Key.W, ButtonState.Down, delegate { startingPlayers[0].Jump(1000); }, "Player 1 jumps"); 
    484512 
    485         Keyboard.Listen(Key.Left, ButtonState.Down, delegate { startingPlayers[1].Walk(-300); }, "Player 2 moves left"); 
    486         Keyboard.Listen(Key.Right, ButtonState.Down, delegate { startingPlayers[1].Walk(300); }, "Player 2 moves right"); 
     513        Keyboard.Listen(Key.Left, ButtonState.Down, delegate { startingPlayers[1].Walk(-speed); }, "Player 2 moves left"); 
     514        Keyboard.Listen(Key.Right, ButtonState.Down, delegate { startingPlayers[1].Walk(speed); }, "Player 2 moves right"); 
    487515        Keyboard.Listen(Key.Up, ButtonState.Down, delegate { startingPlayers[1].Jump(1000); }, "Player 2 jumps"); 
    488516 
  • 2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRunContent/HillbillyRunContent.contentproj

    r6216 r6217  
    122122  </ItemGroup> 
    123123  <ItemGroup> 
    124     <Compile Include="tonkka.png"> 
    125       <Name>tonkka</Name> 
     124    <Compile Include="tonkkaitem.png"> 
     125      <Name>tonkkaitem</Name> 
    126126      <Importer>TextureImporter</Importer> 
    127127      <Processor>TextureProcessor</Processor> 
     
    150150    <Compile Include="smoke2.png"> 
    151151      <Name>smoke2</Name> 
     152      <Importer>TextureImporter</Importer> 
     153      <Processor>TextureProcessor</Processor> 
     154    </Compile> 
     155  </ItemGroup> 
     156  <ItemGroup> 
     157    <Compile Include="attack.anim"> 
     158      <Name>attack</Name> 
     159      <Importer>AnimationImporter</Importer> 
     160      <Processor>AnimationContentProcessor</Processor> 
     161    </Compile> 
     162    <Compile Include="hanko.anim"> 
     163      <Name>hanko</Name> 
     164      <Importer>AnimationImporter</Importer> 
     165      <Processor>AnimationContentProcessor</Processor> 
     166    </Compile> 
     167    <Compile Include="heitto.anim"> 
     168      <Name>heitto</Name> 
     169      <Importer>AnimationImporter</Importer> 
     170      <Processor>AnimationContentProcessor</Processor> 
     171    </Compile> 
     172    <Compile Include="pwalk.anim"> 
     173      <Name>pwalk</Name> 
     174      <Importer>AnimationImporter</Importer> 
     175      <Processor>AnimationContentProcessor</Processor> 
     176    </Compile> 
     177    <Compile Include="tonkka.anim"> 
     178      <Name>tonkka</Name> 
     179      <Importer>AnimationImporter</Importer> 
     180      <Processor>AnimationContentProcessor</Processor> 
     181    </Compile> 
     182  </ItemGroup> 
     183  <ItemGroup> 
     184    <Compile Include="box2.png"> 
     185      <Name>box2</Name> 
     186      <Importer>TextureImporter</Importer> 
     187      <Processor>TextureProcessor</Processor> 
     188    </Compile> 
     189  </ItemGroup> 
     190  <ItemGroup> 
     191    <Compile Include="idle.anim"> 
     192      <Name>idle</Name> 
     193      <Importer>AnimationImporter</Importer> 
     194      <Processor>AnimationContentProcessor</Processor> 
     195    </Compile> 
     196  </ItemGroup> 
     197  <ItemGroup> 
     198    <Compile Include="forestbackground.png"> 
     199      <Name>forestbackground</Name> 
    152200      <Importer>TextureImporter</Importer> 
    153201      <Processor>TextureProcessor</Processor> 
Note: See TracChangeset for help on using the changeset viewer.