Changeset 6701 for 2015/27/ohjaajat


Ignore:
Timestamp:
2015-07-01 17:42:14 (4 years ago)
Author:
sieerinn
Message:

Pelaajalla näkyy taas sydämmet, monokkeli toimii.

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

Legend:

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

    r6632 r6701  
    298298    } 
    299299 
     300    public override void UseKeyDown() 
     301    { 
     302        if (bigMonocle == null) 
     303            return; 
     304 
     305        foreach (var tile in Game.Instance.GetObjectsWithTag("cover")) 
     306        { 
     307            tile.IsVisible = Vector.Distance(player.Position, tile.Position) > bigMonocle.Width * 0.5; 
     308        } 
     309        base.UseKeyDown(); 
     310    } 
     311 
    300312    public override void UseKeyReleased() 
    301313    { 
     
    311323            bigMonocle.Destroy(); 
    312324            bigMonocle = null; 
     325        } 
     326        foreach (var tile in Game.Instance.GetObjectsWithTag("cover")) 
     327        { 
     328            tile.IsVisible = true; 
    313329        } 
    314330        base.CancelUse(); 
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/LevelCreation.cs

    r6699 r6701  
    3535        level.SetObjectMethod("exit", CreateExit); 
    3636        level.SetTileMethod("decoration", CreateDecoration); 
     37        level.SetTileMethod("cover", CreateCover); 
    3738        //level.SetObjectMethod("player", CreatePlayer); 
    3839        level.SetObjectMethod("blockade", CreateBlock); 
     
    9798    } 
    9899 
     100    void CreateCover(Vector position, double width, double height, Image image, string layername, Dictionary<string, string> properties) 
     101    { 
     102        var tile = new GameObject(width, height); 
     103        tile.Tag = "cover"; 
     104        tile.Image = image; 
     105        tile.Position = position; 
     106        Add(tile, 3); 
     107    } 
     108 
    99109    /// <summary> 
    100110    /// Luo tavallisen tiilen. 
    101111    /// </summary> 
    102     void CreateBasicTile(Vector position, double width, double height, Image image, int layer, Dictionary<string, string> properties) 
     112    GameObject CreateBasicTile(Vector position, double width, double height, Image image, int layer, Dictionary<string, string> properties) 
    103113    { 
    104114        var tile = properties.ContainsKey("collide") ? new PhysicsObject(width, height) : new GameObject(width, height); 
     
    106116        tile.Position = position; 
    107117        Add(tile, layer); 
     118        return tile; 
    108119    } 
    109120 
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel.cs

    r6699 r6701  
    100100    public static Image ActiveItemFrameImageZ = LoadImage("activeitemframez"); 
    101101 
    102     //public static Image PlayerHealthImage = LoadImage("playerhealth"); 
    103     //public static Image PlayerHealthEmptyImage = LoadImage("playerhealthempty"); 
     102    public static Image PlayerHealthImage = LoadImage("playerhealth"); 
     103    public static Image PlayerHealthEmptyImage = LoadImage("playerhealthempty"); 
    104104 
    105105    [AssetName("walkright")] 
     
    159159        bar.Right = Screen.Right - 50; 
    160160        bar.Top = Screen.Top - 50; 
    161         //bar.Image = PlayerHealthEmptyImage; 
    162         //bar.BarImage = PlayerHealthImage; 
     161        bar.Image = PlayerHealthEmptyImage; 
     162        bar.BarImage = PlayerHealthImage; 
    163163        bar.BindTo(player.Health); 
    164164        Add(bar); 
     
    222222            } 
    223223            member.Add(inner); 
    224  
    225             // Gameobjektit ei liiku mukana jos kamera liikkuu joten tein kehyksistä Labeleita. 
    226             /*   
    227             GameObject member = new GameObject(FrameImage); 
    228             member.Position = new Vector(Level.Right + FrameImage.Width, Level.Top - Level.Width * 0.25 - FrameImage.Height * i * 1.5); 
    229             Add(member); 
    230  
    231             GameObject inner = new GameObject(TILE_SIZE, TILE_SIZE); 
    232             inner.Color = Color.Black; 
    233             if (storyItem[i] != null) 
    234             { 
    235                 inner.Image = storyItem[i].InventoryImage; 
    236                 Mouse.ListenOn(inner, MouseButton.Left, ButtonState.Pressed, ShowTextItem, "View those precious memories", storyItem[i]); 
    237             } 
    238             member.Add(inner); 
    239             */ 
    240224        } 
    241225    } 
     
    297281        frame = new GameObject(LetterImage); 
    298282        frame.Image = LetterImage; 
    299         //frame.Width = Window.Width * 0.25; 
    300         //frame.Height = Window.Height * 0.25; 
     283        frame.Width = Window.Width * 0.25; 
     284        frame.Height = Window.Height * 0.25; 
    301285        frame.Width = Level.Width * 0.25; 
    302286        frame.Height = Level.Height * 0.25; 
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabrielContent/TheLegendOfGabrielContent.contentproj

    r6692 r6701  
    265265    </Compile> 
    266266  </ItemGroup> 
     267  <ItemGroup> 
     268    <Compile Include="playerhealth.png"> 
     269      <Name>playerhealth</Name> 
     270      <Importer>TextureImporter</Importer> 
     271      <Processor>TextureProcessor</Processor> 
     272    </Compile> 
     273    <Compile Include="playerhealthempty.png"> 
     274      <Name>playerhealthempty</Name> 
     275      <Importer>TextureImporter</Importer> 
     276      <Processor>TextureProcessor</Processor> 
     277    </Compile> 
     278  </ItemGroup> 
     279  <ItemGroup> 
     280    <Compile Include="hobocave.tmx"> 
     281      <Name>hobocave</Name> 
     282      <Importer>TextFileImporter</Importer> 
     283      <Processor>TextFileContentProcessor</Processor> 
     284      <CopyToOutputDirectory>Always</CopyToOutputDirectory> 
     285    </Compile> 
     286  </ItemGroup> 
    267287  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    268288  <!--  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.