- Timestamp:
- 2015-07-01 21:28:15 (8 years ago)
- 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 38 38 level.SetTileMethod("decoration", CreateDecoration); 39 39 level.SetTileMethod("cover", CreateCover); 40 level.SetObjectMethod("story", CreateEncounter); 40 41 //level.SetObjectMethod("player", CreatePlayer); 41 42 level.SetObjectMethod("blockade", CreateBlock); … … 48 49 } 49 50 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 50 58 void CreateBossSpawn(Vector position, double width, double height, Angle angle, Shape shape, string name, Dictionary<string, string> properties) 51 59 { … … 73 81 74 82 // Luodaan muut vaunut. 75 int carriages = (int)(BossHealth.Value /(double)BossHealth.MaxValue * 6);83 int carriages = (int)(BossHealth.Value / (double)BossHealth.MaxValue * 6); 76 84 for (int i = 0; i < carriages; i++) 77 85 { -
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel.cs
r6706 r6707 74 74 75 75 private const int STORYITEM_COUNT = 3; 76 StoryItem[] storyItem = new StoryItem[3];76 List<StoryItem> storyItems = new List<StoryItem>(); 77 77 78 78 public IntMeter BossHealth; … … 93 93 public static Image BulletImage = LoadImage("bullet"); 94 94 public static Image LetterImage = LoadImage("letter"); 95 public static Image FoodImage = LoadImage("food"); 95 96 public static Image SmallSwordImage = LoadImage("smallsword"); 96 97 public static Image MonocleImage = LoadImage("monocle"); … … 246 247 GameObject inner = new GameObject(TILE_SIZE, TILE_SIZE); 247 248 inner.Color = Color.Black; 248 if (storyItem [i] != null)249 if (storyItems.Count > i && storyItems[i] != null) 249 250 { 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]); 252 253 } 253 254 member.Add(inner); … … 283 284 void Intro() 284 285 { 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)); 299 292 300 293 //ShowTextItem(storyItem[0]); … … 306 299 messagesviewed = new Queue<string>(item.Message); 307 300 308 309 301 Level.AmbientLight -= 0.75; 310 302 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 }; 315 304 Add(frame, 2); 316 305 … … 332 321 ClearAll(); 333 322 CreatePlayer(new Vector(0, -300), TILE_SIZE, TILE_SIZE, Angle.Zero, Shape.Rectangle, "", null); 334 CreateLevel(" bossroom");323 CreateLevel("level1"); 335 324 //CreatePlayer(new Vector(-Level.Width/3, Level.Bottom + TILE_SIZE * 2)); 336 325 SetControls(); … … 408 397 } 409 398 }); 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(); 410 418 } 411 419 -
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabrielContent/TheLegendOfGabrielContent.contentproj
r6705 r6707 346 346 </Compile> 347 347 </ItemGroup> 348 <ItemGroup> 349 <Compile Include="food.png"> 350 <Name>food</Name> 351 <Importer>TextureImporter</Importer> 352 <Processor>TextureProcessor</Processor> 353 </Compile> 354 </ItemGroup> 348 355 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 349 356 <!-- 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 1 1 <?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"> 3 3 <tileset firstgid="1" source="LegendOfGabrielTileset.tsx"/> 4 4 <layer name="base" width="15" height="10"> … … 19 19 </object> 20 20 </objectgroup> 21 <objectgroup name="story"> 22 <object id="2" x="140" y="140" width="40" height="20"/> 23 </objectgroup> 21 24 </map>
Note: See TracChangeset
for help on using the changeset viewer.