Changeset 6405 for 2015/26


Ignore:
Timestamp:
2015-06-25 22:51:06 (4 years ago)
Author:
sieerinn
Message:

Kuollessa tulee gameover kuva. Kameraongelmia korjailtu.

Location:
2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun
Files:
1 added
3 edited

Legend:

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

    r6404 r6405  
    210210    private Image prisonerImage = LoadImage("prisoner"); 
    211211 
     212    private Image deathImage = LoadImage("loppukuva"); 
     213 
    212214    private Animation crawl; 
    213215    private Animation blaze; 
     
    241243    private double bottomCamLimit; 
    242244 
    243     private int levelNumber = 2; 
     245    private int levelNumber = 0; 
    244246 
    245247    private Action activateBoss; 
     
    350352        Level.Background.Color = Color.DarkBlue; 
    351353 
    352         MultiSelectWindow mainmenu = new MultiSelectWindow("Main menu", 
    353 "Start game", "Credits", "Exit"); 
     354        MultiSelectWindow mainmenu = new MultiSelectWindow("Main menu", "Start game", "Credits", "Exit"); 
    354355        mainmenu.AddItemHandler(0, StartGame); 
    355356        mainmenu.AddItemHandler(1, ShowCredits); 
     
    419420        bottomCamLimit = Level.Bottom + Window.Height / 2.0; 
    420421 
    421         Camera.X = cameraTargetX = leftCamLimit; 
     422        Camera.X = cameraTarget.X = cameraTargetX = leftCamLimit; 
    422423 
    423424        Timer cameraTimer = new Timer(); 
     
    460461 
    461462        //Tilemap 
    462         //ColorTileMap level = ColorTileMap.FromLevelAsset("level" + levelNumber); 
    463         ColorTileMap level = ColorTileMap.FromLevelAsset("bosstest"); 
     463        ColorTileMap level = ColorTileMap.FromLevelAsset("level" + levelNumber); 
     464        //ColorTileMap level = ColorTileMap.FromLevelAsset("bosstest"); 
    464465        level.SetTileMethod(Color.Black, CreateGroundTop); 
    465466        level.SetTileMethod(Color.Brown, CreateGround); 
     
    656657        spike.Image = img; 
    657658        spike.Position = position; 
    658         //spike.Tag = "burn"; 
     659        spike.Y -= (img == spikeImage) ? height * 0.5 : 0.0; 
     660        spike.Tag = "burn"; 
    659661        Add(spike); 
    660662    } 
     
    11511153        AddCollisionHandler(player, "lava", delegate(PhysicsObject p, PhysicsObject t) 
    11521154        { 
    1153             // TODO: Ota alempi rivi pois kommentista. 
    1154             //player.Life.Value = player.Life.MinValue; 
     1155            player.Life.Value = player.Life.MinValue; 
    11551156        }); 
    11561157 
     
    12441245        Keyboard.Listen(Key.Enter, ButtonState.Pressed, GetRidOfImprovement, "Player 1 throws their tools away", startingPlayers[1]); 
    12451246 
     1247        Keyboard.Listen(Key.F9, ButtonState.Pressed, Loss, null); 
    12461248        Keyboard.Listen(Key.F12, ButtonState.Pressed, NextLevel, null); 
    12471249        Keyboard.Listen(Key.R, ButtonState.Pressed, StartGame, null); 
     
    12961298    void Loss() 
    12971299    { 
    1298         //TODO: Sumthin' flashy for our fallen friends. 
    1299         Exit(); 
     1300        ClearAll(); 
     1301        cameraTarget = Camera.Position = Vector.Zero; 
     1302        Level.Background.Color = Color.Black; 
     1303 
     1304        GameObject img = new GameObject(Window.Width * 0.3, Window.Height * 0.5); 
     1305        img.Image = deathImage; 
     1306        Add(img); 
     1307 
     1308        Label gameover = new Label("Game Over"); 
     1309        gameover.Position = new Vector(0, Screen.Top - 150); 
     1310        gameover.TextColor = Color.White; 
     1311        gameover.TextScale *= 3; 
     1312        Add(gameover); 
     1313 
     1314        Keyboard.Listen(Key.Escape, ButtonState.Pressed, StartGame, null); 
    13001315    } 
    13011316 
  • 2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRunContent/HillbillyRunContent.contentproj

    r6404 r6405  
    432432    </Compile> 
    433433  </ItemGroup> 
     434  <ItemGroup> 
     435    <Compile Include="loppukuva.png"> 
     436      <Name>loppukuva</Name> 
     437      <Importer>TextureImporter</Importer> 
     438      <Processor>TextureProcessor</Processor> 
     439    </Compile> 
     440  </ItemGroup> 
    434441  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    435442  <!--  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.