Ignore:
Timestamp:
2013-07-23 15:50:47 (6 years ago)
Author:
janiemit
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2013/27/TeemuM/Game/Game/Game/Game.cs

    r4529 r4589  
    1717 
    1818    public static G game; 
     19    Image Background = LoadImage("Ground0"); 
    1920    private IntMeter scoreboard; 
    2021    public Player player { get; private set; } 
     
    186187        Keyboard.Listen(Key.Tab, ButtonState.Pressed, DeveloperCommand, null); 
    187188 
     189        Map(); 
    188190        player = new Player(this, 50, 50, 10, true); 
    189191        player.Dying += GameOver; 
    190192        Add(player); 
    191         Camera.Follow(player); 
     193        //Camera.Follow(player); 
    192194 
    193195        AddScoreMeter(); 
     
    297299    } 
    298300 
     301    public void Map() 
     302    {     
     303        Level.Width = Screen.Width; 
     304        Level.Height = Screen.Height; 
     305 
     306        Surfaces levelBorders = Level.CreateBorders(10, 10, 10); 
     307        levelBorders.Bottom.Color = Color.Aqua; 
     308        levelBorders.Bottom.IgnoresCollisionResponse = true; 
     309        levelBorders.Top.Color = Color.Aqua; 
     310        levelBorders.Top.IgnoresCollisionResponse = true; 
     311        levelBorders.Left.Color = Color.Aqua; 
     312        levelBorders.Left.IgnoresCollisionResponse = true; 
     313        levelBorders.Right.Color = Color.Aqua; 
     314        levelBorders.Right.IgnoresCollisionResponse = true; 
     315         
     316 
     317        Level.Background.Image = Background; 
     318        Level.Background.TileToLevel(); 
     319        Camera.ZoomToLevel(); 
     320    } 
     321 
    299322    void CreateLifeMeter() 
    300323    { 
     
    315338        GameObject layer = new GameObject(Game.Screen.Width + 100, Game.Screen.Height + 100); 
    316339        layer.Color = Color.Transparent; 
    317         layer.Position = player.Position; 
     340        layer.Position = Screen.Center; 
    318341        Add(layer, 1); 
    319342        layer.FadeColorTo(Color.Lerp(Color.Transparent, Color.Black, 0.8), 1.0); 
    320343 
    321344        GameObject txt = new GameObject(987, 248); 
    322         txt.Position = player.Position; 
     345        txt.Position = Level.Center; 
    323346        txt.Image = LoadImage("GameOverImage"); 
    324347        Add(txt, 1); 
    325348 
    326349        PushButton r = new PushButton("Return to menu"); 
    327         r.X = player.X; 
    328         r.Y = player.Y - Screen.Height / 4; 
     350        r.X = Level.Center.X; 
     351        r.Y = Level.Center.Y - Screen.Height / 4; 
    329352        r.Clicked += delegate() {  MainMenu(); }; 
    330353        Add(r, 1); 
Note: See TracChangeset for help on using the changeset viewer.