Changeset 6767 for 2015/27


Ignore:
Timestamp:
2015-07-02 17:00:02 (4 years ago)
Author:
sieerinn
Message:

Pelin viimeistelyä.

Location:
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/Exit.cs

    r6717 r6767  
    2121        : base(width, height) 
    2222    { 
     23        IsVisible = false; 
    2324        //Color = new Color(255, 0, 0, 60); // Debuggausta varten jotta näkee uloskäynnit. 
    2425        IgnoresCollisionResponse = true; 
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/Item.cs

    r6717 r6767  
    265265                    } 
    266266 
     267                    if (o.Tag.Equals("cracked")) 
     268                    { 
     269                        o.Destroy(); 
     270                    } 
     271 
    267272                    var cre = o as Creature; 
    268273                    if (cre != null) 
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/LevelCreation.cs

    r6717 r6767  
    4040        level.SetObjectMethod("bossspawn", CreateBossSpawn); 
    4141        level.SetObjectMethod("itemdrop", CreateItem); 
     42        level.SetObjectMethod("cracked", CreateCrackedWall); 
     43        level.SetObjectMethod("goldenheart", CreateGoldenHeart); 
    4244        level.Execute(); 
    4345 
    44        // Level.CreateBorders(false); 
     46        Level.CreateBorders(false); 
    4547 
    4648        Level.Background.Color = Color.Black; 
     49    } 
     50 
     51    private void CreateGoldenHeart(Vector position, double width, double height, Angle angle, Shape shape, string name, Dictionary<string, string> properties) 
     52    { 
     53        var chest = PhysicsObject.CreateStaticObject(width, height); 
     54        chest.Image = ChestImage; 
     55        chest.IgnoresCollisionResponse = true; 
     56        chest.Position = position; 
     57        chest.Tag = "chest"; 
     58        Add(chest); 
     59    } 
     60 
     61    private void CreateCrackedWall(Vector position, double width, double height, Angle angle, Shape shape, string name, Dictionary<string, string> properties) 
     62    { 
     63        var tile = PhysicsObject.CreateStaticObject(width, height); 
     64        tile.Tag = "cracked"; 
     65        tile.Image = crackedWallImage; 
     66        tile.Position = position; 
     67        Add(tile); 
    4768    } 
    4869 
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel.cs

    r6717 r6767  
    9292    public static SoundEffect GunSound = LoadSoundEffect("gunsound"); 
    9393    public static SoundEffect EnemyDieSound = LoadSoundEffect("enemydie"); 
     94    public static SoundEffect ChestOpenSound = LoadSoundEffect("chestopen2"); 
    9495 
    9596    public static Image GunImage = LoadImage("gun"); 
     
    106107    public static Image MaskImage = LoadImage("helm"); 
    107108    public static Image MaskLargeImage = LoadImage("helmlarge"); 
     109    public static Image GoldenHeartImage = LoadImage("goldenheart"); 
     110    public static Image ChestImage = LoadImage("chest"); 
     111    public static Image ChestOpenImage = LoadImage("chestopen"); 
     112 
     113    public static Image crackedWallImage = LoadImage("cracked"); 
    108114 
    109115    public static Image GrenadeBoxImage = LoadImage("grenadebox"); 
     
    303309        "Coyotes on a train.", 
    304310        "Coyotes on a train, that's all I'm sayin'", 
    305         "-Ana" 
     311        "-Gabriel" 
    306312        }), LetterImage)); 
    307313 
    308         //ShowTextItem(storyItems[0]); 
     314        ShowTextItem(storyItems[0]); 
    309315    } 
    310316 
     
    380386 
    381387        player.Inventory.Add(new Monocle(player)); 
    382  
     388         
    383389        //player.Sword = new Sword(player); 
    384390        //player.Inventory.Add(new Pistol(player)); 
    385391        //player.Inventory.Add(new Grenade(player)); 
    386392 
    387         //player.Health.Value = 3; // Alkuun vain kolme sydäntä. 
    388         player.Health.Value = player.Health.MaxValue = 100; 
     393        player.Health.Value = 5; 
     394        //player.Health.Value = player.Health.MaxValue = 100; 
    389395 
    390396        AddCollisionHandler(player, "exit", CollidesWithExit); 
     
    436442            UpdateItemCycleImages(); 
    437443        }); 
    438     } 
    439  
     444 
     445        AddCollisionHandler(player, "chest", delegate(PhysicsObject p, PhysicsObject chest) 
     446        { 
     447            // Arkusta saa nyt aina uuden sydämen. 
     448            ChestOpenSound.Play(); 
     449            chest.Tag = null; 
     450 
     451            Timer.SingleShot(1.0, delegate 
     452            { 
     453                chest.Image = ChestOpenImage; 
     454 
     455                var heart = PhysicsObject.CreateStaticObject(20, 20); 
     456                heart.IgnoresCollisionResponse = true; 
     457                heart.Image = GoldenHeartImage; 
     458                heart.Position = chest.Position; 
     459                heart.Velocity = new Vector(0, 14); 
     460                heart.LifetimeLeft = TimeSpan.FromSeconds(2.0); 
     461                Add(heart, 3); 
     462 
     463                player.Health.Value++; 
     464            }); 
     465        }); 
     466    } 
    440467 
    441468    void StoryTime(PhysicsObject pPlayer, PhysicsObject storyBlock) 
     
    457484        { 
    458485            player.Sword = new Sword(player); 
     486            UpdateItemCycleImages(); 
    459487        } 
    460488 
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabrielContent/TheLegendOfGabrielContent.contentproj

    r6717 r6767  
    391391    </Compile> 
    392392  </ItemGroup> 
     393  <ItemGroup> 
     394    <Compile Include="cracked.png"> 
     395      <Name>cracked</Name> 
     396      <Importer>TextureImporter</Importer> 
     397      <Processor>TextureProcessor</Processor> 
     398    </Compile> 
     399  </ItemGroup> 
     400  <ItemGroup> 
     401    <Compile Include="chestopen2.wav"> 
     402      <Name>chestopen2</Name> 
     403      <Importer>WavImporter</Importer> 
     404      <Processor>SoundEffectProcessor</Processor> 
     405    </Compile> 
     406  </ItemGroup> 
     407  <ItemGroup> 
     408    <Compile Include="chest.png"> 
     409      <Name>chest</Name> 
     410      <Importer>TextureImporter</Importer> 
     411      <Processor>TextureProcessor</Processor> 
     412    </Compile> 
     413    <Compile Include="chestopen.png"> 
     414      <Name>chestopen</Name> 
     415      <Importer>TextureImporter</Importer> 
     416      <Processor>TextureProcessor</Processor> 
     417    </Compile> 
     418  </ItemGroup> 
    393419  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    394420  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabrielContent/level1.tmx

    r6716 r6767  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <map version="1.0" orientation="orthogonal" renderorder="right-down" width="25" height="40" tilewidth="20" tileheight="20" nextobjectid="45"> 
     2<map version="1.0" orientation="orthogonal" renderorder="right-down" width="25" height="40" tilewidth="20" tileheight="20" nextobjectid="46"> 
    33 <tileset firstgid="1" source="LegendOfGabrielTileset.tsx"/> 
    44 <layer name="base" width="25" height="40"> 
    55  <data encoding="base64" compression="zlib"> 
    6    eJztkzEKgDAMRYtDnRx6A+9/yiI4hFKTqP+nUDq8ySSP/sSSUiqCXVBIXLNP4cgCT3+vLjccgvab5nqq7eFx/CXCsVgs5mG7Yc9nOdjzR7yB4WFnNGofETth5zaDY8b/EH1DjJvqzYxwIDP/6rDqEdlrfajdav2o7CNv8E1mCId1Fx6P9QbvjtAO7RZaXwXySxdC 
     6   eJztk7EKwCAMRKWDnTq4dPb/v7IUOgSxMbV3EcThTcY8vMQUQkiCXZA6OA01d+8sHFFgcdTqYsEhKM8011ttDYvjLx6OxWIxD9sDuz/Lwe4/4g0MDzujUfPwmAk7txkcM/5D9A4xdqrW08OBzLzX0apHZK/dQ81Wu4/K3nMHv2SGcLT2wuJpvcE6I7RD24XSdwE+6hdH 
    77  </data> 
    88 </layer> 
     
    5656 <layer name="cover" width="25" height="40"> 
    5757  <data encoding="base64" compression="zlib"> 
    58    eJztzQEJAAAIA7BXsH9ZscRB2Aos+WdKR+MBAACAs/s2ADQ= 
     58   eJztzaENAAAMAkFW6P7L1lc3qLvkLSS/5nmv/TEnAAAAaFjujwBn 
    5959  </data> 
    6060 </layer> 
     61 <objectgroup color="#ebdb23" name="goldenheart"> 
     62  <object id="45" x="40" y="540" width="20" height="20"/> 
     63 </objectgroup> 
    6164</map> 
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabrielContent/level2.tmx

    r6717 r6767  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <map version="1.0" orientation="orthogonal" renderorder="right-down" width="25" height="25" tilewidth="20" tileheight="20" nextobjectid="12"> 
     2<map version="1.0" orientation="orthogonal" renderorder="right-down" width="25" height="25" tilewidth="20" tileheight="20" nextobjectid="24"> 
    33 <tileset firstgid="1" source="LegendOfGabrielTileset.tsx"/> 
    44 <layer name="base" width="25" height="25"> 
     
    77  </properties> 
    88  <data encoding="base64" compression="zlib"> 
    9    eJzFlMEKwCAMQ8WDp+3Q///ZXRxISa2tcTsEBkqebdpJKUUcXQt3dnV36W+mNxKTUYG+YmQ4Yx+QL2JEWajnHgvVNOOiM4vznlt1IYZ1J1rTbCa8d1jzy2Ss5HdytlE9J/dHSIyVTBiMzFz9zYjuf/b/Etm9CGM2l54Y/rt5NufdjJ1qwHvXV/enAQ7TvyoGkzPmq/Ng7O0D0lMf/g== 
     9   eJzFlrEKgDAMREsHJzv4/z8rgkMISXPXHjoEFEJeEl+LV2vtKuIEcnZjvOGflbWjUDJ6EF8xVJyovmUoWBljNhPLzXble0CcyHLsOzLTzImqj8xfJQM5O4jbK45k86gZ3gWEUd0fyDdhGNGMiGN/MlB/KsbKOWfOH3uHzbxE3Nitv+P+k3MUfVd9MQx0dmZnwzA8R8Gw+7cMhMMwumGo/xFuoT8fdA== 
    1010  </data> 
    1111 </layer> 
     
    3737  <object id="9" x="390" y="270" width="20" height="20"/> 
    3838 </objectgroup> 
    39  <layer name="cover" width="25" height="25"> 
     39 <layer name="cover" width="25" height="25" visible="0"> 
    4040  <data encoding="base64" compression="zlib"> 
    41    eJxjYBgFgxUI4mBT03x0TGvzh4sd1AbDxY5RMApGwSgYBfQDAJbFAkM= 
     41   eJxjYBgFo2DoAkECfGrZgY5H7SBsDy0BPewYBaNgFIyCwQ4AiXABZg== 
    4242  </data> 
    4343 </layer> 
     
    4949  </object> 
    5050 </objectgroup> 
     51 <objectgroup color="#c517bd" name="cracked"> 
     52  <object id="12" x="360" y="380" width="20" height="20"/> 
     53  <object id="13" x="380" y="380" width="20" height="20"/> 
     54  <object id="14" x="360" y="400" width="20" height="20"/> 
     55  <object id="15" x="380" y="400" width="20" height="20"/> 
     56  <object id="16" x="180" y="300" width="20" height="20"/> 
     57  <object id="17" x="200" y="300" width="20" height="20"/> 
     58 </objectgroup> 
     59 <objectgroup color="#f4d72f" name="goldenheart"> 
     60  <object id="18" x="340" y="440" width="20" height="20"/> 
     61  <object id="20" x="420" y="440" width="20" height="20"/> 
     62  <object id="21" x="60" y="280" width="20" height="20"/> 
     63  <object id="22" x="40" y="180" width="20" height="20"/> 
     64  <object id="23" x="80" y="180" width="20" height="20"/> 
     65 </objectgroup> 
    5166</map> 
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabrielContent/level3.tmx

    r6717 r6767  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <map version="1.0" orientation="orthogonal" renderorder="right-down" width="30" height="20" tilewidth="20" tileheight="20" nextobjectid="14"> 
     2<map version="1.0" orientation="orthogonal" renderorder="right-down" width="30" height="20" tilewidth="20" tileheight="20" nextobjectid="15"> 
    33 <tileset firstgid="1" source="LegendOfGabrielTileset.tsx"/> 
    44 <layer name="base" width="30" height="20"> 
     
    4545  </data> 
    4646 </layer> 
     47 <objectgroup color="#dcbf19" name="goldenheart"> 
     48  <object id="14" x="480" y="320" width="20" height="20"/> 
     49 </objectgroup> 
    4750</map> 
Note: See TracChangeset for help on using the changeset viewer.