Changeset 6707 for 2015


Ignore:
Timestamp:
2015-07-01 21:28:15 (8 years ago)
Author:
empaheik
Message:

Hoboluolasta puuttuu vielä miekka + hobo (eli tärkeimmät, lel). Lisätarinaa.

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

Legend:

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

    r6706 r6707  
    3838        level.SetTileMethod("decoration", CreateDecoration); 
    3939        level.SetTileMethod("cover", CreateCover); 
     40        level.SetObjectMethod("story", CreateEncounter); 
    4041        //level.SetObjectMethod("player", CreatePlayer); 
    4142        level.SetObjectMethod("blockade", CreateBlock); 
     
    4849    } 
    4950 
     51    void CreateEncounter(Vector position, double width, double height, Angle angle, Shape shape, string name, Dictionary<string, string> properties) 
     52    { 
     53        PhysicsObject invisible = new PhysicsObject(width, height) {IsVisible = false, Tag = "storyTime"}; 
     54        invisible.MakeStatic(); 
     55        Add(invisible); 
     56    } 
     57 
    5058    void CreateBossSpawn(Vector position, double width, double height, Angle angle, Shape shape, string name, Dictionary<string, string> properties) 
    5159    { 
     
    7381 
    7482            // Luodaan muut vaunut. 
    75             int carriages = (int)(BossHealth.Value/(double)BossHealth.MaxValue * 6); 
     83            int carriages = (int)(BossHealth.Value / (double)BossHealth.MaxValue * 6); 
    7684            for (int i = 0; i < carriages; i++) 
    7785            { 
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel.cs

    r6706 r6707  
    7474 
    7575    private const int STORYITEM_COUNT = 3; 
    76     StoryItem[] storyItem = new StoryItem[3]; 
     76    List<StoryItem> storyItems = new List<StoryItem>(); 
    7777 
    7878    public IntMeter BossHealth; 
     
    9393    public static Image BulletImage = LoadImage("bullet"); 
    9494    public static Image LetterImage = LoadImage("letter"); 
     95    public static Image FoodImage = LoadImage("food"); 
    9596    public static Image SmallSwordImage = LoadImage("smallsword"); 
    9697    public static Image MonocleImage = LoadImage("monocle"); 
     
    246247            GameObject inner = new GameObject(TILE_SIZE, TILE_SIZE); 
    247248            inner.Color = Color.Black; 
    248             if (storyItem[i] != null) 
     249            if (storyItems.Count > i &&  storyItems[i] != null) 
    249250            { 
    250                 inner.Image = storyItem[i].InventoryImage; 
    251                 Mouse.ListenOn(inner, MouseButton.Left, ButtonState.Pressed, ShowTextItem, "View those precious memories", storyItem[i]); 
     251                inner.Image = storyItems[i].InventoryImage; 
     252                Mouse.ListenOn(inner, MouseButton.Left, ButtonState.Pressed, ShowTextItem, "View those precious memories", storyItems[i]); 
    252253            } 
    253254            member.Add(inner); 
     
    283284    void Intro() 
    284285    { 
    285         storyItem[0] = new StoryItem(new Queue<string>(new[] { "Dear Alexander,",  
    286             "", 
    287             "", 
    288             "I have accepted a position at the Communal Assets for Justice.", 
    289             "Please do not consider this an act of rejection. I am simply", 
    290             "a victim to the scathing uncertainty of your release from service.", 
    291             "", 
    292             "I still see your face in my dreams. I believe that when", 
    293             "our immediate circumstances change, we'll meet again, we'll", 
    294             "work it out. Were you here, we'd certainly fall in love.", 
    295             "", 
    296             "And perhaps then nothing could keep us apart.", 
    297             "-Ana"  
    298         }), LetterImage); 
     286        storyItems.Add(new StoryItem(new Queue<string>(new[] { "Oi, Alex", 
     287        "", 
     288        "Coyotes on a train.", 
     289        "Coyotes on a train, that's all I'm sayin'", 
     290        "-Ana" 
     291        }), LetterImage)); 
    299292 
    300293        //ShowTextItem(storyItem[0]); 
     
    306299        messagesviewed = new Queue<string>(item.Message); 
    307300         
    308  
    309301        Level.AmbientLight -= 0.75; 
    310302 
    311         frame = new GameObject(item.InventoryImage); 
    312         frame.Width = Window.Width * 0.25; 
    313         frame.Height = Window.Height * 0.25; 
    314         frame.Position = player.Position; 
     303        frame = new GameObject(item.InventoryImage) { Width = Window.Width * 0.25, Height = Window.Height * 0.25, Position = player.Position }; 
    315304        Add(frame, 2); 
    316305 
     
    332321        ClearAll(); 
    333322        CreatePlayer(new Vector(0, -300), TILE_SIZE, TILE_SIZE, Angle.Zero, Shape.Rectangle, "", null); 
    334         CreateLevel("bossroom"); 
     323        CreateLevel("level1"); 
    335324        //CreatePlayer(new Vector(-Level.Width/3, Level.Bottom + TILE_SIZE * 2)); 
    336325        SetControls(); 
     
    408397            } 
    409398        }); 
     399 
     400        AddCollisionHandler(player, "storyTime", StoryTime); 
     401    } 
     402 
     403 
     404    void StoryTime(PhysicsObject player, PhysicsObject storyBlock) 
     405    { 
     406        storyItems.Add(new StoryItem(new Queue<string>(new[] { "Oi, boy!", 
     407            "There something wrong with your head?", 
     408            "It's dangerous out there - you did see the coyotes, right?", 
     409            "", 
     410            "Just... take this.", 
     411            "You've used a sword before, right?", 
     412            "", 
     413            "-Hobo in a cave" 
     414        }), FoodImage)); 
     415 
     416        ShowTextItem(storyItems[1]); 
     417        BuildRightBar(); 
    410418    } 
    411419 
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabrielContent/TheLegendOfGabrielContent.contentproj

    r6705 r6707  
    346346    </Compile> 
    347347  </ItemGroup> 
     348  <ItemGroup> 
     349    <Compile Include="food.png"> 
     350      <Name>food</Name> 
     351      <Importer>TextureImporter</Importer> 
     352      <Processor>TextureProcessor</Processor> 
     353    </Compile> 
     354  </ItemGroup> 
    348355  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    349356  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabrielContent/hobocave.tmx

    r6706 r6707  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <map version="1.0" orientation="orthogonal" renderorder="right-down" width="15" height="10" tilewidth="20" tileheight="20" nextobjectid="2"> 
     2<map version="1.0" orientation="orthogonal" renderorder="right-down" width="15" height="10" tilewidth="20" tileheight="20" nextobjectid="3"> 
    33 <tileset firstgid="1" source="LegendOfGabrielTileset.tsx"/> 
    44 <layer name="base" width="15" height="10"> 
     
    1919  </object> 
    2020 </objectgroup> 
     21 <objectgroup name="story"> 
     22  <object id="2" x="140" y="140" width="40" height="20"/> 
     23 </objectgroup> 
    2124</map> 
Note: See TracChangeset for help on using the changeset viewer.