Changeset 6278 for 2015


Ignore:
Timestamp:
2015-06-24 16:13:00 (4 years ago)
Author:
empaheik
Message:

Ei pitäisi enää kaatua kuolemassa (laitan sormet ristiin).

File:
1 edited

Legend:

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

    r6220 r6278  
    103103    public override void Begin() 
    104104    { 
    105         IntroSequence(); 
     105        //IntroSequence(); 
    106106        //MainMenu(); 
    107         //StartGame(); 
     107        StartGame(); 
    108108    } 
    109109 
     
    231231        CreateLevel(); 
    232232        ScreenSettings(); 
    233  
    234         // Taustatestailua. 
    235         GameObject forestBackground = new GameObject(Level.Width, Level.Height); 
    236         forestBackground.Image = forestBackgroundImage; 
    237         forestBackground.TextureWrapSize = new Vector(5, 1); 
    238         Add(forestBackground, -3); 
    239         Layers[-3].RelativeTransition = new Vector(0.5, 1.0); 
    240         Level.Background.CreateGradient(Color.Black, Color.SkyBlue); 
    241  
    242         // Testailen tässä kärryn luomista. 
    243         //double size = 0.7; 
    244         //PhysicsObject cart = new PhysicsObject(400 * size, 80 * size); 
    245         //cart.X = -1600; 
    246         //cart.Y = 200; 
    247         //cart.Image = cartImage; 
    248         //cart.CollisionIgnoreGroup = 2; 
    249         //Add(cart); 
    250         //PhysicsObject cartWheel = new PhysicsObject(160 * size, 160 * size, Shape.Circle); 
    251         //cartWheel.Image = cartWheelImage; 
    252         //cartWheel.Position = cart.Position + new Vector(-110, -30) * size; 
    253         //cartWheel.CollisionIgnoreGroup = 2; 
    254         //Add(cartWheel); 
    255         //AxleJoint joint = new AxleJoint(cart, cartWheel); 
    256         //Add(joint); 
    257233    } 
    258234 
     
    291267    void CreateLevel() 
    292268    { 
     269        //Background 
     270        GameObject forestBackground = new GameObject(Level.Width, Level.Height); 
     271        forestBackground.Image = forestBackgroundImage; 
     272        forestBackground.TextureWrapSize = new Vector(5, 1); 
     273        Add(forestBackground, -3); 
     274        Layers[-3].RelativeTransition = new Vector(0.5, 1.0); 
     275        Level.Background.CreateGradient(Color.Black, Color.SkyBlue); 
     276 
    293277        Gravity = new Vector(0, -1000); 
    294278 
     279        //Tilemap 
    295280        ColorTileMap level = ColorTileMap.FromLevelAsset("level" + levelNumber); 
    296281        level.SetTileMethod(Color.Black, CreateGroundTop); 
     
    312297        level.Execute(TILE_SIZE, TILE_SIZE); 
    313298 
    314  
    315         //TileMap level = TileMap.FromLevelAsset("level" + levelNumber); 
    316         //level.SetTileMethod('P', CreatePlayer); 
    317         //level.SetTileMethod('#', CreateGroundTop); 
    318         //level.SetTileMethod('%', CreateGround); 
    319         //level.Optimize('#', '%'); 
    320         //level.Execute(TILE_SIZE, TILE_SIZE); 
    321         //Level.CreateBorders(true); 
    322  
    323299        SetControls(); 
    324300    } 
     
    352328    { 
    353329        // Säädin vähän tätä jotta laatikko näkyy hyvin. Pitää ehkä tehdä laatikolle ihan oma metodi. 
    354  
    355330        PhysicsObject block = PhysicsObject.CreateStaticObject(width, height); 
    356331        block.IsVisible = false; 
     
    502477                Loss(); 
    503478            } 
    504             players.Remove(player); player.Destroy(); 
     479            else { players.Remove(player); player.Destroy(); } 
    505480        }; 
    506481 
     
    551526        Keyboard.Listen(Key.A, ButtonState.Down, delegate { startingPlayers[0].Walk(-PLAYER_SPEED); }, "Player 1 moves left"); 
    552527        Keyboard.Listen(Key.D, ButtonState.Down, delegate { startingPlayers[0].Walk(PLAYER_SPEED); }, "Player 1 moves right"); 
    553         Keyboard.Listen(Key.W, ButtonState.Down, delegate { startingPlayers[0].Jump(1000); }, "Player 1 jumps"); 
     528        Keyboard.Listen(Key.W, ButtonState.Down, delegate { startingPlayers[0].Jump(PLAYER_SPEED); }, "Player 1 jumps"); 
    554529 
    555530        Keyboard.Listen(Key.Left, ButtonState.Down, delegate { startingPlayers[1].Walk(-PLAYER_SPEED); }, "Player 2 moves left"); 
    556531        Keyboard.Listen(Key.Right, ButtonState.Down, delegate { startingPlayers[1].Walk(PLAYER_SPEED); }, "Player 2 moves right"); 
    557         Keyboard.Listen(Key.Up, ButtonState.Down, delegate { startingPlayers[1].Jump(1000); }, "Player 2 jumps"); 
     532        Keyboard.Listen(Key.Up, ButtonState.Down, delegate { startingPlayers[1].Jump(PLAYER_SPEED); }, "Player 2 jumps"); 
    558533 
    559534        Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Show help"); 
Note: See TracChangeset for help on using the changeset viewer.