Grog-Knight

some game in C++
Log | Files | Refs | Submodules | README | LICENSE | git clone https://git.ne02ptzero.me/git/Grog-Knight

commit ad263b94b2b5264898a3f05995ffbafc6fafc67c
parent d7fcd5169344301e9817e003b0c6a1d227535fe2
Author: Louis Solofrizzo <louis@ne02ptzero.me>
Date:   Sat, 24 Oct 2015 17:31:22 +0200

Merge pull request #46 from Ne02ptzero/build

Rebase Master
Diffstat:
M.gitmodules | 3---
MMaps/Menu/dressing.json | 5++++-
MMaps/Menu/kitchen.json | 4++++
AMaps/city.json | 2895+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMaps/mapStart.json | 323+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MREADME.md | 29+++++++++++++++++++++++++++--
AResources/Dialogs/dialogs.json | 22++++++++++++++++++++++
MResources/Elements/Armors/Armor_000.json | 2+-
MResources/Elements/Enemies/EnemyGround_000.json | 2+-
MResources/Elements/Rings/Ring_000.json | 2+-
MResources/Elements/SpecialAttack.json | 15+++++++++++++++
MResources/Elements/SpecialMoves.json | 6+++---
MResources/Elements/Warrior.json | 6++++--
MResources/Elements/Weapons/Axe_002.json | 3+--
MResources/Elements/Weapons/Axe_003.json | 3++-
MResources/Elements/Weapons/Axe_004.json | 1-
MResources/Elements/Weapons/Spear_000.json | 2+-
AResources/HUD/spell_cooldown.png | 0
MResources/Images/Menu/menu.png | 0
AResources/Images/Resources | 2++
AResources/Images/beer.png | 0
AResources/Images/big_dialog.png | 0
AResources/Images/castle_2.png | 0
AResources/Images/castle_3.png | 0
AResources/Images/logo.png | 0
AResources/Images/map_start.png | 0
MSources/inc/Characters.hpp | 1+
MSources/inc/Game.hpp | 1+
MSources/inc/HUDWindow.hpp | 16+++++++++++++++-
MSources/inc/Maps.hpp | 3+++
MSources/inc/Menu.hpp | 3+++
MSources/inc/MenuCharacter.hpp | 4+++-
MSources/inc/Projectile.hpp | 2+-
MSources/inc/SpecialAttack.hpp | 1+
MSources/src/Boss.cpp | 2+-
MSources/src/Characters.cpp | 19++++++++++++++-----
MSources/src/Dealer.cpp | 10+++++++---
MSources/src/Elements.cpp | 3+++
MSources/src/Enemy.cpp | 4+++-
MSources/src/Game.cpp | 25+++++++++++++++++++------
MSources/src/HUDWindow.cpp | 206++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------
MSources/src/Hero.cpp | 8+++-----
MSources/src/Maps.cpp | 45+++++++++++++++++++++++++++++----------------
MSources/src/Menu.cpp | 53++++++++++++++++++++++++++++++++++++++++++++++++-----
MSources/src/MenuCharacter.cpp | 100++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------
MSources/src/Projectile.cpp | 31++++++++++++++++++++-----------
MSources/src/Quit.cpp | 4++--
MSources/src/Shopkeeper.cpp | 4++--
MSources/src/SpecialAttack.cpp | 81+++++++++++++++++++++++++++++++++++++++++++++++++------------------------------
MSources/src/SpecialMoves.cpp | 26+++++++++++++++++---------
MSources/src/Weapon.cpp | 4++--
MSources/src/WeaponList.cpp | 2+-
DWindows | 1-
53 files changed, 3788 insertions(+), 196 deletions(-)

diff --git a/.gitmodules b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "Windows"] - path = Windows - url = http://github.com/Ne02ptzero/rogue-like [submodule "jsoncpp"] path = Tools/jsoncpp url = http://github.com/open-source-parsers/jsoncpp diff --git a/Maps/Menu/dressing.json b/Maps/Menu/dressing.json @@ -22,7 +22,6 @@ "x":0, "y":0 }], - "nextobjectid":1, "orientation":"orthogonal", "properties": { @@ -8018,6 +8017,10 @@ { "physic":"0" }, + "3027": + { + "dialog":"bathroom" + }, "3041": { "trigger":"equipment" diff --git a/Maps/Menu/kitchen.json b/Maps/Menu/kitchen.json @@ -7733,6 +7733,10 @@ { "trigger":"skills" }, + "20990": + { + "dialog":"goodbye" + }, "21002": { "trigger":"startGame" diff --git a/Maps/city.json b/Maps/city.json @@ -0,0 +1,2895 @@ +{ "height":16, + "layers":[ + { + "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 163, 164, 165, 166, 167, 168, 169, 170, 171, 298, 299, 300, 301, 302, 303, 304, 305, 306, 433, 434, 435, 436, 437, 438, 439, 440, 441, 172, 173, 174, 175, 176, 177, 178, 179, 180, 307, 308, 309, 310, 311, 312, 313, 314, 315, 442, 443, 444, 445, 446, 447, 448, 449, 450, 181, 182, 183, 184, 185, 186, 187, 188, 189, 316, 317, 318, 319, 320, 321, 322, 323, 324, 451, 452, 453, 454, 455, 456, 457, 458, 459, 190, 191, 192, 193, 194, 195, 196, 197, 198, 325, 326, 327, 328, 329, 330, 331, 332, 333, 460, 461, 462, 463, 464, 465, 466, 467, 468, 199, 200, 201, 202, 203, 204, 205, 206, 207, 334, 335, 336, 337, 338, 339, 340, 341, 342, 469, 470, 471, 472, 473, 474, 475, 476, 477, 208, 209, 210, 211, 212, 213, 214, 215, 216, 343, 344, 345, 346, 347, 348, 349, 350, 351, 478, 479, 480, 481, 482, 483, 484, 485, 486, 217, 218, 219, 220, 221, 222, 223, 224, 225, 352, 353, 354, 355, 356, 357, 358, 359, 360, 487, 488, 489, 490, 491, 492, 493, 494, 495, 226, 227, 228, 229, 230, 231, 232, 233, 234, 361, 362, 363, 364, 365, 366, 367, 368, 369, 496, 497, 498, 499, 500, 501, 502, 503, 504, 235, 236, 237, 238, 239, 240, 241, 242, 243, 370, 371, 372, 373, 374, 375, 376, 377, 378, 505, 506, 507, 508, 509, 510, 511, 512, 513, 244, 245, 246, 247, 248, 249, 250, 251, 252, 379, 380, 381, 382, 383, 384, 385, 386, 387, 514, 515, 516, 517, 518, 519, 520, 521, 522, 253, 254, 255, 256, 257, 258, 259, 260, 261, 388, 389, 390, 391, 392, 393, 394, 395, 396, 523, 524, 525, 526, 527, 528, 529, 530, 531, 262, 263, 264, 265, 266, 267, 268, 269, 270, 397, 398, 399, 400, 401, 402, 403, 404, 405, 532, 533, 534, 535, 536, 537, 538, 539, 540, 271, 272, 273, 274, 275, 276, 277, 278, 279, 406, 407, 408, 409, 410, 411, 412, 413, 414, 541, 542, 543, 544, 545, 546, 547, 548, 549, 280, 281, 282, 283, 284, 285, 286, 287, 288, 415, 416, 417, 418, 419, 420, 421, 422, 423, 550, 551, 552, 553, 554, 555, 556, 557, 558, 289, 290, 291, 292, 293, 294, 295, 296, 297, 424, 425, 426, 427, 428, 429, 430, 431, 432, 559, 560, 561, 562, 563, 564, 565, 566, 567], + "height":16, + "name":"Tile Layer 1", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }, + { + "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 143, 144, 0, 0, 0, 0, 0, 0, 143, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 150, 151, 0, 0, 152, 153, 0, 0, 0, 0, 150, 151, 152, 153, 150, 151, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 159, 160, 0, 0, 161, 162, 0, 91, 38, 39, 159, 160, 161, 162, 159, 160, 0, 100, 0, 0, 0, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 78, 78, 78, 78, 78], + "height":16, + "name":"Tile Layer 2", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }], + "orientation":"orthogonal", + "properties": + { + "special":"city" + }, + "renderorder":"right-down", + "tileheight":32, + "tilesets":[ + { + "firstgid":1, + "image":"Resources\/Images\/castle_3.png", + "imageheight":2016, + "imagewidth":288, + "margin":0, + "name":"city", + "properties": + { + + }, + "spacing":0, + "tileheight":32, + "tileproperties": + { + "0": + { + "layer":"99", + "physic":"0" + }, + "1": + { + "layer":"99", + "physic":"0" + }, + "10": + { + "layer":"99", + "physic":"0" + }, + "100": + { + "layer":"99", + "physic":"0" + }, + "101": + { + "layer":"99", + "physic":"0" + }, + "102": + { + "layer":"99", + "physic":"0" + }, + "103": + { + "layer":"99", + "physic":"0" + }, + "104": + { + "layer":"99", + "physic":"0" + }, + "105": + { + "layer":"99", + "physic":"0" + }, + "106": + { + "layer":"99", + "physic":"0" + }, + "107": + { + "layer":"99", + "physic":"0" + }, + "108": + { + "layer":"99", + "physic":"0" + }, + "109": + { + "layer":"99", + "physic":"0" + }, + "11": + { + "layer":"99", + "physic":"0" + }, + "110": + { + "layer":"99", + "physic":"0" + }, + "111": + { + "layer":"99", + "physic":"0" + }, + "112": + { + "layer":"99", + "physic":"0" + }, + "113": + { + "layer":"99", + "physic":"0" + }, + "114": + { + "layer":"99", + "physic":"0" + }, + "115": + { + "layer":"99", + "physic":"0" + }, + "116": + { + "layer":"99", + "physic":"0" + }, + "117": + { + "layer":"99", + "physic":"0" + }, + "118": + { + "layer":"99", + "physic":"0" + }, + "119": + { + "layer":"99", + "physic":"0" + }, + "12": + { + "layer":"99", + "physic":"0" + }, + "120": + { + "layer":"99", + "physic":"0" + }, + "121": + { + "layer":"99", + "physic":"0" + }, + "122": + { + "layer":"99", + "physic":"0" + }, + "123": + { + "layer":"99", + "physic":"0" + }, + "124": + { + "layer":"99", + "physic":"0" + }, + "125": + { + "layer":"99", + "physic":"0" + }, + "126": + { + "layer":"99", + "physic":"0" + }, + "127": + { + "layer":"99", + "physic":"0" + }, + "128": + { + "layer":"99", + "physic":"0" + }, + "129": + { + "layer":"99", + "physic":"0" + }, + "13": + { + "layer":"99", + "physic":"0" + }, + "130": + { + "layer":"99", + "physic":"0" + }, + "131": + { + "layer":"99", + "physic":"0" + }, + "132": + { + "layer":"99", + "physic":"0" + }, + "133": + { + "layer":"99", + "physic":"0" + }, + "134": + { + "layer":"99", + "physic":"0" + }, + "135": + { + "layer":"99", + "physic":"0" + }, + "136": + { + "layer":"99", + "physic":"0" + }, + "137": + { + "layer":"99", + "physic":"0" + }, + "138": + { + "layer":"99", + "physic":"0" + }, + "139": + { + "layer":"99", + "physic":"0" + }, + "14": + { + "layer":"99", + "physic":"0" + }, + "140": + { + "layer":"99", + "physic":"0" + }, + "141": + { + "layer":"99", + "physic":"0" + }, + "142": + { + "layer":"99", + "physic":"0" + }, + "143": + { + "layer":"99", + "physic":"0" + }, + "144": + { + "layer":"99", + "physic":"0" + }, + "145": + { + "layer":"99", + "physic":"0" + }, + "146": + { + "layer":"99", + "physic":"0" + }, + "147": + { + "layer":"99", + "physic":"0" + }, + "148": + { + "layer":"99", + "physic":"0" + }, + "149": + { + "layer":"99", + "physic":"0" + }, + "15": + { + "layer":"99", + "physic":"0" + }, + "150": + { + "layer":"99", + "physic":"0" + }, + "151": + { + "layer":"99", + "physic":"0" + }, + "152": + { + "layer":"99", + "physic":"0" + }, + "153": + { + "layer":"99", + "physic":"0" + }, + "154": + { + "layer":"99", + "physic":"0" + }, + "155": + { + "layer":"99", + "physic":"0" + }, + "156": + { + "layer":"99", + "physic":"0" + }, + "157": + { + "layer":"99", + "physic":"0" + }, + "158": + { + "layer":"99", + "physic":"0" + }, + "159": + { + "layer":"99", + "physic":"0" + }, + "16": + { + "layer":"99", + "physic":"0" + }, + "160": + { + "layer":"99", + "physic":"0" + }, + "161": + { + "layer":"99", + "physic":"0" + }, + "162": + { + "layer":"99", + "physic":"0" + }, + "163": + { + "layer":"99", + "physic":"0" + }, + "164": + { + "layer":"99", + "physic":"0" + }, + "165": + { + "layer":"99", + "physic":"0" + }, + "166": + { + "layer":"99", + "physic":"0" + }, + "167": + { + "layer":"99", + "physic":"0" + }, + "168": + { + "layer":"99", + "physic":"0" + }, + "169": + { + "layer":"99", + "physic":"0" + }, + "17": + { + "layer":"99", + "physic":"0" + }, + "170": + { + "layer":"99", + "physic":"0" + }, + "171": + { + "layer":"99", + "physic":"0" + }, + "172": + { + "layer":"99", + "physic":"0" + }, + "173": + { + "layer":"99", + "physic":"0" + }, + "174": + { + "layer":"99", + "physic":"0" + }, + "175": + { + "layer":"99", + "physic":"0" + }, + "176": + { + "layer":"99", + "physic":"0" + }, + "177": + { + "layer":"99", + "physic":"0" + }, + "178": + { + "layer":"99", + "physic":"0" + }, + "179": + { + "layer":"99", + "physic":"0" + }, + "18": + { + "layer":"99", + "physic":"0" + }, + "180": + { + "layer":"99", + "physic":"0" + }, + "181": + { + "layer":"99", + "physic":"0" + }, + "182": + { + "layer":"99", + "physic":"0" + }, + "183": + { + "layer":"99", + "physic":"0" + }, + "184": + { + "layer":"99", + "physic":"0" + }, + "185": + { + "layer":"99", + "physic":"0" + }, + "186": + { + "layer":"99", + "physic":"0" + }, + "187": + { + "layer":"99", + "physic":"0" + }, + "188": + { + "layer":"99", + "physic":"0" + }, + "189": + { + "layer":"99", + "physic":"0" + }, + "19": + { + "layer":"99", + "physic":"0" + }, + "190": + { + "layer":"99", + "physic":"0" + }, + "191": + { + "layer":"99", + "physic":"0" + }, + "192": + { + "layer":"99", + "physic":"0" + }, + "193": + { + "layer":"99", + "physic":"0" + }, + "194": + { + "layer":"99", + "physic":"0" + }, + "195": + { + "layer":"99", + "physic":"0" + }, + "196": + { + "layer":"99", + "physic":"0" + }, + "197": + { + "layer":"99", + "physic":"0" + }, + "198": + { + "layer":"99", + "physic":"0" + }, + "199": + { + "layer":"99", + "physic":"0" + }, + "2": + { + "layer":"99", + "physic":"0" + }, + "20": + { + "layer":"99", + "physic":"0" + }, + "200": + { + "layer":"99", + "physic":"0" + }, + "201": + { + "layer":"99", + "physic":"0" + }, + "202": + { + "layer":"99", + "physic":"0" + }, + "203": + { + "layer":"99", + "physic":"0" + }, + "204": + { + "layer":"99", + "physic":"0" + }, + "205": + { + "layer":"99", + "physic":"0" + }, + "206": + { + "layer":"99", + "physic":"0" + }, + "207": + { + "layer":"99", + "physic":"0" + }, + "208": + { + "layer":"99", + "physic":"0" + }, + "209": + { + "layer":"99", + "physic":"0" + }, + "21": + { + "layer":"99", + "physic":"0" + }, + "210": + { + "layer":"99", + "physic":"0" + }, + "211": + { + "layer":"99", + "physic":"0" + }, + "212": + { + "layer":"99", + "physic":"0" + }, + "213": + { + "layer":"99", + "physic":"0" + }, + "214": + { + "layer":"99", + "physic":"0" + }, + "215": + { + "layer":"99", + "physic":"0" + }, + "216": + { + "layer":"99", + "physic":"0" + }, + "217": + { + "layer":"99", + "physic":"0" + }, + "218": + { + "layer":"99", + "physic":"0" + }, + "219": + { + "layer":"99", + "physic":"0" + }, + "22": + { + "layer":"99", + "physic":"0" + }, + "220": + { + "layer":"99", + "physic":"0" + }, + "221": + { + "layer":"99", + "physic":"0" + }, + "222": + { + "layer":"99", + "physic":"0" + }, + "223": + { + "layer":"99", + "physic":"0" + }, + "224": + { + "layer":"99", + "physic":"0" + }, + "225": + { + "layer":"99", + "physic":"0" + }, + "226": + { + "layer":"99", + "physic":"0" + }, + "227": + { + "layer":"99", + "physic":"0" + }, + "228": + { + "layer":"99", + "physic":"0" + }, + "229": + { + "layer":"99", + "physic":"0" + }, + "23": + { + "layer":"99", + "physic":"0" + }, + "230": + { + "layer":"99", + "physic":"0" + }, + "231": + { + "layer":"99", + "physic":"0" + }, + "232": + { + "layer":"99", + "physic":"0" + }, + "233": + { + "layer":"99", + "physic":"0" + }, + "234": + { + "layer":"99", + "physic":"0" + }, + "235": + { + "layer":"99", + "physic":"0" + }, + "236": + { + "layer":"99", + "physic":"0" + }, + "237": + { + "layer":"99", + "physic":"0" + }, + "238": + { + "layer":"99", + "physic":"0" + }, + "239": + { + "layer":"99", + "physic":"0" + }, + "24": + { + "layer":"99", + "physic":"0" + }, + "240": + { + "layer":"99", + "physic":"0" + }, + "241": + { + "layer":"99", + "physic":"0" + }, + "242": + { + "layer":"99", + "physic":"0" + }, + "243": + { + "layer":"99", + "physic":"0" + }, + "244": + { + "layer":"99", + "physic":"0" + }, + "245": + { + "layer":"99", + "physic":"0" + }, + "246": + { + "layer":"99", + "physic":"0" + }, + "247": + { + "layer":"99", + "physic":"0" + }, + "248": + { + "layer":"99", + "physic":"0" + }, + "249": + { + "layer":"99", + "physic":"0" + }, + "25": + { + "layer":"99", + "physic":"0" + }, + "250": + { + "layer":"99", + "physic":"0" + }, + "251": + { + "layer":"99", + "physic":"0" + }, + "252": + { + "layer":"99", + "physic":"0" + }, + "253": + { + "layer":"99", + "physic":"0" + }, + "254": + { + "layer":"99", + "physic":"0" + }, + "255": + { + "layer":"99", + "physic":"0" + }, + "256": + { + "layer":"99", + "physic":"0" + }, + "257": + { + "layer":"99", + "physic":"0" + }, + "258": + { + "layer":"99", + "physic":"0" + }, + "259": + { + "layer":"99", + "physic":"0" + }, + "26": + { + "layer":"99", + "physic":"0" + }, + "260": + { + "layer":"99", + "physic":"0" + }, + "261": + { + "layer":"99", + "physic":"0" + }, + "262": + { + "layer":"99", + "physic":"0" + }, + "263": + { + "layer":"99", + "physic":"0" + }, + "264": + { + "layer":"99", + "physic":"0" + }, + "265": + { + "layer":"99", + "physic":"0" + }, + "266": + { + "layer":"99", + "physic":"0" + }, + "267": + { + "layer":"99", + "physic":"0" + }, + "268": + { + "layer":"99", + "physic":"0" + }, + "269": + { + "layer":"99", + "physic":"0" + }, + "27": + { + "layer":"99", + "physic":"0" + }, + "270": + { + "layer":"99", + "physic":"0" + }, + "271": + { + "layer":"99", + "physic":"0" + }, + "272": + { + "layer":"99", + "physic":"0" + }, + "273": + { + "layer":"99", + "physic":"0" + }, + "274": + { + "layer":"99", + "physic":"0" + }, + "275": + { + "layer":"99", + "physic":"0" + }, + "276": + { + "layer":"99", + "physic":"0" + }, + "277": + { + "layer":"99", + "physic":"0" + }, + "278": + { + "layer":"99", + "physic":"0" + }, + "279": + { + "layer":"99", + "physic":"0" + }, + "28": + { + "layer":"99", + "physic":"0" + }, + "280": + { + "layer":"99", + "physic":"0" + }, + "281": + { + "layer":"99", + "physic":"0" + }, + "282": + { + "layer":"99", + "physic":"0" + }, + "283": + { + "layer":"99", + "physic":"0" + }, + "284": + { + "layer":"99", + "physic":"0" + }, + "285": + { + "layer":"99", + "physic":"0" + }, + "286": + { + "layer":"99", + "physic":"0" + }, + "287": + { + "layer":"99", + "physic":"0" + }, + "288": + { + "layer":"99", + "physic":"0" + }, + "289": + { + "layer":"99", + "physic":"0" + }, + "29": + { + "layer":"99", + "physic":"0" + }, + "290": + { + "layer":"99", + "physic":"0" + }, + "291": + { + "layer":"99", + "physic":"0" + }, + "292": + { + "layer":"99", + "physic":"0" + }, + "293": + { + "layer":"99", + "physic":"0" + }, + "294": + { + "layer":"99", + "physic":"0" + }, + "295": + { + "layer":"99", + "physic":"0" + }, + "296": + { + "layer":"99", + "physic":"0" + }, + "297": + { + "layer":"99", + "physic":"0" + }, + "298": + { + "layer":"99", + "physic":"0" + }, + "299": + { + "layer":"99", + "physic":"0" + }, + "3": + { + "layer":"99", + "physic":"0" + }, + "30": + { + "layer":"99", + "physic":"0" + }, + "300": + { + "layer":"99", + "physic":"0" + }, + "301": + { + "layer":"99", + "physic":"0" + }, + "302": + { + "layer":"99", + "physic":"0" + }, + "303": + { + "layer":"99", + "physic":"0" + }, + "304": + { + "layer":"99", + "physic":"0" + }, + "305": + { + "layer":"99", + "physic":"0" + }, + "306": + { + "layer":"99", + "physic":"0" + }, + "307": + { + "layer":"99", + "physic":"0" + }, + "308": + { + "layer":"99", + "physic":"0" + }, + "309": + { + "layer":"99", + "physic":"0" + }, + "31": + { + "layer":"99", + "physic":"0" + }, + "310": + { + "layer":"99", + "physic":"0" + }, + "311": + { + "layer":"99", + "physic":"0" + }, + "312": + { + "layer":"99", + "physic":"0" + }, + "313": + { + "layer":"99", + "physic":"0" + }, + "314": + { + "layer":"99", + "physic":"0" + }, + "315": + { + "layer":"99", + "physic":"0" + }, + "316": + { + "layer":"99", + "physic":"0" + }, + "317": + { + "layer":"99", + "physic":"0" + }, + "318": + { + "layer":"99", + "physic":"0" + }, + "319": + { + "layer":"99", + "physic":"0" + }, + "32": + { + "layer":"99", + "physic":"0" + }, + "320": + { + "layer":"99", + "physic":"0" + }, + "321": + { + "layer":"99", + "physic":"0" + }, + "322": + { + "layer":"99", + "physic":"0" + }, + "323": + { + "layer":"99", + "physic":"0" + }, + "324": + { + "layer":"99", + "physic":"0" + }, + "325": + { + "layer":"99", + "physic":"0" + }, + "326": + { + "layer":"99", + "physic":"0" + }, + "327": + { + "layer":"99", + "physic":"0" + }, + "328": + { + "layer":"99", + "physic":"0" + }, + "329": + { + "layer":"99", + "physic":"0" + }, + "33": + { + "layer":"99", + "physic":"0" + }, + "330": + { + "layer":"99", + "physic":"0" + }, + "331": + { + "layer":"99", + "physic":"0" + }, + "332": + { + "layer":"99", + "physic":"0" + }, + "333": + { + "layer":"99", + "physic":"0" + }, + "334": + { + "layer":"99", + "physic":"0" + }, + "335": + { + "layer":"99", + "physic":"0" + }, + "336": + { + "layer":"99", + "physic":"0" + }, + "337": + { + "layer":"99", + "physic":"0" + }, + "338": + { + "layer":"99", + "physic":"0" + }, + "339": + { + "layer":"99", + "physic":"0" + }, + "34": + { + "layer":"99", + "physic":"0" + }, + "340": + { + "layer":"99", + "physic":"0" + }, + "341": + { + "layer":"99", + "physic":"0" + }, + "342": + { + "layer":"99", + "physic":"0" + }, + "343": + { + "layer":"99", + "physic":"0" + }, + "344": + { + "layer":"99", + "physic":"0" + }, + "345": + { + "layer":"99", + "physic":"0" + }, + "346": + { + "layer":"99", + "physic":"0" + }, + "347": + { + "layer":"99", + "physic":"0" + }, + "348": + { + "layer":"99", + "physic":"0" + }, + "349": + { + "layer":"99", + "physic":"0" + }, + "35": + { + "layer":"99", + "physic":"0" + }, + "350": + { + "layer":"99", + "physic":"0" + }, + "351": + { + "layer":"99", + "physic":"0" + }, + "352": + { + "layer":"99", + "physic":"0" + }, + "353": + { + "layer":"99", + "physic":"0" + }, + "354": + { + "layer":"99", + "physic":"0" + }, + "355": + { + "layer":"99", + "physic":"0" + }, + "356": + { + "layer":"99", + "physic":"0" + }, + "357": + { + "layer":"99", + "physic":"0" + }, + "358": + { + "layer":"99", + "physic":"0" + }, + "359": + { + "layer":"99", + "physic":"0" + }, + "36": + { + "layer":"99", + "physic":"0" + }, + "360": + { + "layer":"99", + "physic":"0" + }, + "361": + { + "layer":"99", + "physic":"0" + }, + "362": + { + "layer":"99", + "physic":"0" + }, + "363": + { + "layer":"99", + "physic":"0" + }, + "364": + { + "layer":"99", + "physic":"0" + }, + "365": + { + "layer":"99", + "physic":"0" + }, + "366": + { + "layer":"99", + "physic":"0" + }, + "367": + { + "layer":"99", + "physic":"0" + }, + "368": + { + "layer":"99", + "physic":"0" + }, + "369": + { + "layer":"99", + "physic":"0" + }, + "37": + { + "layer":"99", + "physic":"0" + }, + "370": + { + "layer":"99", + "physic":"0" + }, + "371": + { + "layer":"99", + "physic":"0" + }, + "372": + { + "layer":"99", + "physic":"0" + }, + "373": + { + "layer":"99", + "physic":"0" + }, + "374": + { + "layer":"99", + "physic":"0" + }, + "375": + { + "layer":"99", + "physic":"0" + }, + "376": + { + "layer":"99", + "physic":"0" + }, + "377": + { + "layer":"99", + "physic":"0" + }, + "378": + { + "layer":"99", + "physic":"0" + }, + "379": + { + "layer":"99", + "physic":"0" + }, + "38": + { + "layer":"99", + "physic":"0" + }, + "380": + { + "layer":"99", + "physic":"0" + }, + "381": + { + "layer":"99", + "physic":"0" + }, + "382": + { + "layer":"99", + "physic":"0" + }, + "383": + { + "layer":"99", + "physic":"0" + }, + "384": + { + "layer":"99", + "physic":"0" + }, + "385": + { + "layer":"99", + "physic":"0" + }, + "386": + { + "layer":"99", + "physic":"0" + }, + "387": + { + "layer":"99", + "physic":"0" + }, + "388": + { + "layer":"99", + "physic":"0" + }, + "389": + { + "layer":"99", + "physic":"0" + }, + "39": + { + "layer":"99", + "physic":"0" + }, + "390": + { + "layer":"99", + "physic":"0" + }, + "391": + { + "layer":"99", + "physic":"0" + }, + "392": + { + "layer":"99", + "physic":"0" + }, + "393": + { + "layer":"99", + "physic":"0" + }, + "394": + { + "layer":"99", + "physic":"0" + }, + "395": + { + "layer":"99", + "physic":"0" + }, + "396": + { + "layer":"99", + "physic":"0" + }, + "397": + { + "layer":"99", + "physic":"0" + }, + "398": + { + "layer":"99", + "physic":"0" + }, + "399": + { + "layer":"99", + "physic":"0" + }, + "4": + { + "layer":"99", + "physic":"0" + }, + "40": + { + "layer":"99", + "physic":"0" + }, + "400": + { + "layer":"99", + "physic":"0" + }, + "401": + { + "layer":"99", + "physic":"0" + }, + "402": + { + "layer":"99", + "physic":"0" + }, + "403": + { + "layer":"99", + "physic":"0" + }, + "404": + { + "layer":"99", + "physic":"0" + }, + "405": + { + "layer":"99", + "physic":"0" + }, + "406": + { + "layer":"99", + "physic":"0" + }, + "407": + { + "layer":"99", + "physic":"0" + }, + "408": + { + "layer":"99", + "physic":"0" + }, + "409": + { + "layer":"99", + "physic":"0" + }, + "41": + { + "layer":"99", + "physic":"0" + }, + "410": + { + "layer":"99", + "physic":"0" + }, + "411": + { + "layer":"99", + "physic":"0" + }, + "412": + { + "layer":"99", + "physic":"0" + }, + "413": + { + "layer":"99", + "physic":"0" + }, + "414": + { + "layer":"99", + "physic":"0" + }, + "415": + { + "layer":"99", + "physic":"0" + }, + "416": + { + "layer":"99", + "physic":"0" + }, + "417": + { + "layer":"99", + "physic":"0" + }, + "418": + { + "layer":"99", + "physic":"0" + }, + "419": + { + "layer":"99", + "physic":"0" + }, + "42": + { + "layer":"99", + "physic":"0" + }, + "420": + { + "layer":"99", + "physic":"0" + }, + "421": + { + "layer":"99", + "physic":"0" + }, + "422": + { + "layer":"99", + "physic":"0" + }, + "423": + { + "layer":"99", + "physic":"0" + }, + "424": + { + "layer":"99", + "physic":"0" + }, + "425": + { + "layer":"99", + "physic":"0" + }, + "426": + { + "layer":"99", + "physic":"0" + }, + "427": + { + "layer":"99", + "physic":"0" + }, + "428": + { + "layer":"99", + "physic":"0" + }, + "429": + { + "layer":"99", + "physic":"0" + }, + "43": + { + "layer":"99", + "physic":"0" + }, + "430": + { + "layer":"99", + "physic":"0" + }, + "431": + { + "layer":"99", + "physic":"0" + }, + "432": + { + "layer":"99", + "physic":"0" + }, + "433": + { + "layer":"99", + "physic":"0" + }, + "434": + { + "layer":"99", + "physic":"0" + }, + "435": + { + "layer":"99", + "physic":"0" + }, + "436": + { + "layer":"99", + "physic":"0" + }, + "437": + { + "layer":"99", + "physic":"0" + }, + "438": + { + "layer":"99", + "physic":"0" + }, + "439": + { + "layer":"99", + "physic":"0" + }, + "44": + { + "layer":"99", + "physic":"0" + }, + "440": + { + "layer":"99", + "physic":"0" + }, + "441": + { + "layer":"99", + "physic":"0" + }, + "442": + { + "layer":"99", + "physic":"0" + }, + "443": + { + "layer":"99", + "physic":"0" + }, + "444": + { + "layer":"99", + "physic":"0" + }, + "445": + { + "layer":"99", + "physic":"0" + }, + "446": + { + "layer":"99", + "physic":"0" + }, + "447": + { + "layer":"99", + "physic":"0" + }, + "448": + { + "layer":"99", + "physic":"0" + }, + "449": + { + "layer":"99", + "physic":"0" + }, + "45": + { + "layer":"99", + "physic":"0" + }, + "450": + { + "layer":"99", + "physic":"0" + }, + "451": + { + "layer":"99", + "physic":"0" + }, + "452": + { + "layer":"99", + "physic":"0" + }, + "453": + { + "layer":"99", + "physic":"0" + }, + "454": + { + "layer":"99", + "physic":"0" + }, + "455": + { + "layer":"99", + "physic":"0" + }, + "456": + { + "layer":"99", + "physic":"0" + }, + "457": + { + "layer":"99", + "physic":"0" + }, + "458": + { + "layer":"99", + "physic":"0" + }, + "459": + { + "layer":"99", + "physic":"0" + }, + "46": + { + "layer":"99", + "physic":"0" + }, + "460": + { + "layer":"99", + "physic":"0" + }, + "461": + { + "layer":"99", + "physic":"0" + }, + "462": + { + "layer":"99", + "physic":"0" + }, + "463": + { + "layer":"99", + "physic":"0" + }, + "464": + { + "layer":"99", + "physic":"0" + }, + "465": + { + "layer":"99", + "physic":"0" + }, + "466": + { + "layer":"99", + "physic":"0" + }, + "467": + { + "layer":"99", + "physic":"0" + }, + "468": + { + "layer":"99", + "physic":"0" + }, + "469": + { + "layer":"99", + "physic":"0" + }, + "47": + { + "layer":"99", + "physic":"0" + }, + "470": + { + "layer":"99", + "physic":"0" + }, + "471": + { + "layer":"99", + "physic":"0" + }, + "472": + { + "layer":"99", + "physic":"0" + }, + "473": + { + "layer":"99", + "physic":"0" + }, + "474": + { + "layer":"99", + "physic":"0" + }, + "475": + { + "layer":"99", + "physic":"0" + }, + "476": + { + "layer":"99", + "physic":"0" + }, + "477": + { + "layer":"99", + "physic":"0" + }, + "478": + { + "layer":"99", + "physic":"0" + }, + "479": + { + "layer":"99", + "physic":"0" + }, + "48": + { + "layer":"99", + "physic":"0" + }, + "480": + { + "layer":"99", + "physic":"0" + }, + "481": + { + "layer":"99", + "physic":"0" + }, + "482": + { + "layer":"99", + "physic":"0" + }, + "483": + { + "layer":"99", + "physic":"0" + }, + "484": + { + "layer":"99", + "physic":"0" + }, + "485": + { + "layer":"99", + "physic":"0" + }, + "486": + { + "layer":"99", + "physic":"0" + }, + "487": + { + "layer":"99", + "physic":"0" + }, + "488": + { + "layer":"99", + "physic":"0" + }, + "489": + { + "layer":"99", + "physic":"0" + }, + "49": + { + "layer":"99", + "physic":"0" + }, + "490": + { + "layer":"99", + "physic":"0" + }, + "491": + { + "layer":"99", + "physic":"0" + }, + "492": + { + "layer":"99", + "physic":"0" + }, + "493": + { + "layer":"99", + "physic":"0" + }, + "494": + { + "layer":"99", + "physic":"0" + }, + "495": + { + "layer":"99", + "physic":"0" + }, + "496": + { + "layer":"99", + "physic":"0" + }, + "497": + { + "layer":"99", + "physic":"0" + }, + "498": + { + "layer":"99", + "physic":"0" + }, + "499": + { + "layer":"99", + "physic":"0" + }, + "5": + { + "layer":"99", + "physic":"0" + }, + "50": + { + "layer":"99", + "physic":"0" + }, + "500": + { + "layer":"99", + "physic":"0" + }, + "501": + { + "layer":"99", + "physic":"0" + }, + "502": + { + "layer":"99", + "physic":"0" + }, + "503": + { + "layer":"99", + "physic":"0" + }, + "504": + { + "layer":"99", + "physic":"0" + }, + "505": + { + "layer":"99", + "physic":"0" + }, + "506": + { + "layer":"99", + "physic":"0" + }, + "507": + { + "layer":"99", + "physic":"0" + }, + "508": + { + "layer":"99", + "physic":"0" + }, + "509": + { + "layer":"99", + "physic":"0" + }, + "51": + { + "layer":"99", + "physic":"0" + }, + "510": + { + "layer":"99", + "physic":"0" + }, + "511": + { + "layer":"99", + "physic":"0" + }, + "512": + { + "layer":"99", + "physic":"0" + }, + "513": + { + "layer":"99", + "physic":"0" + }, + "514": + { + "layer":"99", + "physic":"0" + }, + "515": + { + "layer":"99", + "physic":"0" + }, + "516": + { + "layer":"99", + "physic":"0" + }, + "517": + { + "layer":"99", + "physic":"0" + }, + "518": + { + "layer":"99", + "physic":"0" + }, + "519": + { + "layer":"99", + "physic":"0" + }, + "52": + { + "layer":"99", + "physic":"0" + }, + "520": + { + "layer":"99", + "physic":"0" + }, + "521": + { + "layer":"99", + "physic":"0" + }, + "522": + { + "layer":"99", + "physic":"0" + }, + "523": + { + "layer":"99", + "physic":"0" + }, + "524": + { + "layer":"99", + "physic":"0" + }, + "525": + { + "layer":"99", + "physic":"0" + }, + "526": + { + "layer":"99", + "physic":"0" + }, + "527": + { + "layer":"99", + "physic":"0" + }, + "528": + { + "layer":"99", + "physic":"0" + }, + "529": + { + "layer":"99", + "physic":"0" + }, + "53": + { + "layer":"99", + "physic":"0" + }, + "530": + { + "layer":"99", + "physic":"0" + }, + "531": + { + "layer":"99", + "physic":"0" + }, + "532": + { + "layer":"99", + "physic":"0" + }, + "533": + { + "layer":"99", + "physic":"0" + }, + "534": + { + "layer":"99", + "physic":"0" + }, + "535": + { + "layer":"99", + "physic":"0" + }, + "536": + { + "layer":"99", + "physic":"0" + }, + "537": + { + "layer":"99", + "physic":"0" + }, + "538": + { + "layer":"99", + "physic":"0" + }, + "539": + { + "layer":"99", + "physic":"0" + }, + "54": + { + "layer":"99", + "physic":"0" + }, + "540": + { + "layer":"99", + "physic":"0" + }, + "541": + { + "layer":"99", + "physic":"0" + }, + "542": + { + "layer":"99", + "physic":"0" + }, + "543": + { + "layer":"99", + "physic":"0" + }, + "544": + { + "layer":"99", + "physic":"0" + }, + "545": + { + "layer":"99", + "physic":"0" + }, + "546": + { + "layer":"99", + "physic":"0" + }, + "547": + { + "layer":"99", + "physic":"0" + }, + "548": + { + "layer":"99", + "physic":"0" + }, + "549": + { + "layer":"99", + "physic":"0" + }, + "55": + { + "layer":"99", + "physic":"0" + }, + "550": + { + "layer":"99", + "physic":"0" + }, + "551": + { + "layer":"99", + "physic":"0" + }, + "552": + { + "layer":"99", + "physic":"0" + }, + "553": + { + "layer":"99", + "physic":"0" + }, + "554": + { + "layer":"99", + "physic":"0" + }, + "555": + { + "layer":"99", + "physic":"0" + }, + "556": + { + "layer":"99", + "physic":"0" + }, + "557": + { + "layer":"99", + "physic":"0" + }, + "558": + { + "layer":"99", + "physic":"0" + }, + "559": + { + "layer":"99", + "physic":"0" + }, + "56": + { + "layer":"99", + "physic":"0" + }, + "560": + { + "layer":"99", + "physic":"0" + }, + "561": + { + "layer":"99", + "physic":"0" + }, + "562": + { + "layer":"99", + "physic":"0" + }, + "563": + { + "layer":"99", + "physic":"0" + }, + "564": + { + "layer":"99", + "physic":"0" + }, + "565": + { + "layer":"99", + "physic":"0" + }, + "566": + { + "layer":"99", + "physic":"0" + }, + "57": + { + "layer":"99", + "physic":"0" + }, + "58": + { + "layer":"99", + "physic":"0" + }, + "59": + { + "layer":"99", + "physic":"0" + }, + "6": + { + "layer":"99", + "physic":"0" + }, + "60": + { + "layer":"99", + "physic":"0" + }, + "61": + { + "layer":"99", + "physic":"0" + }, + "62": + { + "layer":"99", + "physic":"0" + }, + "63": + { + "layer":"99", + "physic":"0" + }, + "64": + { + "layer":"99", + "physic":"0" + }, + "65": + { + "layer":"99", + "physic":"0" + }, + "66": + { + "layer":"99", + "physic":"0" + }, + "67": + { + "layer":"99", + "physic":"0" + }, + "68": + { + "layer":"99", + "physic":"0" + }, + "69": + { + "layer":"99", + "physic":"0" + }, + "7": + { + "layer":"99", + "physic":"0" + }, + "70": + { + "layer":"99", + "physic":"0" + }, + "71": + { + "layer":"99", + "physic":"0" + }, + "72": + { + "layer":"99", + "physic":"0" + }, + "73": + { + "layer":"99", + "physic":"0" + }, + "74": + { + "layer":"99", + "physic":"0" + }, + "75": + { + "layer":"99", + "physic":"0" + }, + "76": + { + "layer":"99", + "physic":"0" + }, + "77": + { + "animate":"1", + "layer":"99", + "next":"78", + "physic":"0", + "time":"0.1" + }, + "78": + { + "animate":"1", + "layer":"99", + "next":"77", + "physic":"0", + "time":"0.1" + }, + "79": + { + "layer":"99", + "physic":"0" + }, + "8": + { + "layer":"99", + "physic":"0" + }, + "80": + { + "layer":"99", + "physic":"0" + }, + "81": + { + "layer":"99", + "physic":"0" + }, + "82": + { + "layer":"99", + "physic":"0" + }, + "83": + { + "layer":"99", + "physic":"0" + }, + "84": + { + "layer":"99", + "physic":"0" + }, + "85": + { + "layer":"99", + "physic":"0" + }, + "86": + { + "layer":"99", + "physic":"0" + }, + "87": + { + "layer":"99", + "physic":"0" + }, + "88": + { + "layer":"99", + "physic":"0" + }, + "89": + { + "layer":"99", + "physic":"0" + }, + "9": + { + "layer":"99", + "physic":"0" + }, + "90": + { + "layer":"99", + "physic":"0" + }, + "91": + { + "layer":"99", + "physic":"0" + }, + "92": + { + "layer":"99", + "physic":"0" + }, + "93": + { + "layer":"99", + "physic":"0" + }, + "94": + { + "layer":"99", + "physic":"0" + }, + "95": + { + "layer":"99", + "physic":"0" + }, + "96": + { + "layer":"99", + "physic":"0" + }, + "97": + { + "layer":"99", + "physic":"0" + }, + "98": + { + "layer":"99", + "physic":"0" + }, + "99": + { + "layer":"99", + "physic":"0" + } + }, + "tilewidth":32 + }], + "tilewidth":32, + "version":1, + "width":27 +} diff --git a/Maps/mapStart.json b/Maps/mapStart.json @@ -0,0 +1,322 @@ +{ "height":16, + "layers":[ + { + "data":[57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 66, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 67, 40, 40, 40, 40, 75, 40, 40, 40, 40, 67, 40, 40, 40, 40, 40, 40, 40, 55, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49], + "height":16, + "name":"Tile Layer 2", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }, + { + "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 32, 0, 0, 0, 0, 41, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 181, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 190, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 0, 0, 0, 199, 200, 201, 202, 203, 204, 205, 0, 0, 0, 0, 19, 20, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, 142, 0, 0, 0, 70, 0, 0, 0, 0, 163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 150, 151, 0, 0, 0, 0, 0, 0, 0, 0, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, 0, 0, 0, 0, 0, 38, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":16, + "name":"Tile Layer 3", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }], + "orientation":"orthogonal", + "properties": + { + "startMap":"true" + }, + "renderorder":"right-down", + "tileheight":32, + "tilesets":[ + { + "firstgid":1, + "image":"Resources\/Images\/castle_2.png", + "imageheight":768, + "imagewidth":288, + "margin":0, + "name":"castle", + "properties": + { + + }, + "spacing":0, + "tileheight":32, + "tileproperties": + { + "140": + { + "physic":"0" + }, + "141": + { + "physic":"0" + }, + "142": + { + "physic":"0" + }, + "149": + { + "physic":"0" + }, + "150": + { + "physic":"0" + }, + "151": + { + "physic":"0" + }, + "162": + { + "physic":"0" + }, + "163": + { + "physic":"0" + }, + "164": + { + "physic":"0" + }, + "165": + { + "physic":"0" + }, + "166": + { + "physic":"0" + }, + "167": + { + "physic":"0" + }, + "168": + { + "physic":"0" + }, + "169": + { + "physic":"0" + }, + "171": + { + "physic":"0" + }, + "172": + { + "physic":"0" + }, + "173": + { + "physic":"0" + }, + "174": + { + "physic":"0" + }, + "175": + { + "physic":"0" + }, + "176": + { + "physic":"0" + }, + "177": + { + "physic":"0" + }, + "178": + { + "physic":"0" + }, + "180": + { + "physic":"0" + }, + "181": + { + "physic":"0" + }, + "182": + { + "physic":"0" + }, + "183": + { + "physic":"0" + }, + "184": + { + "physic":"0" + }, + "185": + { + "physic":"0" + }, + "186": + { + "physic":"0" + }, + "187": + { + "physic":"0" + }, + "189": + { + "physic":"0" + }, + "190": + { + "physic":"0" + }, + "191": + { + "physic":"0" + }, + "192": + { + "physic":"0" + }, + "193": + { + "physic":"0" + }, + "194": + { + "physic":"0" + }, + "195": + { + "physic":"0" + }, + "196": + { + "physic":"0" + }, + "198": + { + "physic":"0" + }, + "199": + { + "physic":"0" + }, + "200": + { + "physic":"0" + }, + "201": + { + "physic":"0" + }, + "202": + { + "physic":"0" + }, + "203": + { + "physic":"0" + }, + "204": + { + "physic":"0" + }, + "205": + { + "physic":"0" + }, + "27": + { + "physic":"0" + }, + "28": + { + "physic":"0" + }, + "29": + { + "physic":"0" + }, + "30": + { + "physic":"0" + }, + "31": + { + "physic":"0" + }, + "32": + { + "physic":"0" + }, + "33": + { + "physic":"0" + }, + "36": + { + "physic":"0" + }, + "37": + { + "physic":"0" + }, + "38": + { + "physic":"0" + }, + "39": + { + "physic":"0" + }, + "40": + { + "physic":"0" + }, + "41": + { + "physic":"0" + }, + "42": + { + "physic":"0" + }, + "48": + { + "dialog":"drink" + }, + "60": + { + "physic":"0" + }, + "61": + { + "physic":"0" + }, + "69": + { + "physic":"0" + }, + "70": + { + "physic":"0" + }, + "90": + { + "physic":"0" + }, + "99": + { + "physic":"0" + } + }, + "tilewidth":32 + }], + "tilewidth":32, + "version":1, + "width":27 +}+ \ No newline at end of file diff --git a/README.md b/README.md @@ -4,6 +4,10 @@ [![License](https://img.shields.io/badge/license-BSD-blue.svg)](LICENSE) [![Join the chat at https://gitter.im/Ne02ptzero/Grog-Like](https://img.shields.io/badge/chat-gitter-red.svg)](https://gitter.im/Ne02ptzero/Grog-Like?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +![Preview](http://i.imgur.com/pxoln1y.png) +![Preview](http://i.imgur.com/krCtJAD.png) +![Preview](http://i.imgur.com/AbRAfmi.png) + ### First draft on open project thoughts and timeline Our goal is to create a video game based on the quite popular genre hybrid Rogue-Like. It is a very broad type of game, but the main idea behind it is always the same. A playthrough that isn’t too long (can be finished in an hour or so) but a huge replayability. Each time you run through the game, you’ll encounter different enemies, bosses, objects, map layout, and finishing a playthrough is rewarding in itself for the player as it unlocks new objects/enemies/levels in order to alter the gameplay for the next run. The death is permanent, and once your character dies, you have to restart from the beginning. @@ -21,15 +25,36 @@ On the topic of our game, we are looking to create a 2D scrolling game with proc git clone --recursive http://github.com/Ne02ptzero/Grog-Knight ``` +**Compilation & Installation**: + +Linux: +``` +make +sudo make install +``` + +OSX: +``` +make -C MACOSX +``` + ## About: This project use [Angel2d](https://github.com/angel2d/angel2d), [Documentation](http://docs.angel2d.com/) ### Authors: -*Vincent Rey* (N0ich) <vin100.rey@gmail.com> +**Vincent Rey**-N0ich <vin100.rey@gmail.com> + +**Louis Solofrizzo**-Ne02ptzero <louis@ne02ptzero.me> + +**Manon Budin**-Fakoc + +**Valentin Diridollou**-Valouche + +**Lois Pearron**-lenscorwin -*Louis Solofrizzo* (Ne02ptzero) <louis@ne02ptzero.me> +**Ryad Kharif**-Fusiow ### Contributing [Rules Here :)](Contributing.md) diff --git a/Resources/Dialogs/dialogs.json b/Resources/Dialogs/dialogs.json @@ -0,0 +1,22 @@ +{ + "bathroom":[ + "Hum...", + "This party is about medieval-shit.", + "Let's go prepare !" + ], + "goodbye": [ + "I gotta go guys !", + "See you tomorrow" + ], + "drink": [ + "Uhu, maybe i drank too much..", + "Hips", + "Where am i ?" + ], + "start": [ + "WTF", + "WHAT IS THAT ?!", + "...", + "Is this instructions ? Tsss, don't need them" + ] +} diff --git a/Resources/Elements/Armors/Armor_000.json b/Resources/Elements/Armors/Armor_000.json @@ -12,6 +12,6 @@ "hpBuff": 0, "dmgReduc": 1, "bonusSpeed": 2, - "bonusDmg": 5 + "bonusDmg": 1 } } diff --git a/Resources/Elements/Enemies/EnemyGround_000.json b/Resources/Elements/Enemies/EnemyGround_000.json @@ -2,7 +2,7 @@ "infos": { "name": "EnemyGround_000", "id": 1, - "maxHP": 10, + "maxHP": 100, "sprites": "Resources/Images/Enemy/EnemyGround_000/enemy_000.png", "size": 1.3, "maxSpeed": 5, diff --git a/Resources/Elements/Rings/Ring_000.json b/Resources/Elements/Rings/Ring_000.json @@ -12,6 +12,6 @@ "hpBuff": 0, "dmgReduc": 1, "bonusSpeed": 2, - "bonusDmg": 5 + "bonusDmg": 1 } } diff --git a/Resources/Elements/SpecialAttack.json b/Resources/Elements/SpecialAttack.json @@ -28,6 +28,21 @@ "description": "Fall with force on the ground,\nMake a shockwave around you", "displayName": "Shockwave" }, + "throwWeapon": { + "subscribe": "specialattack", + "usable": "warrior", + "cooldown": 15, + "damage": 25, + "beginFrame_right": 99, + "endFrame_right": 101, + "beginFrame_left": 105, + "endFrame_left": 107, + "time": 0.1, + "x":2, + "y":2, + "description": "throw your weapon", + "displayName": "throwWeapon" + }, "rapidFire": { "subscribe": "specialattack", "usable": "archer", diff --git a/Resources/Elements/SpecialMoves.json b/Resources/Elements/SpecialMoves.json @@ -2,7 +2,7 @@ "dash": { "subscribe": "specialmove", "usable": "warrior", - "cooldown": 1, + "cooldown": 5, "dashSpeed": 30, "uptime": 0.15, "beginFrame_right": 74, @@ -16,7 +16,7 @@ "charge": { "subscribe": "specialmove", "usable": "warrior", - "cooldown": 1, + "cooldown": 5, "chargeSpeed": 20, "time": 0.1, "uptime": 1, @@ -26,7 +26,7 @@ "stomp": { "subscribe": "specialmove", "usable": "warrior", - "cooldown": 0, + "cooldown": 1, "stompSpeed": 50, "beginFrame_right": 84, "endFrame_right": 87, diff --git a/Resources/Elements/Warrior.json b/Resources/Elements/Warrior.json @@ -10,12 +10,14 @@ "hitboxType": "special", "hitbox": "heroHitbox", "baseCrit": 2, - "baseDamage": 30 + "baseDamage": 30, + "baseDamageReduction": 1 }, "Stats": { "critMult": 0.2, "damageMult": 0.5, - "HPMult": 0.1 + "HPMult": 0.1, + "damageReductionMult": 0.5 }, "Actions": { "starting": { diff --git a/Resources/Elements/Weapons/Axe_002.json b/Resources/Elements/Weapons/Axe_002.json @@ -15,7 +15,6 @@ "active": 0.2, "attack": "melee", "sprites": "Resources/Images/Weapons/Axe_002.png", - "lootLevel": 3, - "starterLevel": 3 + "lootLevel": 3 } } diff --git a/Resources/Elements/Weapons/Axe_003.json b/Resources/Elements/Weapons/Axe_003.json @@ -15,6 +15,7 @@ "active": 0.2, "attack": "melee", "sprites": "Resources/Images/Weapons/Axe_003.png", - "lootLevel": 1 + "lootLevel": 1, + "starterLevel": 1 } } diff --git a/Resources/Elements/Weapons/Axe_004.json b/Resources/Elements/Weapons/Axe_004.json @@ -16,6 +16,5 @@ "attack": "melee", "sprites": "Resources/Images/Weapons/Axe_004.png", "lootLevel": 2 - } } diff --git a/Resources/Elements/Weapons/Spear_000.json b/Resources/Elements/Weapons/Spear_000.json @@ -9,7 +9,7 @@ "hitbox": "SWORD", "size": 1, "critRate": 5, - "damage": 5, + "damage": 1, "recovery": 1, "pushback": 5, "active": 0.2, diff --git a/Resources/HUD/spell_cooldown.png b/Resources/HUD/spell_cooldown.png Binary files differ. diff --git a/Resources/Images/Menu/menu.png b/Resources/Images/Menu/menu.png Binary files differ. diff --git a/Resources/Images/Resources b/Resources/Images/Resources @@ -0,0 +1 @@ +..+ \ No newline at end of file diff --git a/Resources/Images/beer.png b/Resources/Images/beer.png Binary files differ. diff --git a/Resources/Images/big_dialog.png b/Resources/Images/big_dialog.png Binary files differ. diff --git a/Resources/Images/castle_2.png b/Resources/Images/castle_2.png Binary files differ. diff --git a/Resources/Images/castle_3.png b/Resources/Images/castle_3.png Binary files differ. diff --git a/Resources/Images/logo.png b/Resources/Images/logo.png Binary files differ. diff --git a/Resources/Images/map_start.png b/Resources/Images/map_start.png Binary files differ. diff --git a/Sources/inc/Characters.hpp b/Sources/inc/Characters.hpp @@ -148,6 +148,7 @@ class Characters : public Elements { int _maxSpeed; int _isJump; int _isRunning; + int _isBlock; int _isAttacking; int _hp; int _gold; diff --git a/Sources/inc/Game.hpp b/Sources/inc/Game.hpp @@ -169,6 +169,7 @@ class Game { static int World; static Boss *boss; static void newBoss(std::string n, int x, int y); + static std::list<b2DistanceJoint *> jointList; private: float beginXHero; diff --git a/Sources/inc/HUDWindow.hpp b/Sources/inc/HUDWindow.hpp @@ -55,6 +55,8 @@ class HUDWindow : public HUDActor { Characters *toFollow; int isFading; int isTalk; + b2DistanceJoint *joint1; + b2DistanceJoint *joint2; }; HUDWindow(void); @@ -62,7 +64,7 @@ class HUDWindow : public HUDActor { void ReceiveMessage(Message *m); HUDWindow::Text *setText(std::string str, int x, int y); - HUDWindow::Text *setText(std::string str, int x, int y, Vector3 color, int alpha); + HUDWindow::Text *setText(std::string str, int x, int y, Vector3 color, float alpha); HUDWindow::Text *setText(std::string str, int x, int y, Vector3 color, int alpha, std::string font); HUDWindow::Text *setText(std::string str, Characters *toFollow, Vector3 color, int isFading, int isTalk, int isInMenu = 0); void updateText(std::string org, std::string newStr); @@ -99,6 +101,7 @@ class HUDWindow : public HUDActor { void speAttCooldown(int time); void speMoveCooldown(int time); void spellText(void); + void dialog(std::string name); HUDActor *getAttCooldown(void); HUDActor *getMoveCooldown(void); @@ -124,6 +127,17 @@ class HUDWindow : public HUDActor { int _cooldownMove; void _drawDoor(Vector2 size, Vector2 position); int _doNotDelete; + Json::Value _dialogs; + Json::ValueIterator _it; + HUDActor *_fade; + HUDActor *_perso; + HUDActor *_backDialog; + std::string _currentDialog; + int _isInDialog; + std::list<std::string> _dialogPassed; + + void _createDialog(void); + void _cleanDialog(void); }; #endif diff --git a/Sources/inc/Maps.hpp b/Sources/inc/Maps.hpp @@ -58,6 +58,8 @@ class Maps { int displayLevel(std::vector<std::vector<int> > map); Map* bossMap; Map* secretMap; + Map *startMap; + Map *cityMap; std::vector<std::vector<Map> > getMapXY(void); std::vector<std::vector<Map> > _XYMap; @@ -67,6 +69,7 @@ class Maps { std::string _directory; Json::Value _root; Json::Reader _reader; + int _startMapIsSet; std::map<int, std::list<Map *> > _mapByDoor; }; diff --git a/Sources/inc/Menu.hpp b/Sources/inc/Menu.hpp @@ -57,6 +57,7 @@ class Menu : public Actor { void parseBindings(void); void bindingMenu(int y = 0); int applyBindings(void); + void introGame(void); std::map<std::string, std::list<t_bind *> > getBindings(void); @@ -71,6 +72,8 @@ class Menu : public Actor { std::map<std::string, std::map<std::string, int> > _settingsValues; std::list<std::string> _elementsPauseMenu; HUDActor *_fadeActor; + HUDActor *_logo; + HUDActor *_beer; std::list<std::string> _pauseMenuText; int _lastMenu; int _isBinding; diff --git a/Sources/inc/MenuCharacter.hpp b/Sources/inc/MenuCharacter.hpp @@ -56,6 +56,7 @@ class MenuCharacter : public Characters { Armor *getArmor(void); std::vector<std::string> getSkills(void); int getLevel(void); + bool canStart(void); protected: virtual void _forward(int status); @@ -86,7 +87,6 @@ class MenuCharacter : public Characters { Elements *_choicePointer; Actor *_target; Actor *_target2; - int _isBlock; std::string _character; Elements *_closet; std::list<Elements *> _backCloset; @@ -112,5 +112,7 @@ class MenuCharacter : public Characters { std::list<std::string> _description; Elements *_levelsBackground; Elements *_lvlUp; + std::string _textInfo; + int _closetReady; }; #endif diff --git a/Sources/inc/Projectile.hpp b/Sources/inc/Projectile.hpp @@ -35,7 +35,7 @@ public: Projectile(float x, float y, int direction, std::string owner); Projectile(Weapon *w, Characters *c); Projectile(Weapon *w, int dmg); - Projectile(std::string img, int dmg, Vector2 pos, Vector2 force, Vector2 init, std::string name = "projectile", int rotat = -1); + Projectile(std::string img, int dmg, Vector2 pos, Vector2 force, Vector2 init, std::string name = "projectile", int rotat = -1, float isGravity = 0); ~Projectile(); std::string getName(void); diff --git a/Sources/inc/SpecialAttack.hpp b/Sources/inc/SpecialAttack.hpp @@ -52,6 +52,7 @@ void _whirlwind(void); void _shockwave(void); void _rapidFire(void); + void _throwWeapon(void); private: diff --git a/Sources/src/Boss.cpp b/Sources/src/Boss.cpp @@ -123,7 +123,7 @@ void Boss::BeginContact(Elements *elem, b2Contact *contact) { return ; if (type == "HeroWeaponHitBox") { damage = w->getDamage(); crit = w->getCritRate(); - } else if (type == "HeroProjectile") { + } else if (type == "HeroProjectile" || elem->getAttribute("spe") == "throwWeapon") { damage = p->getDamage(); crit = p->getCritRate(); } else if (type == "Shockwave") { damage = p->getDamage(); crit = 0; diff --git a/Sources/src/Characters.cpp b/Sources/src/Characters.cpp @@ -80,6 +80,7 @@ Characters::Characters(std::string name) : _name(name), _isRunning(0), _isJump(0 this->_speMoveReady = 1; this->_speAttReady = 1; this->_hasDashed = 0; + this->_isBlock = 0; this->SetLayer(100); this->_flyTrigger = false; this->_isDisengaging = false; @@ -601,6 +602,8 @@ void Characters::BeginContact(Elements *elem, b2Contact *contact) { } if (elem->getAttribute("trigger") != "") { this->_callTrigger(elem->getAttribute("trigger"), 1); + } if (elem->getAttribute("dialog") != "") { + Game::getHUD()->dialog(elem->getAttribute("dialog")); } if (elem->getAttribute("triggerOn") != "") { this->trigger(elem->getAttribute("triggerOn"), 1); } if (elem->getAttribute("triggerOff") != "") { @@ -764,10 +767,12 @@ void Characters::EndContact(Elements *elem, b2Contact *contact) { * @sa Game::makeItRun */ void Characters::_run(void) { - if (this->_isRunning == 1) - this->_forward(2); - else if (this->_isRunning == 2) - this->_backward(2); + if (!this->_isBlock) { + if (this->_isRunning == 1) + this->_forward(2); + else if (this->_isRunning == 2) + this->_backward(2); + } } /****************************/ @@ -1200,7 +1205,7 @@ void Characters::_pickupItem(int status) { void Characters::_specialMove(int status) { if (status == 1 && this->_speMoveReady) { - if (this->_speMove == "totem" && this->_totemDeletionSent == 0 && this->_totem != nullptr) + if (this->_speMove == "totem" && this->_totemDeletionSent == 0 && this->_totem != nullptr) this->_totemDeletionSent = 1; theSwitchboard.SubscribeTo(this, "removeTotem"); theSwitchboard.DeferredBroadcast(new Message("removeTotem"), 3); @@ -1240,6 +1245,8 @@ void Characters::_specialAttack(int status) { this->_eqAtt->_shockwave(); if (this->_speAtt == "rapidFire") this->_eqAtt->_rapidFire(); + else if (this->_speAtt == "throwWeapon") + this->_eqAtt->_throwWeapon(); } } @@ -1421,6 +1428,8 @@ void Characters::_heroDeath(void) { void Characters::unsubscribeFromAll(void) { std::list<std::string>::iterator it; + this->ReceiveMessage(new Message("forwardReleased")); + this->ReceiveMessage(new Message("backwardReleased")); for (it = this->_subsc.begin(); it != this->_subsc.end(); it++) { theSwitchboard.UnsubscribeFrom(this, *it); } diff --git a/Sources/src/Dealer.cpp b/Sources/src/Dealer.cpp @@ -64,6 +64,8 @@ void Dealer::init(void) { void Dealer::BeginContact(Elements* elem, b2Contact *contact) { HUDWindow *hud = Game::getHUD(); + if (!elem) + return ; if (elem->getAttribute("type") != "ground") { contact->SetEnabled(false); contact->enableContact = false; @@ -73,14 +75,14 @@ void Dealer::BeginContact(Elements* elem, b2Contact *contact) { this->PlaySpriteAnimation(this->_getAttr("give", "time").asFloat(), SAT_Loop, this->_getAttr("give", "beginFrame").asInt(), this->_getAttr("give", "endFrame").asInt(), "base"); - hud->setText("HI BUD YOU WANNA SOME DRUGS?", this, Vector3(255, 51, 255), 0, 0); + hud->setText("HI BUD YOU WANNA SOME DRUGS?", this, Vector3(0, 0, 0), 0, 1); return; } if (elem->getAttribute("type") == "Hero" && this->_give == true) { this->PlaySpriteAnimation(this->_getAttr("give", "time").asFloat(), SAT_Loop, this->_getAttr("give", "beginFrame").asInt(), this->_getAttr("give", "endFrame").asInt(), "base"); - hud->setText("Get out. Nothing to see here.", this, Vector3(255, 51, 255), 0, 0); + hud->setText("Get out. Nothing to see here.", this, Vector3(0, 0, 0), 0, 1); return; } } @@ -95,6 +97,8 @@ void Dealer::BeginContact(Elements* elem, b2Contact *contact) { void Dealer::EndContact(Elements *elem, b2Contact *contact) { HUDWindow *hud = Game::getHUD(); + if (!elem) + return ; if (elem->getAttribute("type") == "Hero") { this->AnimCallback("base"); hud->removeText("HI BUD YOU WANNA SOME DRUGS?"); @@ -112,7 +116,7 @@ void Dealer::ReceiveMessage(Message *m) { theSwitchboard.UnsubscribeFrom(this, "giveDrug"); this->AnimCallback("base"); hud->removeText("HI BUD YOU WANNA SOME DRUGS?"); - hud->setText("Here you go buddy. See ya.", this, Vector3(255, 51, 255), 0, 0); + hud->setText("Here you go buddy. See ya.", this, Vector3(0, 0, 0), 0, 1); Drug *drug = new Drug(Game::dList->getDrugRandom()); Game::currentGame->getHero()->setDrug(drug->getDisplayName()); theSwitchboard.SubscribeTo(Game::currentGame->getHero(), "drugPressed"); diff --git a/Sources/src/Elements.cpp b/Sources/src/Elements.cpp @@ -215,6 +215,9 @@ void Elements::AnimCallback(String s) { this->setFrameSprite((*this->_animIt)->frame); } else if (s == "closeCloset") { theWorld.Remove(this); + Game::currentGame->getHero()->removeAttr("closetReady"); + } else if (s == "closetReady") { + Game::currentGame->getHero()->addAttribute("closetReady", "1"); } } diff --git a/Sources/src/Enemy.cpp b/Sources/src/Enemy.cpp @@ -91,6 +91,8 @@ void Enemy::BeginContact(Elements* m, b2Contact *contact) { if (!m) return ; Characters::BeginContact(m, contact); + if (!m) + return ; Weapon* w = static_cast<Weapon*>(m); Projectile* p = static_cast<Projectile*>(m); if (m->getAttribute("type") == "ground") { @@ -112,7 +114,7 @@ void Enemy::BeginContact(Elements* m, b2Contact *contact) { } else { this->GetBody()->SetLinearVelocity(b2Vec2(0, 0)); } - } else if (m->getAttribute("type") == "HeroProjectile") { + } else if (m->getAttribute("type") == "HeroProjectile" || m->getAttribute("spe") == "throwSpear") { if (this->_lastHitID == m->getId()) return; else diff --git a/Sources/src/Game.cpp b/Sources/src/Game.cpp @@ -99,6 +99,7 @@ void Game::start(void) { for (i = 0; i < 3; i++) this->maps->_XYMap[0][i].destroyMap(); delete(Game::currentGame->maps); + Game::isInMenu = 0; this->maps = new Maps("Maps/"); this->maps->readMaps(); Game::currentGame = this; @@ -124,11 +125,14 @@ void Game::start(void) { // Log::info("NbEnemy:" + trouver le nombre d ennemy); // Log::info("NbMaps: " + info sur la sauvegarde (nivau du hero, gold etc...)); -// Game::currentX = levelGenerator->getStartX(); -// Game::currentY = levelGenerator->getStartY(); theCamera.SetPosition(this->maps->getMapXY()[Game::currentY][Game::currentX].getXMid(), this->maps->getMapXY()[Game::currentY][Game::currentX].getYMid() + 1.8, 9.001); this->maps->_XYMap[Game::currentY][Game::currentX] = this->maps->getMapXY()[Game::currentY][Game::currentX].display(); + if (Game::World == 0) { + this->maps->cityMap->setXStart(this->maps->getMapXY()[Game::currentY][Game::currentX].getXStart()); + this->maps->cityMap->setYStart(this->maps->getMapXY()[Game::currentY][Game::currentX].getYStart()); + this->maps->cityMap->display(); + } this->displayHero(*(hero)); hero->init(); @@ -163,6 +167,7 @@ void Game::menuInGame(void) { theWorld.SetBackgroundColor(*(new Color(0, 0, 0))); theWorld.ResumePhysics(); + Game::isInMenu = 1; Game::currentIds = 0; Game::elementMap.clear(); InGameMenu *menu = new InGameMenu(); @@ -191,7 +196,6 @@ void Game::menuInGame(void) { } this->setHero(static_cast<Characters *>(charac)); Game::started = 1; - Game::isInMenu = 1; } Map Game::getCurrentMap(void) { @@ -229,8 +233,13 @@ void Game::showMap(void) { */ void Game::displayHero(Elements & Hero) { //Here starts the game - parse the 1st map coordinates and hero start - Hero.setXStart(this->maps->getMapXY()[Game::currentY][Game::currentX].getXMid()); - Hero.setYStart(this->maps->getMapXY()[Game::currentY][Game::currentX].getYMid()); + if (Game::World) { + Hero.setXStart(this->maps->getMapXY()[Game::currentY][Game::currentX].getXMid()); + Hero.setYStart(this->maps->getMapXY()[Game::currentY][Game::currentX].getYMid()); + } else { + Hero.setXStart(this->maps->getMapXY()[Game::currentY][Game::currentX].getXStart()); + Hero.setYStart(this->maps->getMapXY()[Game::currentY][Game::currentX].getYStart() - 13); + } Hero.addAttribute("hero", "1"); Hero.display(); } @@ -470,6 +479,8 @@ bool Game::destroyAllBodies(std::string msg) { } return true; } else { + for (std::list<b2DistanceJoint *>::iterator it = Game::jointList.begin(); it != Game::jointList.end(); it++) + theWorld.GetPhysicsWorld().DestroyJoint(*it); for (std::list<Elements*>::iterator it = Game::bodiesToDestroy.begin(); it != Game::bodiesToDestroy.end(); it++) { if ((*it)->getAttribute("physic") != "") { if ((*it)->GetBody()) { @@ -481,6 +492,7 @@ bool Game::destroyAllBodies(std::string msg) { Game::delElement(*it); } Game::bodiesToDestroy.clear(); + Game::jointList.clear(); for (std::list<Elements*>::iterator it = Game::bodiesToCreate.begin(); it != Game::bodiesToCreate.end(); it++) { (*it)->InitPhysics(); theWorld.Add((*it)); @@ -608,7 +620,7 @@ void Game::displayHUD(void) { w->gold(hero->getGold()); w->spells(); // Work - //w->setText("Burp.", this->_hero, Vector3(0, 0, 0), 0, 1); + w->setText("Burp.", this->_hero, Vector3(0, 0, 0), 0, 1); /*w->removeText("Burp.");*/ } @@ -650,6 +662,7 @@ std::list<Elements *> Game::runningCharac; std::list<Elements *> Game::bodiesToDestroy; std::list<Elements *> Game::bodiesToCreate; std::list<HUDWindow *> Game::windows; +std::list<b2DistanceJoint *> Game::jointList; ArmorList* Game::aList; WeaponList* Game::wList; RingList* Game::rList; diff --git a/Sources/src/HUDWindow.cpp b/Sources/src/HUDWindow.cpp @@ -30,6 +30,11 @@ * Basic constructor */ HUDWindow::HUDWindow(void) : HUDActor(), _cooldownAtt(0), _cooldownMove(0) { + std::string file; + std::stringstream buffer; + std::ifstream fd; + Json::Reader read; + RegisterFont("Resources/font.ttf", 14, "Gamefont"); RegisterFont("Resources/font.ttf", 20, "BigGamefont"); RegisterFont("Resources/font.ttf", 10, "MediumGamefont"); @@ -39,6 +44,10 @@ HUDWindow::HUDWindow(void) : HUDActor(), _cooldownAtt(0), _cooldownMove(0) { theSwitchboard.SubscribeTo(this, "speAttCooldownEnd"); theSwitchboard.SubscribeTo(this, "speMoveCooldownEnd"); this->_hearts.clear(); + fd.open("Resources/Dialogs/dialogs.json"); + buffer << fd.rdbuf(); + read.parse(buffer.str(), this->_dialogs); + this->_text.clear(); return; } @@ -79,7 +88,7 @@ HUDWindow::Text *HUDWindow::setText(std::string str, int x, int y) { * @param color The color of the text (See Angel2d's Vector3 for more info) * @param alpha The transparency. */ -HUDWindow::Text *HUDWindow::setText(std::string str, int x, int y, Vector3 color, int alpha) { +HUDWindow::Text *HUDWindow::setText(std::string str, int x, int y, Vector3 color, float alpha) { HUDWindow::Text *t = new HUDWindow::Text(); t->str = str; t->x = x; @@ -136,7 +145,10 @@ HUDWindow::Text *HUDWindow::setText(std::string str, Characters *toFollow, HUDWindow::Text *t = new HUDWindow::Text(); t->str = str; - t->toFollow = toFollow; + if (t->toFollow) + t->toFollow = toFollow; + else + t->toFollow = nullptr; t->colorR = color.X; t->colorG = color.Y; t->colorB = color.Z; @@ -148,31 +160,26 @@ HUDWindow::Text *HUDWindow::setText(std::string str, Characters *toFollow, if (isTalk) { Elements *test; test = new Elements(); - test->SetSize(2.5, 0.7); + if (Game::isInMenu) + test->SetSize(str.length() / 2.7, toFollow->GetSize().X / 2); + else + test->SetSize(str.length() / 4, toFollow->GetSize().X / 2); test->SetPosition(toFollow->GetBody()->GetWorldCenter().x, - (toFollow->GetBody()->GetWorldCenter().y + 1)); + (toFollow->GetBody()->GetWorldCenter().y + toFollow->GetSize().Y)); test->SetSprite("Resources/Images/HUD/talk.png"); test->SetDrawShape(ADS_Square); - /* test->SetFixedRotation(true); - test->SetLayer(1500); - test->SetDensity(0.001f); - test->SetRestitution(0); - test->SetFriction(0); - test->SetIsSensor(true);*/ - test->InitPhysics(); - b2DistanceJointDef jointDef1; - b2DistanceJointDef jointDef2; - jointDef1.Initialize(toFollow->GetBody(), test->GetBody(), - b2Vec2(toFollow->GetBody()->GetWorldCenter().x + 0.4f, - toFollow->GetBody()->GetWorldCenter().y + 0.4f), test->GetBody()->GetWorldCenter()); - jointDef1.collideConnected = false; - jointDef2.Initialize(toFollow->GetBody(), test->GetBody(), - b2Vec2(toFollow->GetBody()->GetWorldCenter().x - 0.4f, test->GetBody()->GetWorldCenter().y - 0.4f), test->GetBody()->GetWorldCenter()); - jointDef2.collideConnected = false; - b2DistanceJoint *joint1 = (b2DistanceJoint*)theWorld.GetPhysicsWorld().CreateJoint(&jointDef1); - b2DistanceJoint *joint2 = (b2DistanceJoint*)theWorld.GetPhysicsWorld().CreateJoint(&jointDef2); - theWorld.Add(test); + test->SetFixedRotation(true); + test->SetLayer(1500); + test->SetDensity(0.001f); + test->SetRestitution(0); + test->SetFriction(0); + test->SetIsSensor(true); + test->addAttribute("isPhysic", "1"); + t->joint1 = t->joint2 = nullptr; + Game::bodiesToCreate.push_back(test); + t->toFollow = toFollow; this->_dialog[t->str] = test; + theSwitchboard.DeferredBroadcast(new Message("remove" + t->str), 4); } this->_text.push_back(t); return t; @@ -197,7 +204,19 @@ void HUDWindow::removeText(std::string str, int last) { } if (i != this->_text.end()) { if (this->_dialog[str]) { - Game::addToDestroyList(this->_dialog[str]); + if (theWorld.GetPhysicsWorld().IsLocked() == false) { + theWorld.GetPhysicsWorld().DestroyJoint((*i)->joint1); + theWorld.GetPhysicsWorld().DestroyJoint((*i)->joint2); + this->_dialog[str]->GetBody()->SetActive(false); + theWorld.GetPhysicsWorld().DestroyBody(this->_dialog[str]->GetBody()); + theWorld.Remove(this->_dialog[str]); + this->_dialog[str]->ChangeColorTo(Color(0, 0, 0, 0), 0); + } else { + this->_dialog[str]->ChangeColorTo(Color(0, 0, 0, 0), 0); + Game::jointList.push_back((*i)->joint1); + Game::jointList.push_back((*i)->joint2); + Game::addToDestroyList(this->_dialog[str]); + } this->_dialog.erase(this->_dialog.find(str)); } this->_text.erase(i); @@ -243,32 +262,53 @@ void HUDWindow::displayText(void) { std::list<HUDWindow::Text *>::iterator i; for (i = this->_text.begin(); i != this->_text.end(); i++) { - if (*i) { - glColor4f((*i)->colorR, (*i)->colorG, (*i)->colorB, (*i)->colorA); - if ((*i)->toFollow == nullptr && (*i)->isFading == 1) - (*i)->colorA -= 0.02f; - if ((*i)->toFollow == nullptr) - DrawGameText((*i)->str, (*i)->font, (*i)->x, (*i)->y, theCamera.GetRotation()); - else { - int x, y, mult = 6; - Map m = Game::currentGame->getCurrentMap(); - - if ((*i)->toFollow->GetBody()) { - x = ((((*i)->toFollow->GetBody()->GetWorldCenter().x + 0.5) - m.getXStart()) * 40) - 40; - y = -((((*i)->toFollow->GetBody()->GetWorldCenter().y + (((*i)->toFollow->GetSize().Y) / 4)) - m.getYStart()) * 40) + 50; - if ((*i)->isFading) { - DrawGameText((*i)->str, (*i)->font, x, y - (*i)->y, theCamera.GetRotation()); - (*i)->y += 1; - (*i)->colorA -= 0.02f; - } else if ((*i)->isTalk) { - DrawGameText((*i)->str, (*i)->font, x - 5, y - (*i)->y + 5, theCamera.GetRotation()); - } else { - DrawGameText((*i)->str, (*i)->font, x, y - (*i)->y, theCamera.GetRotation()); + glColor4f((*i)->colorR, (*i)->colorG, (*i)->colorB, (*i)->colorA); + if ((*i)->isFading) + (*i)->colorA -= 0.02f; + if ((*i)->colorA < 0) { + this->removeText((*i)->str); return ; + } + if ((*i)->toFollow == nullptr) + DrawGameText((*i)->str, (*i)->font, (*i)->x, (*i)->y, theCamera.GetRotation()); + else { + int x, y, mult = 6; + Map m = Game::currentGame->getCurrentMap(); + + if ((*i)->toFollow->GetBody()) { + if ((*i)->colorA < 0) { + this->removeText((*i)->str); return ; + } + Vector2 v, pos = (*i)->toFollow->GetPosition(); + pos.Y += (*i)->toFollow->GetSize().Y; + v = MathUtil::WorldToScreen(pos); + x = v.X - (*i)->str.length() * 2.5; + y = v.Y; + if ((*i)->isFading) { + DrawGameText((*i)->str, (*i)->font, x, y - (*i)->y, theCamera.GetRotation()); + (*i)->y += 1; + } else if ((*i)->isTalk) { + if ((*i)->joint1 == nullptr && (*i)->joint2 == nullptr) { + theSwitchboard.SubscribeTo(this, "remove" + (*i)->str); + Elements *test = this->_dialog[(*i)->str]; + b2DistanceJointDef jointDef1; + b2DistanceJointDef jointDef2; + jointDef1.Initialize((*i)->toFollow->GetBody(), test->GetBody(), + b2Vec2((*i)->toFollow->GetBody()->GetWorldCenter().x + 0.4f, + (*i)->toFollow->GetBody()->GetWorldCenter().y + 0.4f), test->GetBody()->GetWorldCenter()); + jointDef1.collideConnected = false; + jointDef2.Initialize((*i)->toFollow->GetBody(), test->GetBody(), + b2Vec2((*i)->toFollow->GetBody()->GetWorldCenter().x - 0.4f, test->GetBody()->GetWorldCenter().y - 0.4f), test->GetBody()->GetWorldCenter()); + jointDef2.collideConnected = false; + b2DistanceJoint *joint1 = (b2DistanceJoint*)theWorld.GetPhysicsWorld().CreateJoint(&jointDef1); + b2DistanceJoint *joint2 = (b2DistanceJoint*)theWorld.GetPhysicsWorld().CreateJoint(&jointDef2); + (*i)->joint1 = joint1; + (*i)->joint2 = joint2; } + DrawGameText((*i)->str, (*i)->font, x - 5, y - (*i)->y + 5, theCamera.GetRotation()); + } else { + DrawGameText((*i)->str, (*i)->font, x, y - (*i)->y, theCamera.GetRotation()); } - } - if ((*i)->colorA < 0) - this->removeText((*i)->str); + } } } } @@ -783,7 +823,8 @@ void HUDWindow::spells(void) { this->setText("T", (theCamera.GetWindowWidth() / 20) * 7.28, theCamera.GetWindowHeight() / 20 * 1.5, Vector3(0.2, 0.12, 0), 1, "MediumGamefont"); this->addImage("Resources/HUD/spell_bg.png", (theCamera.GetWindowWidth() / 20) * 7 + 3, theCamera.GetWindowHeight() / 20 * 2.1, Vector2(theCamera.GetWindowWidth() / 25), 15); - this->addImage("Resources/Images/Skills/" + Game::currentGame->getHero()->getSpeAtt() + ".png", (theCamera.GetWindowWidth() / 20) * 7 + 1, theCamera.GetWindowHeight() / 20 * 1.9, + if (Game::currentGame->getHero()->getSpeAtt() != "") + this->addImage("Resources/Images/Skills/" + Game::currentGame->getHero()->getSpeAtt() + ".png", (theCamera.GetWindowWidth() / 20) * 7 + 1, theCamera.GetWindowHeight() / 20 * 1.9, Vector2(theCamera.GetWindowWidth() / 35), 15); this->setText("Y", (theCamera.GetWindowWidth() / 20) * 7.28, theCamera.GetWindowHeight() / 20 * 2.57, Vector3(0.2, 0.12, 0), 1, "MediumGamefont"); } @@ -863,9 +904,76 @@ void HUDWindow::ReceiveMessage(Message *m) { theSwitchboard.UnsubscribeFrom(this, "second"); } } + } else if (m->GetMessageName() == "enterPressed") { + if (this->_isInDialog) { + this->dialog(this->_currentDialog); + } + } else if (m->GetMessageName().substr(0, 6) == "remove") { + std::string message = m->GetMessageName().substr(6, m->GetMessageName().length() - 6); + this->removeText(message); } } +void HUDWindow::dialog(std::string name) { + static int isCreated = 0; + if (isCreated == 0) { + if (std::find(this->_dialogPassed.begin(), this->_dialogPassed.end(), name) != this->_dialogPassed.end()) + return ; + this->_createDialog(); + isCreated = 1; + this->_isInDialog = 1; + this->_currentDialog = name; + theSwitchboard.SubscribeTo(this, "enterPressed"); + this->_it = this->_dialogs[name].begin(); + this->_dialogPassed.push_back(name); + } else { + this->removeText(this->_it->asString()); + this->_it++; + } + if (this->_it == this->_dialogs[name].end()) { + isCreated = 0; + this->_cleanDialog(); + theSwitchboard.UnsubscribeFrom(this, "enterPressed"); + if (name == "drink") + theSwitchboard.DeferredBroadcast(new Message("startIntro"), 1); + } else { + this->setText(this->_it->asString(), 400, theCamera.GetWindowHeight() - 100, Vector3(0, 0, 0), 1, "BigGamefont"); + } +} + +void HUDWindow::_createDialog(void) { + Game::currentGame->getHero()->unsubscribeFromAll(); + HUDActor *fade = new HUDActor(), *charac = new HUDActor(), *dialog = new HUDActor(); + fade->SetSize(theCamera.GetWindowWidth(), theCamera.GetWindowHeight()); + fade->SetPosition(theCamera.GetWindowWidth() / 2, theCamera.GetWindowHeight() / 2); + fade->SetColor(0, 0, 0, 0.3); + fade->SetLayer(200); + theWorld.Add(fade); + this->_fade = fade; + charac->SetSize(400); + charac->SetPosition(200, theCamera.GetWindowHeight() - 200); + charac->LoadSpriteFrames(Game::currentGame->getHero()->getAttribute("spritesFrame")); + charac->SetLayer(202); + charac->PlaySpriteAnimation(0.3, SAT_Loop, Game::currentGame->getHero()->_getAttr("breath", "beginFrame_right").asInt(), Game::currentGame->getHero()->_getAttr("breath", "endFrame_right").asInt()); + theWorld.Add(charac); + this->_perso = charac; + dialog->SetSize(theCamera.GetWindowWidth() * 1.5, 200); + dialog->SetPosition(100, theCamera.GetWindowHeight() - 100); + dialog->SetSprite("Resources/Images/big_dialog.png"); + dialog->SetLayer(201); + theWorld.Add(dialog); + this->_backDialog = dialog; + this->setText("Press <Enter>", theCamera.GetWindowWidth() / 2 + 50, theCamera.GetWindowHeight() - 20, Vector3(0, 0, 0), 0.3f); +} + +void HUDWindow::_cleanDialog(void) { + Game::currentGame->getHero()->subscribeToAll(); + theWorld.Remove(this->_fade); + theWorld.Remove(this->_perso); + theWorld.Remove(this->_backDialog); + this->removeText("Press <Enter>"); +} + void HUDWindow::setGame(Game *g) { this->_g = g; }; void HUDWindow::setMaxHP(int h) { this->_maxHP = h; }; HUDActor *HUDWindow::getAttCooldown(void) { return this->_attackCooldown; }; diff --git a/Sources/src/Hero.cpp b/Sources/src/Hero.cpp @@ -196,11 +196,11 @@ void Hero::BeginContact(Elements* elem, b2Contact *contact) { if (this->_isStomping == true) { this->GetBody()->SetLinearVelocity(b2Vec2(0, 3)); theSwitchboard.Broadcast(new Message("stompEnd")); - new Weapon(this->_weapon, this, 1); - new Weapon(this->_weapon, this, -1); + new Weapon(this->_weapon, this, 1, "stompArea"); + new Weapon(this->_weapon, this, -1, "stompArea"); } } - } else if (elem->getAttribute("type") == "projectile") { + } else if (elem->getAttribute("type") == "projectile" && elem->getAttribute("spe") != "throwSpear") { this->_takeDamage(elem); } else if (elem->getAttribute("type") == "Object") { @@ -235,8 +235,6 @@ void Hero::BeginContact(Elements* elem, b2Contact *contact) { if (this->_isStomping == true) { theSwitchboard.Broadcast(new Message("stompEnd")); this->_invincibility = false; - new Weapon(this->_weapon, this, 1); - new Weapon(this->_weapon, this, 1); } if (this->_invincibility == false) this->_takeDamage(elem); diff --git a/Sources/src/Maps.cpp b/Sources/src/Maps.cpp @@ -35,7 +35,7 @@ Maps::Maps(void) { * Constructor with a map directory * @param directory The path of the directory */ -Maps::Maps(std::string directory) : _directory(directory) { +Maps::Maps(std::string directory) : _directory(directory), _startMapIsSet(0) { return ; } @@ -146,6 +146,11 @@ void Maps::_getMap(void) { this->secretMap->setXStart(0); this->secretMap->setYStart(30); } + if (this->_root["properties"].get("startMap", 0).isConvertibleTo(Json::ValueType::stringValue) && this->_root["properties"].get("startMap", 0).asString() == "true") { + this->startMap = map; + } else if (this->_root["properties"].get("special", 0).isConvertibleTo(Json::ValueType::stringValue) && this->_root["properties"].get("special", 0).asString() == "city") { + this->cityMap = map; + } this->_maps[atoi(this->_root["properties"].get("number", 0).asString().c_str())] = map; int n = 0; for (j = this->_root["properties"].begin(); j != this->_root["properties"].end(); j++) { @@ -174,21 +179,23 @@ int Maps::tagCurrentMap(int nb) { if (nb < 12) return -1; int x = 0, y = 0, i = 0; - //tag starting room + ////tag starting room int rdm1 = (rand() % nb); - for (; i <= rdm1; x++) { - if (this->_XYMap[y][x].getName() != "") { - if (i == rdm1) { - Game::currentX = x; - Game::currentY = y; - this->_XYMap[y][x].setSpecial("starter"); - break ; + if (!this->_startMapIsSet) { + for (; i <= rdm1; x++) { + if (this->_XYMap[y][x].getName() != "") { + if (i == rdm1) { + Game::currentX = x; + Game::currentY = y; + this->_XYMap[y][x].setSpecial("starter"); + break ; + } + i++; + } + if (x == 15) { + x = 0; + y++; } - i++; - } - if (x == 15) { - x = 0; - y++; } } //tag boss room @@ -245,7 +252,7 @@ int Maps::tagCurrentMap(int nb) { y++; } } - return 0; + return 0; } //! Display an entire level @@ -271,7 +278,13 @@ int Maps::displayLevel(std::vector<std::vector<int> > map) { } i = map[y][x]; if (i != 0) { - tmp = this->getMapByDoor(i); + if (i == 2 && !this->_startMapIsSet && Game::World == 0 && Game::isInMenu == 0) { + tmp = this->startMap; + Game::currentX = x; + Game::currentY = y; + this->_startMapIsSet = 1; + } else + tmp = this->getMapByDoor(i); tmp->setXStart(rX); tmp->setYStart(rY); this->_XYMap[y][x] = *tmp; diff --git a/Sources/src/Menu.cpp b/Sources/src/Menu.cpp @@ -26,7 +26,7 @@ # include "Menu.hpp" //! Basic constructor -Menu::Menu(void) : _currentChoice("Start Game"), _fadeActor(nullptr) { +Menu::Menu(void) : _currentChoice("Start Game"), _fadeActor(nullptr), _beer(nullptr), _logo(nullptr) { theSwitchboard.SubscribeTo(this, "enterPressed"); theSwitchboard.SubscribeTo(this, "downPressed"); theSwitchboard.SubscribeTo(this, "upPressed"); @@ -37,6 +37,7 @@ Menu::Menu(void) : _currentChoice("Start Game"), _fadeActor(nullptr) { theSwitchboard.SubscribeTo(this, "moveMenu"); theSwitchboard.SubscribeTo(this, "PauseGame"); theSwitchboard.SubscribeTo(this, "bossEnd"); + theSwitchboard.SubscribeTo(this, "startIntro"); } //! Basic destructor @@ -84,6 +85,8 @@ void Menu::ReceiveMessage(Message *m) { if (m->GetMessageName() == "PauseGame") Game::currentGame->endingGame(); + if (m->GetMessageName() == "startIntro") + this->introGame(); if (m->GetMessageName() == "enterPressed" && Game::deadWaiting) { if (!Game::lvlDone) { Game::currentGame->menuInGame(); @@ -97,6 +100,10 @@ void Menu::ReceiveMessage(Message *m) { Game::started = 1; } } + if (m->GetMessageName() == "beerUp") + this->_beer->MoveTo(Vector2((theCamera.GetWindowWidth() / 2) - 100, (theCamera.GetWindowHeight() / 2) - 250), 2, true, "beerDown"); + if (m->GetMessageName() == "beerDown") + this->_beer->MoveTo(Vector2((theCamera.GetWindowWidth() / 2) - 100, (theCamera.GetWindowHeight() / 2) - 200), 2, true, "beerUp"); if (Game::toggleMenu == false) return; if (m->GetMessageName() == "moveMenu") @@ -111,6 +118,10 @@ void Menu::ReceiveMessage(Message *m) { if (this->_currentChoice == "Start Game") { Game::isInMenu = 0; Game::removeHUDWindow(this->_window); + theWorld.Remove(this->_logo); + theWorld.Remove(this->_beer); + theSwitchboard.UnsubscribeFrom(this, "beerUp"); + theSwitchboard.UnsubscribeFrom(this, "beerDown"); this->_game->menuInGame(); this->_window = Game::getHUD(); this->_inMenu = 0; @@ -363,7 +374,8 @@ void Menu::listMenu(void) { this->_inMenu = 1; for (it = this->_menuChoices.begin(); it != this->_menuChoices.end(); it++) this->_window->removeText(*it); - this->_window->removeText("Grog Knight"); + if (this->_logo != nullptr) + theWorld.Remove(this->_logo); for (it = this->_menuChoices.begin(); it != this->_menuChoices.end(); it++, y += 20) { if (this->_currentChoice == *it) { this->_window->setText(*it, x - ((*it).length() / 2 * 6), y, Vector3(255, 0, 0), 1); @@ -371,8 +383,13 @@ void Menu::listMenu(void) { this->_window->setText(*it, x - ((*it).length() / 2 * 6), y, Vector3(255, 255, 255), 1); } } - this->_window->setText("Grog Knight", (theCamera.GetWindowWidth() / 2) - 200, (theCamera.GetWindowHeight() / 2) - 100, - Vector3(255.0f, 255.0f, 255.0f), 1, "title"); + this->_logo = this->_window->addImage("Resources/Images/logo.png", (theCamera.GetWindowWidth() / 2), (theCamera.GetWindowHeight() / 2) - 200, 400); + if (this->_beer == nullptr) { + this->_beer = this->_window->addImage("Resources/Images/beer.png", (theCamera.GetWindowWidth() / 2) - 100, (theCamera.GetWindowHeight() / 2) - 250, 100, 105); + this->_beer->MoveTo(Vector2((theCamera.GetWindowWidth() / 2) - 100, (theCamera.GetWindowHeight() / 2) - 200), 2, true, "beerUp"); + theSwitchboard.SubscribeTo(this, "beerUp"); + theSwitchboard.SubscribeTo(this, "beerDown"); + } } void Menu::removeBaseMenu(void) { @@ -380,7 +397,12 @@ void Menu::removeBaseMenu(void) { for (it = this->_menuChoices.begin(); it != this->_menuChoices.end(); it++) this->_window->removeText(*it); - this->_window->removeText("Grog Knight"); + theWorld.Remove(this->_logo); + std::cout << "here" << std::endl; + theWorld.Remove(this->_beer); + this->_beer = nullptr; + theSwitchboard.UnsubscribeFrom(this, "beerUp"); + theSwitchboard.UnsubscribeFrom(this, "beerDown"); } void Menu::settings(int y) { @@ -660,4 +682,25 @@ int Menu::_isUpper(std::string s) { return 0; } +void Menu::introGame(void) { + static float phase = 1; + static bool show = false; + + if (phase > 0) { + Game::currentGame->maps->cityMap->destroyMap(); + if (!show) + Game::currentGame->maps->cityMap->destroyMap(); + else + Game::currentGame->maps->cityMap->display(); + show = (show ? false : true); + theSwitchboard.DeferredBroadcast(new Message("startIntro"), phase); + phase -= 0.1; + } else { + Game::currentGame->maps->cityMap->destroyMap(); + theSwitchboard.UnsubscribeFrom(this, "startIntro"); + Game::getHUD()->dialog("start"); + show = false; + } +} + std::map<std::string, std::list<t_bind *> > Menu::getBindings(void) { return this->_bindingMenu; }; diff --git a/Sources/src/MenuCharacter.cpp b/Sources/src/MenuCharacter.cpp @@ -29,18 +29,20 @@ MenuCharacter::MenuCharacter(void) : Characters("MenuCharacter") { this->addAttribute("type", "Hero"); this->addAttribute("physic", "1"); this->addAttribute("hero", "1"); + this->addAttribute("name", "menuCharacter"); this->_currentTrigger = ""; this->_target = this->_target2 = nullptr; this->_currentItemInfo = nullptr; + this->_image = nullptr; this->_isBlock = 0; this->_chooseEquipment = 0; - this->_character = "Archer"; + this->_character = "Warrior"; this->_characLvl = Quit::level; this->_descriptionBackground = this->_iconBackground = this->_icon = nullptr; this->_levelsBackground = this->_lvlUp = nullptr; // THIS IS TMP; DO NOT JUDGE ME Elements *tmp; - tmp = new Elements(); tmp->addAttribute("Name", "Bow_000"); this->_equipSelection["Weapon"] = tmp; + tmp = new Elements(); tmp->addAttribute("Name", "Spear_000"); this->_equipSelection["Weapon"] = tmp; tmp = new Elements(); tmp->addAttribute("Name", "Ring_000"); this->_equipSelection["ring"] = tmp; tmp = new Elements(); tmp->addAttribute("Name", "Armor_000"); this->_equipSelection["Armor"] = tmp; // END OF NASTY CODE. Well, actually no. But u know what i mean @@ -52,7 +54,7 @@ MenuCharacter::MenuCharacter(void) : Characters("MenuCharacter") { this->_finalSkillTargets = std::vector<Elements *>(4); this->_skillsChoices = std::vector<std::list<Elements *> >(4); this->_skillsLvl[0] = 5; this->_skillsLvl[1] = 15; this->_skillsLvl[2] = 25; this->_skillsLvl[3] = 50; - this->_finalSkillChoices[0] = "blink"; this->_finalSkillChoices[1] = "rapidFire"; + this->_finalSkillChoices[0] = "charge"; //this->_finalSkillChoices[1] = "whirlwind"; this->_getSkills(); this->_kitchen(); } @@ -77,6 +79,8 @@ void MenuCharacter::BeginContact(Elements *elem, b2Contact *contact) { this->_callTrigger(elem->getAttribute("trigger"), 0); else this->_callTrigger(elem->getAttribute("trigger"), 1); + } if (elem->getAttribute("dialog") != "") { + Game::getHUD()->dialog(elem->getAttribute("dialog")); } if (elem->getAttribute("triggerOn") != "") { this->trigger(elem->getAttribute("triggerOn"), 1); } if (elem->getAttribute("triggerOff") != "") { @@ -95,7 +99,7 @@ void MenuCharacter::trigger(std::string name, int status) { else this->_currentTrigger = ""; if (name == "chooseCharacter") { - if (status == 1) { + if (status == 1) { this->_showTextInfo("Press enter to choose a new character"); } else { Game::getHUD()->removeText("Press enter to choose a new character"); @@ -113,14 +117,18 @@ void MenuCharacter::trigger(std::string name, int status) { this->_closeCloset(); } } else if (name == "startGame") { - this->unsubscribeFromAll(); - theSwitchboard.UnsubscribeFrom(this, "enterPressed"); - theSwitchboard.UnsubscribeFrom(this, "chooseEquipment"); - theSwitchboard.UnsubscribeFrom(this, "returnPressed"); - - Game::isInMenu = 0; - Game::menuCharacter = this; - Game::asToStart = 1; + if (this->canStart()) { + this->unsubscribeFromAll(); + theSwitchboard.UnsubscribeFrom(this, "enterPressed"); + theSwitchboard.UnsubscribeFrom(this, "chooseEquipment"); + theSwitchboard.UnsubscribeFrom(this, "returnPressed"); + if (this->_image != nullptr) + theWorld.Remove(this->_image); + Game::getHUD()->removeText("Press enter to choose your skills"); + Game::isInMenu = 0; + Game::menuCharacter = this; + Game::asToStart = 1; + } } else if (name == "skills") { if (status == 1) this->_showTextInfo("Press enter to choose your skills"); @@ -140,11 +148,12 @@ void MenuCharacter::ReceiveMessage(Message *m) { if (this->_isBlock) { this->ClearSpriteInfo(); this->LoadSpriteFrames("Resources/Images/Menu/"+ this->_choicePointer->getAttribute("type") +"/perso_000.png"); + this->addAttribute("spritesFrame", "Resources/Images/Menu/"+ this->_choicePointer->getAttribute("type") +"/perso_000.png"); if (this->_character != this->_choicePointer->getAttribute("type")) { this->_character = this->_choicePointer->getAttribute("type"); this->_hideKitchen(1); this->_kitchen(); - Game::getHUD()->removeText("Press enter to choose your skills"); + Game::getHUD()->removeText(this->_textInfo); } theCamera.MoveTo(Vector3(Game::currentGame->getCurrentMap().getXMid(), Game::currentGame->getCurrentMap().getYMid() + 1.8, 18.002), 1, true); @@ -178,23 +187,28 @@ void MenuCharacter::ReceiveMessage(Message *m) { this->_choices.push_back(elem); theCamera.MoveTo(Vector3(34, -23, 5), 1, true); this->_makeItChoice(); + this->_forward(0); this->_backward(0); this->_isBlock = 1; } } else if (this->_currentTrigger == "equipment" && this->_chooseEquipment == 0) { - theCamera.MoveTo(Vector3(78.5, -19.5, 12.5), 0.5, true, "chooseEquipment"); - Game::getHUD()->removeText("Press enter to choose your equipment"); - theWorld.Remove(this->_image); - this->_isBlock = 1; - this->_chooseEquipment = 1; - this->_image = nullptr; + if (this->getAttribute("closetReady") != "") { + theCamera.MoveTo(Vector3(78.5, -19.5, 12.5), 0.5, true, "chooseEquipment"); + Game::getHUD()->removeText(this->_textInfo); + theWorld.Remove(this->_image); + this->_forward(0); this->_backward(0); + this->_isBlock = 1; + this->_chooseEquipment = 1; + this->_image = nullptr; + } } else if (this->_currentTrigger == "equipment" && this->_chooseEquipment == 1) { this->_updateSelection(); } else if (this->_currentTrigger == "skills") { theCamera.MoveTo(Vector3(131, -19.5, 12.5), 0.5, true, "chooseSkills"); - Game::getHUD()->removeText("Press enter to choose your skills"); + Game::getHUD()->removeText(this->_textInfo); theWorld.Remove(this->_image); this->_image = nullptr; this->_currentTrigger = "skillsChoices"; + this->_forward(0); this->_backward(0); this->_isBlock = 1; this->_choicePointer = *(this->_skillsChoices[0].begin()); this->_makeSkillChoice(); @@ -270,6 +284,8 @@ void MenuCharacter::_forward(int status) { } } else { if (status == 1) { + if (this->_choicePointer == nullptr) + return ; if (this->_currentTrigger == "skillsChoices") { int current = atoi(this->_choicePointer->getAttribute("palier").c_str()); @@ -279,7 +295,8 @@ void MenuCharacter::_forward(int status) { int distance = std::distance(lst.begin(), it); it = this->_skillsChoices[current + 1].begin(); - std::advance(it, distance); + if (this->_skillsChoices[current + 1].size() > 1) + std::advance(it, distance); this->_choicePointer = *(it); this->_makeSkillChoice(); } @@ -321,6 +338,8 @@ void MenuCharacter::_backward(int status) { } } else { if (status == 1) { + if (this->_choicePointer == nullptr) + return ; if (this->_currentTrigger == "skillsChoices") { int current = atoi(this->_choicePointer->getAttribute("palier").c_str()); @@ -354,6 +373,8 @@ void MenuCharacter::_up(int status) { this->_closetBackChoiceUpdate(); } } else if (status == 1 && this->_currentTrigger == "skillsChoices") { + if (this->_choicePointer == nullptr) + return ; std::list<Elements *> lst = this->_skillsChoices[atoi(this->_choicePointer->getAttribute("palier").c_str())]; std::list<Elements *>::iterator it = std::find(lst.begin(), lst.end(), this->_choicePointer); @@ -372,6 +393,8 @@ void MenuCharacter::_down(int status) { this->_closetBackChoiceUpdate(); } } else if (status == 1 && this->_currentTrigger == "skillsChoices") { + if (this->_choicePointer == nullptr) + return ; std::list<Elements *> lst = this->_skillsChoices[atoi(this->_choicePointer->getAttribute("palier").c_str())]; std::list<Elements *>::iterator it = std::find(lst.begin(), lst.end(), this->_choicePointer); @@ -386,8 +409,12 @@ void MenuCharacter::_down(int status) { void MenuCharacter::_showTextInfo(std::string text, std::string switchboard) { int x = theCamera.GetWindowWidth(), y = theCamera.GetWindowHeight(); + if (this->_image) + theWorld.Remove(this->_image); + Game::getHUD()->removeText(this->_textInfo); this->_image = Game::getHUD()->addImage("Resources/Images/HUD/talk.png", x / 2, y - (y / 15), Vector2(x / 3, y / 10), 100); Game::getHUD()->setText(text, (x / 2) - (x / 6) + (x / 20), y - (y / 15), Vector3(0, 0, 1), 1); + this->_textInfo = text; } void MenuCharacter::_makeItChoice(void) { @@ -413,9 +440,9 @@ void MenuCharacter::_openCloset(void) { elem->SetPosition(79, -19.5); theWorld.Add(elem); if (this->_character == "Archer") - elem->PlaySpriteAnimation(0.3, SAT_OneShot, 1, 4); + elem->PlaySpriteAnimation(0.3, SAT_OneShot, 1, 4, "closetReady"); else if (this->_character == "Warrior") - elem->PlaySpriteAnimation(0.3, SAT_OneShot, 5, 8); + elem->PlaySpriteAnimation(0.3, SAT_OneShot, 5, 8, "closetReady"); this->_closet = elem; } @@ -724,7 +751,6 @@ void MenuCharacter::_kitchen(void) { float x, y, i; Elements *tmp; - std::cout << this->_character << std::endl; for (it = this->_skillTree.begin(), x = 125.75, i = 0; it != this->_skillTree.end(); it++, x += 3.75, i++) { for (it2 = (*it)[this->_character].begin(), y = -16.75; it2 != (*it)[this->_character].end(); it2++, y -= 3.5) { tmp = new Elements(); @@ -740,6 +766,8 @@ void MenuCharacter::_kitchen(void) { theWorld.Add(tmp); this->_kitchenSkills.push_back(tmp); } else { this->_skillsChoices[i].push_back(tmp); + if (i == 0 && this->_currentTrigger == "skillsChoices") + this->_choicePointer = *(this->_skillsChoices[0].begin()); } } } @@ -797,6 +825,17 @@ void MenuCharacter::_levels(void) { Game::getHUD()->removeText(std::to_string(Quit::gold)); Quit::gold -= this->_characLvl * 4; this->_characLvl++; + this->_hideKitchen(1); + this->_kitchen(); + this->_makeSkillChoice(); + Elements *tmp = new Elements(); + + tmp->SetPosition(144.3, -19.5); tmp->SetSprite("Resources/Images/kitchen_levels_background.png"); + tmp->SetSize(8, 10); theWorld.Add(tmp); this->_levelsBackground = tmp; + tmp = new Elements(); + tmp->SetPosition(144.35, -18.6); tmp->SetSprite("Resources/Images/level_up.png"); + tmp->SetSize(3); theWorld.Add(tmp); this->_lvlUp = tmp; + } Game::getHUD()->setText(std::to_string(this->_characLvl), 866 - std::to_string(this->_characLvl).size() * 3, 365, Vector3(0, 0, 0), 1, "BigGamefont"); @@ -883,6 +922,19 @@ void MenuCharacter::_getSkills(void) { reader.parse(treeFile, this->_skillTree, false); } +bool MenuCharacter::canStart(void) { + int max; + for (max = 0; this->_skillsChoices[max].size() > 0; max++); + if (this->_equipSelection["Weapon"] && this->_equipSelection["ring"] && this->_equipSelection["Armor"] && + this->_finalSkillChoices.size() !=max) + return true; + if (!this->_equipSelection["Weapon"] || !this->_equipSelection["ring"] || this->_equipSelection["Armor"]) + Game::getHUD()->setText("I cannot go yet, i miss some equipments !", this, Vector3(0, 0, 0), 0, 1); + else + Game::getHUD()->setText("I cannot go yet, i miss some spells !", this, Vector3(0, 0, 0), 0, 1); + return false; +} + std::string MenuCharacter::getHeroType(void) { return this->_character; }; Weapon *MenuCharacter::getWeapon(void) { return new Weapon(this->_equipSelection["Weapon"]->getAttribute("Name")); }; Ring *MenuCharacter::getRing(void) { return new Ring(this->_equipSelection["ring"]->getAttribute("Name")); }; diff --git a/Sources/src/Projectile.cpp b/Sources/src/Projectile.cpp @@ -97,34 +97,39 @@ Projectile::Projectile(Weapon* w, int dmg) { theWorld.Add(this); } -Projectile::Projectile(std::string img, int dmg, Vector2 pos, Vector2 force, Vector2 init, std::string name, int rotat) : Elements() { +Projectile::Projectile(std::string img, int dmg, Vector2 pos, Vector2 force, Vector2 init, std::string name, int rotat, float isGravity) : Elements() { this->_name = name; this->SetName(name); this->_toDestroy = false; this->addAttribute("damage", std::to_string(dmg)); - this->SetSize(0.5f); + if (isGravity != 0) { + this->SetSize(1.0f); + this->SetDensity(0.2f); + this->SetRotation(220); + } else { + this->SetSize(0.5f); + this->SetDensity(1); + } this->SetShapeType(PhysicsActor::SHAPETYPE_CIRCLE); - this->SetDensity(1); this->SetSprite(img); this->SetFriction(0); this->SetRestitution(0); this->SetIsSensor(true); this->SetFixedRotation(true); this->addAttribute("type", "projectile"); - this->addAttribute("spe", "bossProjectile"); + this->addAttribute("spe", name); this->Tag("projectile"); this->SetPosition(pos.X, pos.Y); + if (rotat != -1) + this->SetRotation(rotat); this->InitPhysics(); - if (rotat != -1) { - this->GetBody()->SetTransform(b2Vec2(pos.X, pos.Y), rotat); - } this->SetLayer(99); - this->GetBody()->SetGravityScale(0); + this->GetBody()->SetGravityScale(isGravity); this->GetBody()->SetBullet(true); - if (rotat != -1) { - this->ApplyLocalForce(Vector2(75, 0), Vector2(0, 0)); + if (name != "throwSpear" && rotat != -1) { + this->ApplyLocalForce(Vector2(75, 0), Vector2(0, 0)); } else { - this->ApplyLinearImpulse(Vector2(force.X, force.Y), Vector2(init.X, init.Y)); + this->ApplyLinearImpulse(Vector2(force.X, force.Y), Vector2(init.X, init.Y)); } theWorld.Add(this); } @@ -208,6 +213,10 @@ void Projectile::BeginContact(Elements *m, b2Contact *c) { c->SetEnabled(false); c->enableContact = false; return ; + } else if (this->_name == "throwSpear" && m->getAttribute("type") == "Hero") { + c->SetEnabled(false); + c->enableContact = false; + return ; } else { //here we put the arrow travelling through enemies (instead of 1!=1) if (m->getAttribute("type") != "ground" && ((m->getAttribute("type") != "Enemy" || (m->getAttribute("type") == "Enemy" && static_cast<Enemy*>(m)->dead() == true)) || 1 != 1)) { diff --git a/Sources/src/Quit.cpp b/Sources/src/Quit.cpp @@ -112,8 +112,8 @@ void Quit::doSave(Hero *h) { } jsonFile.open(".save", std::ofstream::trunc); - //root["level"] = h->getLevel(); - root["level"] = 15; + root["level"] = h->getLevel(); + //root["level"] = 15; root["key"] = KEY; if (Game::chest != nullptr) { diff --git a/Sources/src/Shopkeeper.cpp b/Sources/src/Shopkeeper.cpp @@ -66,7 +66,7 @@ void Shopkeeper::spawn(void) { this->_shop->revealShop(Game::currentGame->getCurrentMap().getXMid() - 1, Game::currentGame->getCurrentMap().getYMid() + 3); this->_currentPhrase = "Greetings, traveler."; theSwitchboard.DeferredBroadcast(new Message("removeShopkeeperText"), 3); - Game::getHUD()->setText(this->_currentPhrase, this, Vector3(255, 51, 255), 0, 0); + Game::getHUD()->setText(this->_currentPhrase, this, Vector3(0, 0, 0), 0, 1); } @@ -102,7 +102,7 @@ void Shopkeeper::displayText(std::string say) { HUDWindow* hud = Game::getHUD(); hud->removeText(this->_currentPhrase); this->_currentPhrase = say; - hud->setText(this->_currentPhrase, this, Vector3(255, 51, 255), 0, 0); + hud->setText(this->_currentPhrase, this, Vector3(0, 0, 0), 0, 1); } void Shopkeeper::removeText(void) { diff --git a/Sources/src/SpecialAttack.cpp b/Sources/src/SpecialAttack.cpp @@ -76,19 +76,19 @@ void SpecialAttack::ReceiveMessage(Message *m) { b2DistanceJointDef jointDef3; b2DistanceJointDef jointDef4; jointDef1.Initialize(c->GetBody(), this->_left->GetBody(), b2Vec2(c->GetBody()->GetWorldCenter().x, c->GetBody()->GetWorldCenter().y + 0.4), - b2Vec2(this->_left->GetBody()->GetWorldCenter().x, this->_left->GetBody()->GetWorldCenter().y + 0.4)); + b2Vec2(this->_left->GetBody()->GetWorldCenter().x, this->_left->GetBody()->GetWorldCenter().y + 0.4)); jointDef1.collideConnected = false; jointDef2.Initialize(c->GetBody(), this->_right->GetBody(), b2Vec2(c->GetBody()->GetWorldCenter().x, c->GetBody()->GetWorldCenter().y + 0.4), - b2Vec2(this->_right->GetBody()->GetWorldCenter().x, this->_right->GetBody()->GetWorldCenter().y + 0.4)); + b2Vec2(this->_right->GetBody()->GetWorldCenter().x, this->_right->GetBody()->GetWorldCenter().y + 0.4)); jointDef2.collideConnected = false; jointDef3.Initialize(c->GetBody(), this->_left->GetBody(), b2Vec2(c->GetBody()->GetWorldCenter().x, c->GetBody()->GetWorldCenter().y - 0.4), - b2Vec2(this->_left->GetBody()->GetWorldCenter().x, this->_left->GetBody()->GetWorldCenter().y - 0.4)); + b2Vec2(this->_left->GetBody()->GetWorldCenter().x, this->_left->GetBody()->GetWorldCenter().y - 0.4)); jointDef3.collideConnected = false; jointDef4.Initialize(c->GetBody(), this->_right->GetBody(), b2Vec2(c->GetBody()->GetWorldCenter().x, c->GetBody()->GetWorldCenter().y - 0.4), - b2Vec2(this->_right->GetBody()->GetWorldCenter().x, this->_right->GetBody()->GetWorldCenter().y - 0.4)); + b2Vec2(this->_right->GetBody()->GetWorldCenter().x, this->_right->GetBody()->GetWorldCenter().y - 0.4)); jointDef4.collideConnected = false; b2DistanceJoint *joint1 = (b2DistanceJoint*)theWorld.GetPhysicsWorld().CreateJoint(&jointDef1); @@ -97,8 +97,8 @@ void SpecialAttack::ReceiveMessage(Message *m) { b2DistanceJoint *joint4 = (b2DistanceJoint*)theWorld.GetPhysicsWorld().CreateJoint(&jointDef4); } if (m->GetMessageName() == "RapidFire") { - Game::currentGame->getHero()->getWeapon()->attack(this->character); - theSwitchboard.DeferredBroadcast(new Message("RapidFire"), this->character->_getAttr("rapidFire", "interval").asFloat()); + Game::currentGame->getHero()->getWeapon()->attack(this->character); + theSwitchboard.DeferredBroadcast(new Message("RapidFire"), this->character->_getAttr("rapidFire", "interval").asFloat()); } if (m->GetMessageName() == "SpecialAttackEnd") { if (this->_currentAttack == "whirlwind") { @@ -126,28 +126,47 @@ void SpecialAttack::_whirlwind(void) { Weapon *currentWeapon = Game::currentGame->getHero()->getWeapon(); Characters *hero = Game::currentGame->getHero(); if (this->character->_isAttacking == 0 && this->character->_canMove == 1 && this->character->_speAttReady == 1 /*&& currentWeapon->getType() == "Sword"*/) { - this->character->_speAttReady = 0; - this->character->_isWhirlwinding = true; - currentWeapon->setActive(this->character->_getAttr("whirlwind", "uptime").asFloat()); - this->_right = new Weapon (Game::currentGame->getHero()->_weapon, Game::currentGame->getHero(), 1); - this->_left = new Weapon (Game::currentGame->getHero()->_weapon, Game::currentGame->getHero(), -1); - this->_previousSpeed = hero->buff.bonusSpeed; - hero->_invincibility = true; - hero->buff.bonusSpeed = -(hero->_getAttr("forward", "force").asInt() / 2); - hero->_canAttack = false; - theSwitchboard.DeferredBroadcast(new Message("SpecialAttackEnd"), - this->character->_getAttr("whirlwind", "uptime").asFloat()); - theSwitchboard.DeferredBroadcast(new Message("speAttReady"), - this->character->_getAttr("cooldown").asFloat()); + this->character->_speAttReady = 0; + this->character->_isWhirlwinding = true; + currentWeapon->setActive(this->character->_getAttr("whirlwind", "uptime").asFloat()); + this->_right = new Weapon (Game::currentGame->getHero()->_weapon, Game::currentGame->getHero(), 1); + this->_left = new Weapon (Game::currentGame->getHero()->_weapon, Game::currentGame->getHero(), -1); + this->_previousSpeed = hero->buff.bonusSpeed; + hero->_invincibility = true; + hero->buff.bonusSpeed = -(hero->_getAttr("forward", "force").asInt() / 2); + hero->_canAttack = false; + theSwitchboard.DeferredBroadcast(new Message("SpecialAttackEnd"), + this->character->_getAttr("whirlwind", "uptime").asFloat()); + theSwitchboard.DeferredBroadcast(new Message("speAttReady"), + this->character->_getAttr("cooldown").asFloat()); Game::getHUD()->speAttCooldown(this->character->_getAttr("cooldown").asFloat()); - hero->changeSizeTo(Vector2(hero->_getAttr("x").asFloat(), hero->_getAttr("y").asFloat())); - hero->PlaySpriteAnimation(hero->_getAttr("time").asFloat(), SAT_Loop, - hero->_getAttr("beginFrame").asInt(), - hero->_getAttr("endFrame").asInt(), "base"); - this->_currentAttack = "whirlwind"; + hero->changeSizeTo(Vector2(hero->_getAttr("x").asFloat(), hero->_getAttr("y").asFloat())); + hero->PlaySpriteAnimation(hero->_getAttr("time").asFloat(), SAT_Loop, + hero->_getAttr("beginFrame").asInt(), + hero->_getAttr("endFrame").asInt(), "base"); + this->_currentAttack = "whirlwind"; } } +void SpecialAttack::_throwWeapon(void) { + this->character->_setCategory("throwWeapon"); + b2Vec2 pos = this->character->GetBody()->GetWorldCenter(); + Weapon *currentWeapon = this->character->getWeapon(); + std::string orientation; + Characters *hero = Game::currentGame->getHero(); + if (this->character->_isAttacking == 0 && this->character->_canMove == 1 && this->character->_speAttReady == 1 && currentWeapon->getType() == "Spear") { + this->character->_speAttReady = 0; + if (hero->_latOrientation == Characters::RIGHT) { + new Projectile(currentWeapon->getSprite(), 50, Vector2(pos.x, pos.y), Vector2(1, 1.5f), Vector2(0, 0), "throwSpear", -1, 0.8); + } + if (hero->_latOrientation == Characters::LEFT) + new Projectile(currentWeapon->getSprite(), 50, Vector2(pos.x, pos.y), Vector2(-1, 1.5f), Vector2(0, 0), "throwSpear", 45, 0.8); + theSwitchboard.DeferredBroadcast(new Message("speAttReady"), + this->character->_getAttr("cooldown").asFloat()); + Game::getHUD()->speAttCooldown(this->character->_getAttr("cooldown").asFloat()); + this->_currentAttack = "throwWeapon"; + } +} void SpecialAttack::_shockwave(void) { this->character->_setCategory("shockwave"); @@ -168,10 +187,10 @@ void SpecialAttack::_shockwave(void) { orientation = "left"; hero->changeSizeTo(Vector2(hero->_getAttr("x").asInt(), hero->_getAttr("y").asInt())); hero->PlaySpriteAnimation(hero->_getAttr("time").asFloat(), SAT_OneShot, - hero->_getAttr("beginFrame_" + orientation).asInt(), - hero->_getAttr("endFrame_" + orientation).asInt(), "base"); + hero->_getAttr("beginFrame_" + orientation).asInt(), + hero->_getAttr("endFrame_" + orientation).asInt(), "base"); theSwitchboard.DeferredBroadcast(new Message("speAttReady"), - this->character->_getAttr("cooldown").asFloat()); + this->character->_getAttr("cooldown").asFloat()); Game::getHUD()->speAttCooldown(this->character->_getAttr("cooldown").asFloat()); } } @@ -189,13 +208,13 @@ void SpecialAttack::_rapidFire(void) { this->character->_speAttReady = 0; this->character->_isRapidFiring = true; if (hero->_latOrientation == Characters::RIGHT) - orientation = "right"; + orientation = "right"; else if (hero->_latOrientation == Characters::LEFT) - orientation = "left"; + orientation = "left"; hero->changeSizeTo(Vector2(hero->_getAttr("x").asInt(), hero->_getAttr("y").asInt())); hero->PlaySpriteAnimation(hero->_getAttr("time").asFloat(), SAT_Loop, - hero->_getAttr("beginFrame_" + orientation).asInt(), - hero->_getAttr("endFrame_" + orientation).asInt()); + hero->_getAttr("beginFrame_" + orientation).asInt(), + hero->_getAttr("endFrame_" + orientation).asInt()); theSwitchboard.DeferredBroadcast(new Message("speAttReady"), this->character->_getAttr("cooldown").asFloat()); Game::getHUD()->speAttCooldown(this->character->_getAttr("cooldown").asFloat()); diff --git a/Sources/src/SpecialMoves.cpp b/Sources/src/SpecialMoves.cpp @@ -108,7 +108,7 @@ void SpecialMoves::_dash(void) { this->character->_setCategory("dash"); - if (this->character->_isAttacking == 0 && this->character->_canMove == 1 && this->character->_hasDashed == 0 && this->character->_isDashing == false) { + if (this->character->_isAttacking == 0 && this->character->_canMove == 1) { this->character->_isDashing = true; this->character->GetBody()->SetGravityScale(0); this->character->actionCallback("dash", 0); @@ -117,7 +117,10 @@ this->character->_hasDashed = 1; theSwitchboard.SubscribeTo(this->character, "dashEnd"); theSwitchboard.DeferredBroadcast(new Message("dashEnd"), - this->character->_getAttr("uptime").asFloat()); + this->character->_getAttr("uptime").asFloat()); + theSwitchboard.DeferredBroadcast(new Message("speMoveReady"), + this->character->_getAttr("cooldown").asFloat()); + Game::getHUD()->speMoveCooldown(this->character->_getAttr("cooldown").asFloat()); if (this->character->_latOrientation == Characters::LEFT) this->character->GetBody()->SetLinearVelocity(b2Vec2(-this->character->_getAttr("dashSpeed").asInt(), 0)); else if (this->character->_latOrientation == Characters::RIGHT) @@ -135,7 +138,6 @@ void SpecialMoves::_charge(void) { this->character->_setCategory("charge"); if (this->character->_isAttacking == 0 && this->character->_canMove == 1 && this->character->_speMoveReady == 1 && this->character->_grounds.size() > 0) { - this->character->_speMoveReady = 0; this->character->_invincibility = true; this->character->_isCharging = true; this->character->_canMove = 0; @@ -159,7 +161,9 @@ this->character->PlaySpriteAnimation(this->character->_getAttr("time").asFloat(), SAT_OneShot, this->character->_getAttr("beginFrameCharge" + o).asInt(), this->character->_getAttr("endFrameCharge" + o).asInt(), "chargeHold"); - } + } else { + theSwitchboard.Broadcast(new Message("speMoveReady")); + } } //! Special move: stomp @@ -205,12 +209,13 @@ if (y >= 16) y = 15; if (this->character->_isAttacking == 0 && this->character->_canMove == 1 && this->character->_speMoveReady == 1) { - if (this->character->_orientation == Characters::UP) { + if (this->character->_orientation == Characters::UP) { while (range > 0) { if (y - range > 0 && !t[y - range][x]) break; range--; - } + goto speMoveReady; + } if (range > 0) { this->character->GetBody()->SetTransform(b2Vec2(this->character->GetBody()->GetWorldCenter().x, this->character->GetBody()->GetWorldCenter().y + range), 0); @@ -222,7 +227,8 @@ if (y + range < (t.size()) && !t[y + range - 1][x]) break; range--; - } + goto speMoveReady; + } range--; if (range > 0) { this->character->GetBody()->SetTransform(b2Vec2(this->character->GetBody()->GetWorldCenter().x, @@ -235,7 +241,8 @@ if (x + range < t[y].size() && !t[y][x + range]) break; range--; - } + goto speMoveReady; + } if (range > 0) { this->character->GetBody()->SetTransform(b2Vec2(this->character->GetBody()->GetWorldCenter().x + range, this->character->GetBody()->GetWorldCenter().y), 0); @@ -247,7 +254,8 @@ if (x - range > 0 && !t[y][x - range]) break; range--; - } + goto speMoveReady; + } if (range > 0) { this->character->_speMoveReady = 0; this->character->_grounds.clear(); diff --git a/Sources/src/Weapon.cpp b/Sources/src/Weapon.cpp @@ -91,7 +91,7 @@ Weapon::Weapon(Weapon* w, Characters* c, int i, std::string str) { else this->addAttribute("type", "WeaponHitBox"); this->SetDrawShape(ADS_Square); - this->SetColor(1, 1, 1, 0); + this->SetColor(1, 1, 1, 1); this->addAttribute("physic", "1"); this->_hitboxType = "special"; this->_hitbox = "octogonHitbox"; @@ -132,7 +132,7 @@ Weapon::Weapon(Weapon* w, Characters* c, int i) { else this->addAttribute("type", "WeaponHitBox"); this->SetDrawShape(ADS_Square); - this->SetColor(1, 1, 1, 0); + this->SetColor(1, 1, 1, 1); this->addAttribute("physic", "1"); this->_hitboxType = "special"; this->_hitbox = "octogonHitbox"; diff --git a/Sources/src/WeaponList.cpp b/Sources/src/WeaponList.cpp @@ -133,7 +133,7 @@ std::list<Weapon *> WeaponList::get3Starters(int level, std::string hero) { for (it = this->_allWeapons.begin(); it != this->_allWeapons.end(); it++) { if ((*it)->getStarterLevel() == level && (*it)->getEquipable() == hero) { list.push_back((*it)); - if (list.size() > 3) + if (list.size() == 3) break ; } } diff --git a/Windows b/Windows @@ -1 +0,0 @@ -Subproject commit d9b5badb15f24a6fdfe72fd35544ce9cc8a890b3