- Timestamp:
- 2015-07-02 08:32:56 (8 years ago)
- Location:
- 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/Exit.cs
r6715 r6717 21 21 : base(width, height) 22 22 { 23 Color = new Color(255, 0, 0, 60); // Debuggausta varten jotta näkee uloskäynnit.23 //Color = new Color(255, 0, 0, 60); // Debuggausta varten jotta näkee uloskäynnit. 24 24 IgnoresCollisionResponse = true; 25 25 Tag = "exit"; -
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/Item.cs
r6716 r6717 279 279 } 280 280 281 class Mask : Item 282 { 283 public Mask(Player player) : base(player) 284 { 285 InventoryImage = TheLegendOfGabriel.MaskLargeImage; 286 } 287 288 public override void UseKeyPressed() 289 { 290 InUse = true; 291 player.CollisionIgnoreGroup = 4; 292 base.UseKeyPressed(); 293 } 294 295 public override void UseKeyReleased() 296 { 297 CancelUse(); 298 base.UseKeyReleased(); 299 } 300 301 public override void CancelUse() 302 { 303 InUse = false; 304 player.CollisionIgnoreGroup = 1; 305 base.CancelUse(); 306 } 307 } 308 281 309 class Monocle : Item 282 310 { -
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/LevelCreation.cs
r6716 r6717 39 39 level.SetObjectMethod("boss", CreateBoss); 40 40 level.SetObjectMethod("bossspawn", CreateBossSpawn); 41 level.SetObjectMethod("itemdrop", CreateItem); 41 42 level.Execute(); 42 43 … … 46 47 } 47 48 49 private void CreateItem(Vector position, double width, double height, Angle angle, Shape shape, string name, Dictionary<string, string> properties) 50 { 51 string itemname = properties["name"]; 52 53 var images = new Dictionary<string, Image>(); 54 images["pistol"] = GunImage; 55 images["grenade"] = GrenadeImage; 56 images["mask"] = MaskImage; 57 58 var item = PhysicsObject.CreateStaticObject(width, height, shape); 59 item.Tag = itemname; 60 item.Image = images[itemname]; 61 item.Position = position; 62 item.IgnoresCollisionResponse = true; 63 Add(item); 64 } 65 48 66 void CreateEncounter(Vector position, double width, double height, Angle angle, Shape shape, string name, Dictionary<string, string> properties) 49 67 { 50 68 if (storyItems.Count < 2) 51 69 { 52 PhysicsObject invisible = new PhysicsObject(width, height) { IsVisible = false, Tag = "storyTime" };70 PhysicsObject invisible = new PhysicsObject(width, height) { IsVisible = false, Tag = "storyTime", IgnoresCollisionResponse = true }; 53 71 invisible.MakeStatic(); 54 72 Add(invisible); … … 223 241 { 224 242 int itemType = RandomGen.NextInt(1, 3); 243 244 if (itemType == 1 && player.Inventory.FirstOrDefault(i => i is Grenade) == null) 245 return; 246 247 if (itemType == 2 && player.Inventory.FirstOrDefault(i => i is Pistol) == null) 248 return; 249 225 250 var item = PhysicsObject.CreateStaticObject(10, 10); 226 251 item.Position = position; … … 270 295 void CreateBasicTile(Vector position, double width, double height, Image image, int layer, Dictionary<string, string> properties) 271 296 { 272 //var tile = new GameObject(width, height); 273 var tile = properties.ContainsKey("collide") ? PhysicsObject.CreateStaticObject(width, height) : new GameObject(width, height); //new PhysicsObject(width, height) PhysicsObject.CreateStaticObject(width, height) 297 bool oil = properties.ContainsKey("damage") && properties["damage"] == "true"; 298 299 bool solidTile = properties.ContainsKey("collide") || oil; 300 var tile = solidTile? PhysicsObject.CreateStaticObject(width, height) : new GameObject(width, height); 274 301 tile.Image = image; 275 302 tile.Position = position; 303 if (oil) 304 { 305 ((PhysicsObject) tile).CollisionIgnoreGroup = 4; 306 } 276 307 Add(tile, layer); 277 308 } -
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel.cs
r6716 r6717 104 104 public static Image GrenadeImage = LoadImage("gran"); 105 105 public static Image GrenadeSmallImage = LoadImage("gransmall"); 106 public static Image MaskImage = LoadImage("helm"); 107 public static Image MaskLargeImage = LoadImage("helmlarge"); 106 108 107 109 public static Image GrenadeBoxImage = LoadImage("grenadebox"); … … 377 379 Add(player, 1); 378 380 379 player.Sword = new Sword(player);380 player.Inventory.Add(new Pistol(player));381 381 player.Inventory.Add(new Monocle(player)); 382 player.Inventory.Add(new Grenade(player)); 382 383 //player.Sword = new Sword(player); 384 //player.Inventory.Add(new Pistol(player)); 385 //player.Inventory.Add(new Grenade(player)); 383 386 384 387 //player.Health.Value = 3; // Alkuun vain kolme sydäntä. … … 412 415 413 416 AddCollisionHandler(player, "storyTime", StoryTime); 414 } 415 416 417 void StoryTime(PhysicsObject player, PhysicsObject storyBlock) 417 418 AddCollisionHandler(player, "pistol", delegate(PhysicsObject p, PhysicsObject item) 419 { 420 item.Destroy(); 421 player.Inventory.Add(new Pistol(player)); 422 UpdateItemCycleImages(); 423 }); 424 425 AddCollisionHandler(player, "grenade", delegate(PhysicsObject p, PhysicsObject item) 426 { 427 item.Destroy(); 428 player.Inventory.Add(new Grenade(player)); 429 UpdateItemCycleImages(); 430 }); 431 432 AddCollisionHandler(player, "mask", delegate(PhysicsObject p, PhysicsObject item) 433 { 434 item.Destroy(); 435 player.Inventory.Add(new Mask(player)); 436 UpdateItemCycleImages(); 437 }); 438 } 439 440 441 void StoryTime(PhysicsObject pPlayer, PhysicsObject storyBlock) 418 442 { 419 443 storyItems.Add(new StoryItem(new Queue<string>(new[] { "Oi, boy!", … … 430 454 storyBlock.IgnoresCollisionResponse = true; 431 455 456 if (player.Sword == null) 457 { 458 player.Sword = new Sword(player); 459 } 460 432 461 ShowTextItem(storyItems[1]); 433 462 BuildRightBar(); … … 510 539 511 540 canUseExit = false; 512 Timer.SingleShot( 6, () => canUseExit = true);541 Timer.SingleShot(2, () => canUseExit = true); 513 542 514 543 var oldExit = pExit as Exit; -
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabrielContent/TheLegendOfGabrielContent.contentproj
r6716 r6717 384 384 </Compile> 385 385 </ItemGroup> 386 <ItemGroup> 387 <Compile Include="helmlarge.png"> 388 <Name>helmlarge</Name> 389 <Importer>TextureImporter</Importer> 390 <Processor>TextureProcessor</Processor> 391 </Compile> 392 </ItemGroup> 386 393 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 387 394 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabrielContent/bossroom.tmx
r6703 r6717 9 9 <layer name="decoration" width="15" height="20"> 10 10 <data encoding="base64" compression="zlib"> 11 eJxjYBgFpA BWMvAoGDpgNH4HNwAARa8Agw==11 eJxjYBgFpAABMvAoGDpgNH4HNwAAB+wBoQ== 12 12 </data> 13 13 </layer> -
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabrielContent/level2.tmx
r6715 r6717 1 1 <?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="10"> 3 <tileset firstgid="1" name="LegendOfGabrielTileset" tilewidth="20" tileheight="20"> 4 <image source="tileset.png" width="200" height="200"/> 5 <tile id="2"> 6 <properties> 7 <property name="collide" value="true"/> 8 </properties> 9 </tile> 10 <tile id="16"> 11 <properties> 12 <property name="collide" value="true"/> 13 </properties> 14 </tile> 15 <tile id="23"> 16 <properties> 17 <property name="collide" value="true"/> 18 </properties> 19 </tile> 20 <tile id="70"> 21 <properties> 22 <property name="damage" value="true"/> 23 </properties> 24 </tile> 25 <tile id="71"> 26 <properties> 27 <property name="damage" value="true"/> 28 </properties> 29 </tile> 30 <tile id="72"> 31 <properties> 32 <property name="damage" value="true"/> 33 </properties> 34 </tile> 35 <tile id="80"> 36 <properties> 37 <property name="damage" value="true"/> 38 </properties> 39 </tile> 40 <tile id="81"> 41 <properties> 42 <property name="damage" value="true"/> 43 </properties> 44 </tile> 45 <tile id="82"> 46 <properties> 47 <property name="damage" value="true"/> 48 </properties> 49 </tile> 50 <tile id="90"> 51 <properties> 52 <property name="damage" value="true"/> 53 </properties> 54 </tile> 55 <tile id="91"> 56 <properties> 57 <property name="damage" value="true"/> 58 </properties> 59 </tile> 60 <tile id="92"> 61 <properties> 62 <property name="damage" value="true"/> 63 </properties> 64 </tile> 65 <tile id="93"> 66 <properties> 67 <property name="damage" value="false"/> 68 </properties> 69 </tile> 70 </tileset> 2 <map version="1.0" orientation="orthogonal" renderorder="right-down" width="25" height="25" tilewidth="20" tileheight="20" nextobjectid="12"> 3 <tileset firstgid="1" source="LegendOfGabrielTileset.tsx"/> 71 4 <layer name="base" width="25" height="25"> 72 5 <properties> … … 74 7 </properties> 75 8 <data encoding="base64" compression="zlib"> 76 eJz VlMEKwCAMQ8WDtx78/5/dZQORtLU1buwQGCh9tk3WSyldkdwav8W4n5EY+hujAr3FyHDGOaC6iBFloZl7LNSTxUVnGuc51/pCDO1OtCfLE947NP8yGSv7O+lt1M/J/HQSY2UnDEbGV18zovnP/l8i2YswLF96YtTf3Wdz3s3IVAO1d+vO82mAw6xfJwaTM+533gcjtxfTNB/j9 eJzFlMEKwCAMQ8WDp+3Q///ZXRxISa2tcTsEBkqebdpJKUUcXQt3dnV36W+mNxKTUYG+YmQ4Yx+QL2JEWajnHgvVNOOiM4vznlt1IYZ1J1rTbCa8d1jzy2Ss5HdytlE9J/dHSIyVTBiMzFz9zYjuf/b/Etm9CGM2l54Y/rt5NufdjJ1qwHvXV/enAQ7TvyoGkzPmq/Ng7O0D0lMf/g== 77 10 </data> 78 11 </layer> 79 12 <layer name="decoration" width="25" height="25"> 80 13 <data encoding="base64" compression="zlib"> 81 eJxjY CAMWIlQQykYtWPUjlE7BtaOUTB4gQAReBQMLSBGBzuGS9lEbzskaGyHBBpNCQAARagBOg==14 eJxjYBgcgHXUjlE7kIA7EHvQ2I5AIA4C4lga2xEMZcdR2Q5YGAUh2UFtEA3EMVBMaTgNFkBJPAwUECACj4KhBcToYMdAl+ND1Q4JGtshgUZTAgBYXgbI 82 15 </data> 83 16 </layer> … … 89 22 <properties> 90 23 <property name="goto" value="level1@tunnelblockade"/> 24 </properties> 25 </object> 26 <object id="10" x="180" y="0" width="20" height="40"> 27 <properties> 28 <property name="goto" value="bossroom@enterance"/> 91 29 </properties> 92 30 </object> … … 104 42 </data> 105 43 </layer> 44 <objectgroup name="itemdrop"> 45 <object id="11" x="220" y="80" width="20" height="20"> 46 <properties> 47 <property name="name" value="grenade"/> 48 </properties> 49 </object> 50 </objectgroup> 106 51 </map> -
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabrielContent/level3.tmx
r6710 r6717 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <map version="1.0" orientation="orthogonal" renderorder="right-down" width="30" height="20" tilewidth="20" tileheight="20" nextobjectid="14"> 3 <tileset firstgid="1" name="LegendOfGabrielTileset" tilewidth="20" tileheight="20"> 4 <image source="tileset.png" width="200" height="200"/> 5 <tile id="2"> 6 <properties> 7 <property name="collide" value="true"/> 8 </properties> 9 </tile> 10 <tile id="16"> 11 <properties> 12 <property name="collide" value="true"/> 13 </properties> 14 </tile> 15 <tile id="70"> 16 <properties> 17 <property name="damage" value="true"/> 18 </properties> 19 </tile> 20 <tile id="71"> 21 <properties> 22 <property name="damage" value="true"/> 23 </properties> 24 </tile> 25 <tile id="72"> 26 <properties> 27 <property name="damage" value="true"/> 28 </properties> 29 </tile> 30 <tile id="80"> 31 <properties> 32 <property name="damage" value="true"/> 33 </properties> 34 </tile> 35 <tile id="81"> 36 <properties> 37 <property name="damage" value="true"/> 38 </properties> 39 </tile> 40 <tile id="82"> 41 <properties> 42 <property name="damage" value="true"/> 43 </properties> 44 </tile> 45 <tile id="90"> 46 <properties> 47 <property name="damage" value="true"/> 48 </properties> 49 </tile> 50 <tile id="91"> 51 <properties> 52 <property name="damage" value="true"/> 53 </properties> 54 </tile> 55 <tile id="92"> 56 <properties> 57 <property name="damage" value="true"/> 58 </properties> 59 </tile> 60 <tile id="93"> 61 <properties> 62 <property name="damage" value="false"/> 63 </properties> 64 </tile> 65 </tileset> 3 <tileset firstgid="1" source="LegendOfGabrielTileset.tsx"/> 66 4 <layer name="base" width="30" height="20"> 67 5 <data encoding="base64" compression="zlib"> … … 71 9 <layer name="decoration" width="30" height="20"> 72 10 <data encoding="base64" compression="zlib"> 73 eJy1l VEOAjEIRIkn2duon9rPbr3/MZRkmyAZ6NiuJHyVnTd0Cd1EZJvIIjjqpJ7PneC+Tma3T14CnajfVXY5mJpXkuv7nuXfA6ZmQ00G8QDf7y4ZP73X3p96ux0+Wa4P5l78HVtdxGa4DDvjIjbLRXUZF/m07H9xEbskZ2dy/dyP7oSdg0wT1dsa9fQkvK9yPZPR6JHNNMuNmBkX6WnqbmmDmq75i3cbVb53mfL8DkZcv0MRX/93tN+Y8Nxsb9ta5Y7etCj8nI50Rlz0nqGzbI6j+u5zpV+Ga6Ma7hu7xkZ011 eJy1lUEOwzAIBK18rs2x8bFJ//+MFimWrNWCFyddiZMJAxiTrZSyTVgtXO/JeGi7wP3czD5+tjhxvHqvsuvJNHuIXKx7lr86zNYLVS/y/Q6WmalWn+X2PPNUuSilL9jjPi5jK1yFHXEZW+Uyv4jL8uzZ/+Iydg3O7uTi3I96os5B5n7RR33/V7kjpsc1RTOtcj1mxPXqtt1yDHxazEzuWHO/y4yHO5hxcYd6fG+/KUJutLejOcho9HayXPY/Y2dK/ll/Rdk4/T1/AcNBeQo= 74 12 </data> 75 13 </layer> … … 82 20 </objectgroup> 83 21 <objectgroup name="itemdrop"> 84 <properties>85 <property name="name" value="mask"/>86 </properties>87 22 <object id="2" x="150" y="60" width="20" height="20"> 88 23 <properties> … … 90 25 </properties> 91 26 </object> 92 <object id="13" x="450" y="380" width="20" height="20"/> 27 <object id="13" x="450" y="380" width="20" height="20"> 28 <properties> 29 <property name="name" value="mask"/> 30 </properties> 31 </object> 93 32 </objectgroup> 94 33 <objectgroup color="#00ff00" name="coyote"> … … 101 40 <object id="12" x="520" y="340" width="20" height="20"/> 102 41 </objectgroup> 103 <layer name="cover" width="30" height="20" >42 <layer name="cover" width="30" height="20" visible="0"> 104 43 <data encoding="base64" compression="zlib"> 105 44 eJxjYBicQAGKB8JOeto9EHZis3sUjIJRMApGwSgYBdQDABOjAaE=
Note: See TracChangeset
for help on using the changeset viewer.