Grog-Knight

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

commit 50380177b789021ab6d09bb8fda219d3520ef419
parent 66c3c808727864cd916a56c7557f9761712a4bf7
Author: Louis Solofrizzo <louis@ne02ptzero.me>
Date:   Wed, 10 Jun 2015 15:16:52 +0200

Merge pull request #15 from Ne02ptzero/build

Mokay
Diffstat:
MAngel/Angel.xcodeproj/project.pbxproj | 18++++++++++++++----
AAngel/Angel.xcodeproj/project.xcworkspace/xcshareddata/Angel.xccheckout | 49+++++++++++++++++++++++++++++++++++++++++++++++++
AAngel/Angel.xcodeproj/project.xcworkspace/xcuserdata/lsolofri.xcuserdatad/UserInterfaceState.xcuserstate | 0
AAngel/Angel.xcodeproj/project.xcworkspace/xcuserdata/lsolofri.xcuserdatad/WorkspaceSettings.xcsettings | 10++++++++++
MAngel/Angel.xcodeproj/xcshareddata/xcschemes/Angel.xcscheme | 17+++++++++++++----
MAngel/Angel.xcodeproj/xcuserdata/lsolofri.xcuserdatad/xcschemes/xcschememanagement.plist | 8++++++++
MAngel/Infrastructure/Common.h | 2+-
MAngel/Infrastructure/World.cpp | 2+-
MAngel/Libraries/Box2D-2.2.1/Box2D/Dynamics/Contacts/b2Contact.cpp | 6+++++-
MAngel/Libraries/Box2D-2.2.1/Box2D/Dynamics/Contacts/b2Contact.h | 6++++++
MConfig/input_bindings.ini | 2++
MMACOSX/Makefile | 57++++++++++++++++++++++++++++++++++-----------------------
AMACOSX/build/rogue-like.dSYM/Contents/Info.plist | 20++++++++++++++++++++
MMakefile | 5++++-
MMaps/MapCastle_1.json | 9++++++---
MMaps/MapCastle_2.json | 4++--
MMaps/MapCastle_3.json | 7++++---
MMaps/MapCastle_4.json | 13+++++++++++--
MMaps/MapCastle_5.json | 6+++---
MMaps/castle_1.tsx | 116++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
AMaps/ergergrgegr.json | 344+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMaps/mapCastle_small10.json | 255+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMaps/mapCastle_small11.json | 257+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMaps/mapCastle_small12.json | 250+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMaps/mapCastle_small13.json | 415+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMaps/mapCastle_small13.png | 0
AMaps/mapCastle_small14.json | 349+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMaps/mapCastle_small15.json | 346+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMaps/mapCastle_small16.json | 352+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMaps/mapCastle_small17.json | 345+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMaps/mapCastle_small18.json | 345+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMaps/mapCastle_small5.json | 241+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMaps/mapCastle_small6.json | 242+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMaps/mapCastle_small7.json | 192+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMaps/mapCastle_small8.json | 174+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AMaps/mapCastle_small9.json | 240+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MREADME.md | 2+-
MResources/Elements/Armors/ChestArmor.json | 10+++++-----
MResources/Elements/Armors/Robes.json | 9++++++---
MResources/Elements/Enemies/Enemy.json | 2+-
MResources/Elements/Enemies/Enemy2.json | 17+++++++++++++++--
MResources/Elements/Hero.json | 22+++++++++++++++++++++-
AResources/Images/HUD/empty_heart.png | 0
AResources/Images/HUD/minimap_background.png | 0
RResources/Images/HUD/map_bar_empty_end.png -> Resources/Images/HUD/mp_bar_empty_end.png | 0
AResources/Images/HUD/talk.png | 0
AResources/Images/Hero/hero_064.png | 0
AResources/Images/Hero/hero_065.png | 0
AResources/Images/Hero/hero_066.png | 0
AResources/Images/Hero/hero_067.png | 0
AResources/Images/Hero/hero_068.png | 0
AResources/Images/Hero/hero_069.png | 0
AResources/Images/Hero/hero_070.png | 0
AResources/Images/Hero/hero_071.png | 0
AResources/Images/Hero/hero_072.png | 0
AResources/Images/Hero/hero_073.png | 0
AResources/Images/bag.png | 0
AResources/Images/bag_slot.png | 0
MResources/Images/castel.png | 0
MResources/Images/castle_1.png | 0
AResources/Images/mana.png | 0
AResources/Images/round.png | 0
MSources/inc/Armor.hpp | 2--
MSources/inc/ArmorList.hpp | 1+
DSources/inc/Bonus.hpp | 53-----------------------------------------------------
MSources/inc/Characters.hpp | 19++++++++++++++++++-
MSources/inc/Elements.hpp | 6+++++-
MSources/inc/Enemy.hpp | 14+++++++++++++-
MSources/inc/Game.hpp | 10+++++++---
MSources/inc/HUDWindow.hpp | 25+++++++++++++++++++++----
ASources/inc/Inventory.hpp | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MSources/inc/LevelGenerator.hpp | 34+++++++++++++++++++---------------
MSources/inc/Loot.hpp | 8++++++--
MSources/inc/Map.hpp | 14+++++++++++---
MSources/inc/Maps.hpp | 4++--
ASources/inc/PassivePattern.hpp | 41+++++++++++++++++++++++++++++++++++++++++
ASources/inc/Pattern.hpp | 55+++++++++++++++++++++++++++++++++++++++++++++++++++++++
MSources/inc/Ring.hpp | 2--
MSources/inc/RingList.hpp | 1+
MSources/inc/Room.hpp | 2++
ASources/inc/Tooltip.hpp | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MSources/inc/WeaponList.hpp | 1+
MSources/src/Armor.cpp | 14+++++++-------
MSources/src/ArmorList.cpp | 11+++++++++++
DSources/src/Bonus.cpp | 52----------------------------------------------------
MSources/src/Characters.cpp | 343+++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------
MSources/src/Consumable.cpp | 28+++++++++++++++++-----------
MSources/src/ContactFilter.cpp | 39+++++++++++++++++++++++++++------------
MSources/src/Elements.cpp | 11++++++++---
MSources/src/Enemy.cpp | 45++++++++++++++++++++++++++++++++++++++-------
MSources/src/Equipment.cpp | 5+++--
MSources/src/Game.cpp | 124+++++++++++++++++++++++++++++++++++++++++++++++++------------------------------
MSources/src/GameContactListener.cpp | 12++++++++----
MSources/src/HUDWindow.cpp | 265+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
MSources/src/Hero.cpp | 84++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------
MSources/src/Hitbox.cpp | 16++++++++++------
ASources/src/Inventory.cpp | 101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MSources/src/LevelGenerator.cpp | 150++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------
MSources/src/Loot.cpp | 25+++++++++++++++----------
MSources/src/Map.cpp | 83++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
MSources/src/Maps.cpp | 24++++++++++++------------
MSources/src/Object.cpp | 9++-------
ASources/src/PassivePattern.cpp | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ASources/src/Pattern.cpp | 76++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MSources/src/Ring.cpp | 15++++++++-------
MSources/src/RingList.cpp | 11+++++++++++
MSources/src/Room.cpp | 23++++++++++++++++++++++-
ASources/src/Tooltip.cpp | 102+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MSources/src/Weapon.cpp | 5++++-
MSources/src/WeaponList.cpp | 11+++++++++++
110 files changed, 6387 insertions(+), 535 deletions(-)

diff --git a/Angel/Angel.xcodeproj/project.pbxproj b/Angel/Angel.xcodeproj/project.pbxproj @@ -3141,7 +3141,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0630; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Angel" */; compatibilityVersion = "Xcode 3.2"; @@ -3646,7 +3646,10 @@ 3401560715A918BF00E4C8BF /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; COMBINE_HIDPI_IMAGES = YES; + GCC_C_LANGUAGE_STANDARD = c11; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -3654,7 +3657,10 @@ 3401560815A918BF00E4C8BF /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; COMBINE_HIDPI_IMAGES = YES; + GCC_C_LANGUAGE_STANDARD = c11; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -4084,14 +4090,16 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; GCC_C_LANGUAGE_STANDARD = c99; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ANGEL_DEBUG; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx10.8; + ONLY_ACTIVE_ARCH = NO; + SDKROOT = macosx; VALID_ARCHS = i386; WARNING_CFLAGS = "-Wno-write-strings"; }; @@ -4102,13 +4110,15 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; GCC_C_LANGUAGE_STANDARD = c99; GCC_PREPROCESSOR_DEFINITIONS = ANGEL_RELEASE; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = NO; - SDKROOT = macosx10.8; + SDKROOT = macosx; VALID_ARCHS = i386; WARNING_CFLAGS = "-Wno-write-strings"; }; diff --git a/Angel/Angel.xcodeproj/project.xcworkspace/xcshareddata/Angel.xccheckout b/Angel/Angel.xcodeproj/project.xcworkspace/xcshareddata/Angel.xccheckout @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IDESourceControlProjectFavoriteDictionaryKey</key> + <false/> + <key>IDESourceControlProjectIdentifier</key> + <string>5C26C1AA-82A5-4A5F-9B89-2F8E7F41DBB5</string> + <key>IDESourceControlProjectOriginsDictionary</key> + <dict> + <key>7A197CB7B32EDB86AEA5CFBEAF5A15B1DBED1C37</key> + <string>http://github.com/open-source-parsers/jsoncpp</string> + <key>D3BF9C79E637F6D389985E69F5D11C8B6B31E870</key> + <string>http://github.com/ne02ptzero/grog-like</string> + </dict> + <key>IDESourceControlProjectRelativeInstallPathDictionary</key> + <dict> + <key>7A197CB7B32EDB86AEA5CFBEAF5A15B1DBED1C37</key> + <string>jsoncpp/</string> + <key>D3BF9C79E637F6D389985E69F5D11C8B6B31E870</key> + <string>..</string> + </dict> + <key>IDESourceControlProjectURL</key> + <string>http://github.com/open-source-parsers/jsoncpp</string> + <key>IDESourceControlProjectVersion</key> + <integer>111</integer> + <key>IDESourceControlProjectWCCIdentifier</key> + <string>7A197CB7B32EDB86AEA5CFBEAF5A15B1DBED1C37</string> + <key>IDESourceControlProjectWCConfigurations</key> + <array> + <dict> + <key>IDESourceControlRepositoryExtensionIdentifierKey</key> + <string>public.vcs.git</string> + <key>IDESourceControlWCCIdentifierKey</key> + <string>D3BF9C79E637F6D389985E69F5D11C8B6B31E870</string> + <key>IDESourceControlWCCName</key> + <string>..</string> + </dict> + <dict> + <key>IDESourceControlRepositoryExtensionIdentifierKey</key> + <string>public.vcs.git</string> + <key>IDESourceControlWCCIdentifierKey</key> + <string>7A197CB7B32EDB86AEA5CFBEAF5A15B1DBED1C37</string> + <key>IDESourceControlWCCName</key> + <string>jsoncpp</string> + </dict> + </array> +</dict> +</plist> diff --git a/Angel/Angel.xcodeproj/project.xcworkspace/xcuserdata/lsolofri.xcuserdatad/UserInterfaceState.xcuserstate b/Angel/Angel.xcodeproj/project.xcworkspace/xcuserdata/lsolofri.xcuserdatad/UserInterfaceState.xcuserstate Binary files differ. diff --git a/Angel/Angel.xcodeproj/project.xcworkspace/xcuserdata/lsolofri.xcuserdatad/WorkspaceSettings.xcsettings b/Angel/Angel.xcodeproj/project.xcworkspace/xcuserdata/lsolofri.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key> + <true/> + <key>SnapshotAutomaticallyBeforeSignificantChanges</key> + <false/> +</dict> +</plist> diff --git a/Angel/Angel.xcodeproj/xcshareddata/xcschemes/Angel.xcscheme b/Angel/Angel.xcodeproj/xcshareddata/xcschemes/Angel.xcscheme @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme - LastUpgradeVersion = "0500" + LastUpgradeVersion = "0630" version = "1.3"> <BuildAction parallelizeBuildables = "YES" @@ -17,14 +17,14 @@ BlueprintIdentifier = "345AAD0711CB3710002B4471" BuildableName = "libAngel.a" BlueprintName = "Angel" - ReferencedContainer = "container:Angel.xcodeproj"> + ReferencedContainer = "container:../../../../../../../../../../../nfs/zfs-student-4/users/2013/lsolofri/Documents/cpp/grog-like/Angel/Angel.xcodeproj"> </BuildableReference> </BuildActionEntry> </BuildActionEntries> </BuildAction> <TestAction selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES" buildConfiguration = "Debug"> <Testables> @@ -32,13 +32,22 @@ </TestAction> <LaunchAction selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" launchStyle = "0" useCustomWorkingDirectory = "NO" buildConfiguration = "Debug" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" allowLocationSimulation = "YES"> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "345AAD0711CB3710002B4471" + BuildableName = "libAngel.a" + BlueprintName = "Angel" + ReferencedContainer = "container:../../../../../../../../../../../nfs/zfs-student-4/users/2013/lsolofri/Documents/cpp/grog-like/Angel/Angel.xcodeproj"> + </BuildableReference> + </MacroExpansion> <AdditionalOptions> </AdditionalOptions> </LaunchAction> diff --git a/Angel/Angel.xcodeproj/xcuserdata/lsolofri.xcuserdatad/xcschemes/xcschememanagement.plist b/Angel/Angel.xcodeproj/xcuserdata/lsolofri.xcuserdatad/xcschemes/xcschememanagement.plist @@ -2,6 +2,14 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> + <key>SchemeUserState</key> + <dict> + <key>Angel.xcscheme_^#shared#^_</key> + <dict> + <key>orderHint</key> + <integer>0</integer> + </dict> + </dict> <key>SuppressBuildableAutocreation</key> <dict> <key>3401560615A918BF00E4C8BF</key> diff --git a/Angel/Infrastructure/Common.h b/Angel/Infrastructure/Common.h @@ -97,7 +97,7 @@ #include <GLFW/glfw3.h> #endif -#include <glext.h> +#include "glext.h" //#define GL_CLAMP GL_CLAMP_TO_EDGE #include <math.h> diff --git a/Angel/Infrastructure/World.cpp b/Angel/Infrastructure/World.cpp @@ -651,8 +651,8 @@ void World::EndContact(b2Contact* contact) void World::TickAndRender() { Tick(); - Game::destroyAllBodies(); Game::checkHeroPosition(); + Game::destroyAllBodies(); Render(); Game::showText(); } diff --git a/Angel/Libraries/Box2D-2.2.1/Box2D/Dynamics/Contacts/b2Contact.cpp b/Angel/Libraries/Box2D-2.2.1/Box2D/Dynamics/Contacts/b2Contact.cpp @@ -121,6 +121,7 @@ void b2Contact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) b2Contact::b2Contact(b2Fixture* fA, int32 indexA, b2Fixture* fB, int32 indexB) { m_flags = e_enabledFlag; + enableContact = true; m_fixtureA = fA; m_fixtureB = fB; @@ -156,7 +157,10 @@ void b2Contact::Update(b2ContactListener* listener) b2Manifold oldManifold = m_manifold; // Re-enable this contact. - m_flags |= e_enabledFlag; + /* CODE MODIFIED BY NOICH - ALLOWS CONTINUED CONTACT DISABLE */ + if (enableContact == true) + m_flags |= e_enabledFlag; + /* END OF CODE */ bool touching = false; bool wasTouching = (m_flags & e_touchingFlag) == e_touchingFlag; diff --git a/Angel/Libraries/Box2D-2.2.1/Box2D/Dynamics/Contacts/b2Contact.h b/Angel/Libraries/Box2D-2.2.1/Box2D/Dynamics/Contacts/b2Contact.h @@ -138,6 +138,12 @@ public: /// Evaluate this contact with your own manifold and transforms. virtual void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) = 0; + /* CODE MODIFIED BY NOICH - ALLOWS CONTINUED IGNORED CONTACT */ + + bool enableContact; + + /* END OF CODE */ + protected: friend class b2ContactManager; friend class b2World; diff --git a/Config/input_bindings.ini b/Config/input_bindings.ini @@ -22,6 +22,8 @@ ;; OTHER ACTIONS F = pickupItemPressed + R = equipSelectedItem + TAB = cycleInventory ;; MENU diff --git a/MACOSX/Makefile b/MACOSX/Makefile @@ -2,28 +2,38 @@ NAME = rogue-like CC = g++ CFLAGS = -std=c++0x -arch i386 -Wno-deprecated -g ANGEL_FLAG = -D ANGEL -SRCS = ../Sources/src/main.cpp \ - ../Sources/src/Elements.cpp \ - ../Sources/src/Game.cpp \ - ../Sources/src/Characters.cpp \ - ../Sources/src/WeaponList.cpp \ - ../Sources/src/Weapon.cpp \ - ../Sources/src/Projectile.cpp \ - ../Sources/src/Room.cpp \ - ../Sources/src/LevelGenerator.cpp \ - ../Sources/src/Hero.cpp \ - ../Sources/src/Enemy.cpp \ - ../Sources/src/Map.cpp \ - ../Sources/src/Maps.cpp \ - ../Sources/src/GameContactListener.cpp \ - ../Sources/src/ContactFilter.cpp \ - ../Sources/src/Log.cpp \ - ../Sources/src/Object.cpp \ - ../Sources/src/Equipment.cpp \ - ../Sources/src/Consumable.cpp \ - ../Sources/src/Hitbox.cpp \ - ../Angel/Scripting/Interfaces/AngelLuaWrapping.cpp \ - ../Sources/src/HUDWindow.cpp \ +SRCS = ../Sources/src/Elements.cpp \ + ../Sources/src/Game.cpp \ + ../Sources/src/main.cpp \ + ../Sources/src/Maps.cpp \ + ../Sources/src/Hero.cpp \ + ../Sources/src/Projectile.cpp \ + ../Sources/src/Room.cpp \ + ../Sources/src/LevelGenerator.cpp \ + ../Sources/src/Loot.cpp \ + ../Sources/src/EnemyList.cpp \ + ../Sources/src/Enemy.cpp \ + ../Sources/src/GameContactListener.cpp \ + ../Sources/src/ContactFilter.cpp \ + ../Sources/src/Weapon.cpp \ + ../Sources/src/Log.cpp \ + ../Sources/src/Armor.cpp \ + ../Sources/src/ArmorList.cpp \ + ../Sources/src/Characters.cpp \ + ../Sources/src/Object.cpp \ + ../Sources/src/WeaponList.cpp \ + ../Sources/src/Map.cpp \ + ../Sources/src/Equipment.cpp \ + ../Sources/src/Consumable.cpp \ + ../Sources/src/Hitbox.cpp \ + ../Sources/src/HUDWindow.cpp \ + ../Sources/src/Menu.cpp \ + ../Sources/src/Ring.cpp \ + ../Sources/src/RingList.cpp \ + ../Sources/src/Tooltip.cpp \ + ../Sources/src/Inventory.cpp \ + ../Sources/src/Pattern.cpp \ + ../Sources/src/PassivePattern.cpp OBJS = $(SRCS:.cpp=.o) @@ -49,7 +59,8 @@ LIBS = ../Angel/build/libAngel.a \ ../Angel/build/libGWEN.a \ ../Angel/build/libHIDUtilities.a \ ../Angel/build/libLua.a \ - ../Angel/build/libOgg.a + ../Angel/build/libOgg.a \ + ../Angel/Scripting/Interfaces/AngelLuaWrapping.cpp FRAMEWORKS = -framework Cocoa \ -framework IOKit \ diff --git a/MACOSX/build/rogue-like.dSYM/Contents/Info.plist b/MACOSX/build/rogue-like.dSYM/Contents/Info.plist @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleIdentifier</key> + <string>com.apple.xcode.dsym.rogue-like</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>dSYM</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>CFBundleVersion</key> + <string>1</string> + </dict> +</plist> diff --git a/Makefile b/Makefile @@ -87,7 +87,10 @@ SRCS = ./Sources/src/Elements.cpp \ ./Sources/src/Menu.cpp \ ./Sources/src/Ring.cpp \ ./Sources/src/RingList.cpp \ - ./Sources/src/Bonus.cpp + ./Sources/src/Tooltip.cpp \ + ./Sources/src/Inventory.cpp \ + ./Sources/src/Pattern.cpp \ + ./Sources/src/PassivePattern.cpp SYSOBJS = $(patsubst %.cpp,%.o,$(SYSSRCS)) OBJS = $(patsubst %.cpp,%.o,$(SRCS)) diff --git a/Maps/MapCastle_1.json b/Maps/MapCastle_1.json @@ -12,7 +12,7 @@ "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, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 77, 0, 0, 77, 0, 0, 77, 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, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 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, 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, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 41, 0, 0, 77, 77, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 41, 0, 77, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 77, 0, 0, 77, 0, 0, 77, 0, 0, 0, 0, 0, 38, 39, 0, 0, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 19, 20, 21, 0, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 41, 0, 0, 77, 77, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 41, 0, 77, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "height":16, "name":"Tile Layer 2", "opacity":1, @@ -22,18 +22,20 @@ "x":0, "y":0 }], + "nextobjectid":1, "orientation":"orthogonal", "properties": { "doorDown":"1", "number":"2" }, + "renderorder":"right-down", "tileheight":32, "tilesets":[ { "firstgid":1, - "image":"Maps\/Resources\/Images\/castle_1.png", - "imageheight":288, + "image":"Resources\/Images\/castle_1.png", + "imageheight":640, "imagewidth":288, "margin":0, "name":"castle_1", @@ -287,6 +289,7 @@ }, "62": { + "hitbox":"upperTierHitbox", "speType":"canCross" }, "69": diff --git a/Maps/MapCastle_2.json b/Maps/MapCastle_2.json @@ -1,7 +1,7 @@ { "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, 46, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 47, 40, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 55, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 65, 40, 40, 40, 40, 40, 64, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 64, 57, 48, 48, 48, 48, 48, 57, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 46, 48, 48, 48, 48, 57, 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, 55, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 46, 48, 48, 48, 48, 48, 48, 47, 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, 46, 48, 48, 48, 48, 47, 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, 65, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 67, 40, 40, 40, 40, 40, 40, 40, 40, 40, 64, 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], + "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, 46, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 47, 40, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 55, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 65, 40, 40, 40, 40, 40, 64, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 64, 57, 48, 48, 48, 48, 48, 57, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 46, 48, 48, 48, 48, 57, 57, 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, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 46, 48, 48, 48, 48, 48, 48, 47, 40, 40, 40, 40, 40, 40, 40, 40, 55, 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, 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, 46, 48, 48, 48, 48, 47, 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, 65, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 67, 40, 40, 40, 40, 40, 40, 40, 40, 40, 64, 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 1", "opacity":1, @@ -36,7 +36,7 @@ { "firstgid":1, "image":"Resources\/Images\/castel.png", - "imageheight":288, + "imageheight":640, "imagewidth":288, "margin":0, "name":"castel", diff --git a/Maps/MapCastle_3.json b/Maps/MapCastle_3.json @@ -1,7 +1,7 @@ { "height":16, "layers":[ { - "data":[57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 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, 73, 40, 40, 40, 40, 40, 40, 40, 40, 40, 73, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56, 40, 40, 40, 55, 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, 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, 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, 46, 48, 48, 48, 48, 48, 48, 48, 47, 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, 66, 40, 40, 40, 40, 40, 40, 40, 55, 65, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 75, 40, 40, 40, 40, 40, 40, 40, 64, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 40, 40, 40, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49], + "data":[57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 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, 73, 40, 40, 40, 40, 40, 40, 40, 40, 40, 73, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56, 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, 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, 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, 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, 46, 48, 48, 48, 48, 48, 48, 48, 47, 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, 66, 40, 40, 40, 40, 40, 40, 40, 55, 65, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 75, 40, 40, 40, 40, 40, 40, 40, 64, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 40, 40, 40, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49], "height":16, "name":"Tile Layer 1", "opacity":1, @@ -12,7 +12,7 @@ "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, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 48, 48, 48, 48, 48, 48, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 48, 48, 48, 48, 48, 48, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "height":16, "name":"Tile Layer 2", "opacity":1, @@ -40,7 +40,7 @@ { "firstgid":1, "image":"Resources\/Images\/castle_1.png", - "imageheight":288, + "imageheight":640, "imagewidth":288, "margin":0, "name":"castle_1", @@ -298,6 +298,7 @@ }, "62": { + "hitbox":"upperTierHitbox", "speType":"canCross" }, "69": diff --git a/Maps/MapCastle_4.json b/Maps/MapCastle_4.json @@ -12,10 +12,14 @@ "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, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 0, 19, 20, 21, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 28, 0, 0, 0, 0, 37, 0, 0, 0, 0, 37, 0, 0, 78, 78, 78, 78, 78, 78, 78, 0, 0, 37, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 77, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 77, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 40, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 0, 19, 20, 21, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 28, 0, 0, 0, 0, 37, 0, 0, 0, 0, 37, 0, 0, 78, 78, 78, 78, 78, 78, 78, 0, 0, 37, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 77, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 77, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 2", "opacity":1, + "properties": + { + "speType":"canCross" + }, "type":"tilelayer", "visible":true, "width":27, @@ -35,7 +39,7 @@ { "firstgid":1, "image":"Resources\/Images\/castle_1.png", - "imageheight":288, + "imageheight":640, "imagewidth":288, "margin":0, "name":"castle_1", @@ -287,6 +291,11 @@ { "physic":"0" }, + "62": + { + "hitbox":"upperTierHitbox", + "speType":"canCross" + }, "69": { "physic":"0" diff --git a/Maps/MapCastle_5.json b/Maps/MapCastle_5.json @@ -1,7 +1,7 @@ { "height":16, "layers":[ { - "data":[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, 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, 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, 40, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 46, 40, 40, 40, 40, 40, 40, 40, 40, 40, 47, 40, 40, 40, 40, 40, 40, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56, 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, 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, 46, 48, 48, 48, 48, 47, 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, 65, 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, 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], + "data":[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, 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, 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, 40, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 46, 40, 40, 40, 40, 40, 40, 40, 40, 40, 47, 40, 40, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56, 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, 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, 46, 48, 48, 48, 48, 47, 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, 65, 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, 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 1", "opacity":1, @@ -12,7 +12,7 @@ "y":0 }, { - "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, 0, 0, 32, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 33, 0, 0, 0, 0, 32, 0, 0, 55, 0, 0, 41, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 42, 0, 0, 0, 0, 41, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 55, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 10, 11, 12, 55, 0, 0, 19, 20, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 19, 20, 21, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "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, 0, 0, 32, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 33, 0, 0, 0, 0, 32, 0, 0, 55, 0, 0, 41, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 42, 0, 0, 0, 0, 41, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 55, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 10, 11, 12, 55, 0, 0, 19, 20, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 19, 20, 21, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 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 2", "opacity":1, @@ -35,7 +35,7 @@ { "firstgid":1, "image":"Resources\/Images\/castle_1.png", - "imageheight":288, + "imageheight":640, "imagewidth":288, "margin":0, "name":"castle_1", diff --git a/Maps/castle_1.tsx b/Maps/castle_1.tsx @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<tileset name="castle_1" tilewidth="32" tileheight="32"> - <image source="Resources/Images/castle_1.png" width="288" height="288"/> +<tileset name="castle" tilewidth="32" tileheight="32"> + <image source="Resources/Images/castle_1.png" width="288" height="640"/> <tile id="0"> <properties> <property name="animate" value="1"/> @@ -297,14 +297,20 @@ <property name="physic" value="0"/> </properties> </tile> + <tile id="53"> + <properties> + <property name="hitbox" value="upperTierHitbox"/> + <property name="speType" value="canCross"/> + </properties> + </tile> <tile id="60"> <properties> <property name="physic" value="0"/> </properties> </tile> - <tile id="61"> + <tile id="62"> <properties> - <property name="physic" value="0"/> + <property name="speType" value="canCross"/> </properties> </tile> <tile id="69"> @@ -312,15 +318,111 @@ <property name="physic" value="0"/> </properties> </tile> - <tile id="70"> + <tile id="76"> + <properties> + <property name="hitbox" value="lowerHalfHitbox"/> + <property name="speType" value="spikes"/> + </properties> + </tile> + <tile id="77"> <properties> + <property name="animate" value="1"/> + <property name="next" value="78"/> + <property name="speType" value="water"/> + <property name="time" value="0.1"/> + </properties> + </tile> + <tile id="78"> + <properties> + <property name="animate" value="1"/> + <property name="next" value="77"/> + <property name="speType" value="water"/> + <property name="time" value="0.1"/> + </properties> + </tile> + <tile id="79"> + <properties> + <property name="speType" value="water"/> + </properties> + </tile> + <tile id="80"> + <properties> + <property name="hitbox" value="rightHalfHitbox"/> + </properties> + </tile> + <tile id="81"> + <properties> + <property name="speType" value="canCross"/> + </properties> + </tile> + <tile id="82"> + <properties> + <property name="speType" value="canCross"/> + </properties> + </tile> + <tile id="83"> + <properties> + <property name="speType" value="canCross"/> + </properties> + </tile> + <tile id="84"> + <properties> + <property name="speType" value="canCross"/> + </properties> + </tile> + <tile id="85"> + <properties> + <property name="speType" value="canCross"/> + </properties> + </tile> + <tile id="86"> + <properties> + <property name="speType" value="canCross"/> + </properties> + </tile> + <tile id="87"> + <properties> + <property name="alpha" value="0"/> <property name="physic" value="0"/> </properties> </tile> - <tile id="76"> + <tile id="88"> + <properties> + <property name="alpha" value="0"/> + <property name="physic" value="0"/> + </properties> + </tile> + <tile id="89"> + <properties> + <property name="hitbox" value="leftHalfHitbox"/> + </properties> + </tile> + <tile id="91"> + <properties> + <property name="hitbox" value="rightHalfHitbox"/> + <property name="speType" value="spikes"/> + </properties> + </tile> + <tile id="100"> + <properties> + <property name="hitbox" value="leftHalfHitbox"/> + <property name="speType" value="spikes"/> + </properties> + </tile> + <tile id="109"> <properties> - <property name="hitbox" value="lowerHalf"/> + <property name="hitbox" value="upperHalfHitbox"/> <property name="speType" value="spikes"/> </properties> </tile> + <tile id="135"> + <properties> + <property name="hitbox" value="upperHalfHitbox"/> + </properties> + </tile> + <tile id="144"> + <properties> + <property name="hitbox" value="lowerHalfHitbox"/> + </properties> + </tile> </tileset> diff --git a/Maps/ergergrgegr.json b/Maps/ergergrgegr.json @@ -0,0 +1,343 @@ +{ "height":16, + "layers":[ + { + "data":[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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 50, 49, 51, 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, 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, 55, 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, 55, 57, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 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 1", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }, + { + "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, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 57, 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, 55, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 55, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 0, 0, 0, 0, 0, 0, 55, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 57, 78, 78, 78, 78, 78, 78, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 57, 80, 80, 80, 80, 80, 80, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 57, 80, 80, 80, 80, 80, 80, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 57, 80, 80, 80, 80, 80, 80, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 0, 0, 0, 0, 55, 0, 0, 0, 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 2", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }], + "nextobjectid":1, + "orientation":"orthogonal", + "properties": + { + "doorRight":"0" + }, + "renderorder":"right-down", + "tileheight":32, + "tilesets":[ + { + "firstgid":1, + "image":"Resources\/Images\/castle_1.png", + "imageheight":640, + "imagewidth":288, + "margin":0, + "name":"castle", + "properties": + { + + }, + "spacing":0, + "tileheight":32, + "tileproperties": + { + "0": + { + "animate":"1", + "next":"3", + "physic":"0", + "time":"0.1" + }, + "1": + { + "animate":"1", + "next":"4", + "physic":"0", + "time":"0.1" + }, + "10": + { + "animate":"1", + "next":"13", + "physic":"0", + "time":"0.1" + }, + "11": + { + "animate":"1", + "next":"14", + "physic":"0", + "time":"0.1" + }, + "12": + { + "animate":"1", + "next":"15", + "physic":"0", + "time":"0.1" + }, + "13": + { + "animate":"1", + "next":"16", + "physic":"0", + "time":"0.1" + }, + "14": + { + "animate":"1", + "next":"17", + "physic":"0", + "time":"0.1" + }, + "15": + { + "animate":"1", + "next":"9", + "physic":"0", + "time":"0.08" + }, + "16": + { + "animate":"1", + "next":"10", + "physic":"0", + "time":"0.08" + }, + "17": + { + "animate":"1", + "next":"11", + "physic":"0", + "time":"0.08" + }, + "18": + { + "animate":"1", + "next":"21", + "physic":"0", + "time":"0.1" + }, + "19": + { + "animate":"1", + "next":"22", + "physic":"0", + "time":"0.1" + }, + "2": + { + "animate":"1", + "next":"5", + "physic":"0", + "time":"0.1" + }, + "20": + { + "animate":"1", + "next":"23", + "physic":"0", + "time":"0.1" + }, + "21": + { + "animate":"1", + "next":"24", + "physic":"0", + "time":"0.1" + }, + "22": + { + "animate":"1", + "next":"25", + "physic":"0", + "time":"0.1" + }, + "23": + { + "animate":"1", + "next":"26", + "physic":"0", + "time":"0.1" + }, + "24": + { + "animate":"1", + "next":"18", + "physic":"0", + "time":"0.08" + }, + "25": + { + "animate":"1", + "next":"19", + "physic":"0", + "time":"0.08" + }, + "26": + { + "animate":"1", + "next":"20", + "physic":"0", + "time":"0.08" + }, + "27": + { + "physic":"0" + }, + "28": + { + "physic":"0" + }, + "29": + { + "physic":"0" + }, + "3": + { + "animate":"1", + "next":"6", + "physic":"0", + "time":"0.1" + }, + "30": + { + "physic":"0" + }, + "31": + { + "physic":"0" + }, + "32": + { + "physic":"0" + }, + "33": + { + "physic":"0" + }, + "34": + { + "physic":"0" + }, + "36": + { + "physic":"0" + }, + "37": + { + "physic":"0" + }, + "38": + { + "physic":"0" + }, + "39": + { + "physic":"0" + }, + "4": + { + "animate":"1", + "next":"7", + "physic":"0", + "time":"0.1" + }, + "40": + { + "physic":"0" + }, + "41": + { + "physic":"0" + }, + "42": + { + "physic":"0" + }, + "43": + { + "physic":"0" + }, + "5": + { + "animate":"1", + "next":"8", + "physic":"0", + "time":"0.1" + }, + "53": + { + "speType":"canCross" + }, + "6": + { + "animate":"1", + "next":"0", + "physic":"0", + "time":"0.08" + }, + "60": + { + "physic":"0" + }, + "69": + { + "physic":"0" + }, + "7": + { + "animate":"1", + "next":"1", + "physic":"0", + "time":"0.08" + }, + "76": + { + "hitbox":"lowerHalfHitbox", + "speType":"spikes" + }, + "77": + { + "animate":"1", + "next":"78", + "speType":"water", + "time":"0.1" + }, + "78": + { + "animate":"1", + "next":"77", + "speType":"water", + "time":"0.1" + }, + "79": + { + "speType":"water" + }, + "8": + { + "animate":"1", + "next":"2", + "physic":"0", + "time":"0.08" + }, + "9": + { + "animate":"1", + "next":"12", + "physic":"0", + "time":"0.1" + } + }, + "tilewidth":32 + }], + "tilewidth":32, + "version":1, + "width":27 +}+ \ No newline at end of file diff --git a/Maps/mapCastle_small10.json b/Maps/mapCastle_small10.json @@ -0,0 +1,255 @@ +{ "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, 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, 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, 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, 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, 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, 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, 57, 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, 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, 40, 40, 57, 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, 57, 57, 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, 57, 57, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 66, 40, 40, 40, 40, 40, 40, 40, 40, 66, 40, 40, 40, 57, 57, 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, 57, 57, 40, 40, 66, 40, 40, 40, 40, 66, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 66, 40, 40, 40, 40, 40, 40, 57, 57, 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, 57], + "height":16, + "name":"Calque de Tile 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, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 16, 17, 18, 0, 0, 0, 0, 19, 20, 21, 0, 0, 0, 0, 0, 0, 0, 22, 23, 24, 0, 0, 0, 0, 0, 0, 0, 25, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 0], + "height":16, + "name":"Calque 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 0, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 0], + "height":16, + "name":"Calque 3", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }], + "nextobjectid":1, + "orientation":"orthogonal", + "properties": + { + "door_left":"1", + "door_right":"1" + }, + "renderorder":"right-down", + "tileheight":32, + "tilesets":[ + { + "firstgid":1, + "image":"Resources/Images/castle_1.png", + "imageheight":640, + "imagewidth":288, + "margin":0, + "name":"castle_1", + "properties": + { + + }, + "spacing":0, + "tileheight":32, + "tileproperties": + { + "0": + { + "physic":"0" + }, + "1": + { + "physic":"0" + }, + "10": + { + "physic":"0" + }, + "11": + { + "physic":"0" + }, + "12": + { + "physic":"0" + }, + "13": + { + "physic":"0" + }, + "14": + { + "physic":"0" + }, + "15": + { + "physic":"0" + }, + "16": + { + "physic":"0" + }, + "17": + { + "physic":"0" + }, + "18": + { + "physic":"0" + }, + "19": + { + "physic":"0" + }, + "2": + { + "physic":"0" + }, + "20": + { + "physic":"0" + }, + "21": + { + "physic":"0" + }, + "22": + { + "physic":"0" + }, + "23": + { + "physic":"0" + }, + "24": + { + "physic":"0" + }, + "25": + { + "physic":"0" + }, + "26": + { + "physic":"0" + }, + "27": + { + "physic":"0" + }, + "28": + { + "physic":"0" + }, + "29": + { + "physic":"0" + }, + "3": + { + "physic":"0" + }, + "30": + { + "physic":"0" + }, + "31": + { + "physic":"0" + }, + "32": + { + "physic":"0" + }, + "33": + { + "physic":"0" + }, + "34": + { + "physic":"0" + }, + "35": + { + "physic":"0" + }, + "36": + { + "physic":"0" + }, + "37": + { + "physic":"0" + }, + "38": + { + "physic":"0" + }, + "39": + { + "physic":"0" + }, + "4": + { + "physic":"0" + }, + "40": + { + "physic":"0" + }, + "41": + { + "physic":"0" + }, + "42": + { + "physic":"0" + }, + "43": + { + "physic":"0" + }, + "44": + { + "physic":"0" + }, + "5": + { + "physic":"0" + }, + "52": + { + "physic":"0" + }, + "53": + { + "physic":"0" + }, + "6": + { + "physic":"0" + }, + "7": + { + "physic":"0" + }, + "8": + { + "physic":"0" + }, + "9": + { + "physic":"0" + } + }, + "tilewidth":32 + }], + "tilewidth":32, + "version":1, + "width":27 +} diff --git a/Maps/mapCastle_small11.json b/Maps/mapCastle_small11.json @@ -0,0 +1,256 @@ +{ "height":16, + "layers":[ + { + "data":[57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 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, 57, 57, 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, 57, 57, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 48, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 57, 57, 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, 57, 57, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 48, 48, 57, 57, 40, 40, 40, 40, 40, 40, 40, 40, 40, 48, 40, 40, 40, 40, 40, 48, 40, 40, 40, 40, 40, 40, 40, 40, 40, 57, 57, 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, 57, 57, 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, 57, 57, 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, 57, 57, 40, 40, 40, 40, 40, 48, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 48, 40, 40, 40, 40, 40, 57, 57, 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, 57, 57, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 48, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 57, 57, 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, 57, 57, 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, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57], + "height":16, + "name":"Calque de Tile 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, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 38, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":16, + "name":"Calque 2", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }], + "nextobjectid":1, + "orientation":"orthogonal", + "properties": + { + "door_down":"1", + "door_up":"1" + }, + "renderorder":"right-down", + "tileheight":32, + "tilesets":[ + { + "firstgid":1, + "image":"Resources\/Images\/castle_1.png", + "imageheight":640, + "imagewidth":288, + "margin":0, + "name":"castle_1", + "properties": + { + + }, + "spacing":0, + "tileheight":32, + "tileproperties": + { + "0": + { + "physic":"0" + }, + "1": + { + "physic":"0" + }, + "10": + { + "physic":"0" + }, + "11": + { + "physic":"0" + }, + "12": + { + "physic":"0" + }, + "13": + { + "physic":"0" + }, + "14": + { + "physic":"0" + }, + "15": + { + "physic":"0" + }, + "16": + { + "physic":"0" + }, + "17": + { + "physic":"0" + }, + "18": + { + "physic":"0" + }, + "19": + { + "physic":"0" + }, + "2": + { + "physic":"0" + }, + "20": + { + "physic":"0" + }, + "21": + { + "physic":"0" + }, + "22": + { + "physic":"0" + }, + "23": + { + "physic":"0" + }, + "24": + { + "physic":"0" + }, + "25": + { + "physic":"0" + }, + "26": + { + "physic":"0" + }, + "27": + { + "physic":"0" + }, + "28": + { + "physic":"0" + }, + "29": + { + "physic":"0" + }, + "3": + { + "physic":"0" + }, + "30": + { + "physic":"0" + }, + "31": + { + "physic":"0" + }, + "32": + { + "physic":"0" + }, + "33": + { + "physic":"0" + }, + "34": + { + "physic":"0" + }, + "35": + { + "physic":"0" + }, + "36": + { + "physic":"0" + }, + "37": + { + "physic":"0" + }, + "38": + { + "physic":"0" + }, + "39": + { + "physic":"0" + }, + "4": + { + "physic":"0" + }, + "40": + { + "physic":"0" + }, + "41": + { + "physic":"0" + }, + "42": + { + "physic":"0" + }, + "43": + { + "physic":"0" + }, + "44": + { + "physic":"0" + }, + "5": + { + "physic":"0" + }, + "52": + { + "physic":"0" + }, + "53": + { + "physic":"0" + }, + "6": + { + "physic":"0" + }, + "60": + { + "physic":"0" + }, + "62": + { + "speType":"canCross" + }, + "69": + { + "physic":"0" + }, + "7": + { + "physic":"0" + }, + "8": + { + "physic":"0" + }, + "9": + { + "physic":"0" + } + }, + "tilewidth":32 + }], + "tilewidth":32, + "version":1, + "width":27 +}+ \ No newline at end of file diff --git a/Maps/mapCastle_small12.json b/Maps/mapCastle_small12.json @@ -0,0 +1,249 @@ +{ "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, 57, 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, 57, 57, 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, 57, 57, 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, 57, 57, 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, 57, 57, 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, 57, 57, 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, 57, 57, 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, 57, 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, 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, 40, 40, 57, 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, 57, 57, 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, 57, 57, 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, 57, 57, 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, 57, 57, 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, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57], + "height":16, + "name":"Calque de Tile 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, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 0, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 18, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 57, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 57, 57, 0, 0, 57, 57, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 57, 57, 0, 0, 57, 57, 57, 57, 57, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 57, 57, 57, 57, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":16, + "name":"Calque 2", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }], + "nextobjectid":1, + "orientation":"orthogonal", + "properties": + { + "door_down":"1", + "door_left":"1", + "door_right":"1" + }, + "renderorder":"right-down", + "tileheight":32, + "tilesets":[ + { + "firstgid":1, + "image":"Resources\/Images\/castle_1.png", + "imageheight":640, + "imagewidth":288, + "margin":0, + "name":"castle_1", + "properties": + { + + }, + "spacing":0, + "tileheight":32, + "tileproperties": + { + "0": + { + "physic":"0" + }, + "1": + { + "physic":"0" + }, + "10": + { + "physic":"0" + }, + "11": + { + "physic":"0" + }, + "12": + { + "physic":"0" + }, + "13": + { + "physic":"0" + }, + "14": + { + "physic":"0" + }, + "15": + { + "physic":"0" + }, + "16": + { + "physic":"0" + }, + "17": + { + "physic":"0" + }, + "18": + { + "physic":"0" + }, + "19": + { + "physic":"0" + }, + "2": + { + "physic":"0" + }, + "20": + { + "physic":"0" + }, + "21": + { + "physic":"0" + }, + "22": + { + "physic":"0" + }, + "23": + { + "physic":"0" + }, + "24": + { + "physic":"0" + }, + "25": + { + "physic":"0" + }, + "26": + { + "physic":"0" + }, + "27": + { + "physic":"0" + }, + "28": + { + "physic":"0" + }, + "29": + { + "physic":"0" + }, + "3": + { + "physic":"0" + }, + "30": + { + "physic":"0" + }, + "31": + { + "physic":"0" + }, + "32": + { + "physic":"0" + }, + "33": + { + "physic":"0" + }, + "34": + { + "physic":"0" + }, + "35": + { + "physic":"0" + }, + "36": + { + "physic":"0" + }, + "37": + { + "physic":"0" + }, + "38": + { + "physic":"0" + }, + "39": + { + "physic":"0" + }, + "4": + { + "physic":"0" + }, + "40": + { + "physic":"0" + }, + "41": + { + "physic":"0" + }, + "42": + { + "physic":"0" + }, + "43": + { + "physic":"0" + }, + "44": + { + "physic":"0" + }, + "5": + { + "physic":"0" + }, + "52": + { + "physic":"0" + }, + "53": + { + "physic":"0" + }, + "6": + { + "physic":"0" + }, + "62": + { + "speType":"canCross" + }, + "7": + { + "physic":"0" + }, + "8": + { + "physic":"0" + }, + "9": + { + "physic":"0" + } + }, + "tilewidth":32 + }], + "tilewidth":32, + "version":1, + "width":27 +}+ \ No newline at end of file diff --git a/Maps/mapCastle_small13.json b/Maps/mapCastle_small13.json @@ -0,0 +1,414 @@ +{ "height":16, + "layers":[ + { + "data":[57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 56, 40, 40, 40, 55, 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, 55, 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, 64, 40, 40, 40, 40, 40, 40, 40, 40, 55, 57, 49, 49, 49, 49, 49, 49, 49, 51, 40, 40, 50, 49, 49, 49, 49, 49, 57, 40, 40, 40, 40, 40, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 40, 40, 40, 40, 40, 55, 40, 40, 50, 49, 49, 51, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 64, 40, 40, 40, 40, 40, 55, 40, 40, 55, 40, 40, 40, 40, 40, 55, 56, 40, 40, 50, 49, 49, 49, 49, 49, 49, 49, 57, 40, 40, 50, 40, 40, 55, 40, 40, 55, 40, 40, 40, 40, 40, 64, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 40, 40, 55, 40, 40, 55, 40, 40, 55, 40, 40, 50, 49, 49, 57, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 40, 40, 55, 40, 40, 55, 40, 40, 55, 40, 40, 55, 40, 40, 40, 57, 49, 49, 49, 49, 49, 49, 49, 51, 40, 40, 55, 40, 40, 55, 40, 40, 55, 40, 40, 55, 40, 40, 55, 40, 40, 40, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 40, 40, 55, 40, 40, 55, 40, 40, 55, 40, 40, 55, 40, 40, 46, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 64, 40, 40, 55, 40, 40, 55, 40, 40, 55, 40, 40, 55, 40, 40, 55, 56, 40, 40, 50, 49, 49, 49, 49, 49, 49, 49, 57, 40, 40, 55, 40, 40, 55, 40, 40, 55, 40, 40, 55, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 40, 40, 40, 40, 40, 55, 40, 40, 40, 40, 40, 55, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 40, 40, 40, 40, 40, 55, 40, 40, 40, 40, 40, 55, 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], + "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, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 39, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 28, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 10, 11, 12, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 63, 63, 0, 0, 0, 0, 86, 86, 0, 0, 32, 0, 37, 0, 0, 32, 0, 0, 0, 0, 0, 32, 0, 37, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 32, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 86, 86, 0, 41, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 63, 63, 0, 0, 0, 0, 86, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 63, 63, 0, 0, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 86, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 86, 0, 0, 0, 0, 0, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 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 2", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }], + "nextobjectid":1, + "orientation":"orthogonal", + "properties": + { + "doorRight":"1", + "doorUp":"1" + }, + "renderorder":"right-down", + "tileheight":32, + "tilesets":[ + { + "firstgid":1, + "image":"Resources\/Images\/castle_1.png", + "imageheight":640, + "imagewidth":288, + "margin":0, + "name":"castle", + "properties": + { + + }, + "spacing":0, + "tileheight":32, + "tileproperties": + { + "0": + { + "animate":"1", + "next":"3", + "physic":"0", + "time":"0.1" + }, + "1": + { + "animate":"1", + "next":"4", + "physic":"0", + "time":"0.1" + }, + "10": + { + "animate":"1", + "next":"13", + "physic":"0", + "time":"0.1" + }, + "100": + { + "hitbox":"leftHalfHitbox", + "speType":"spikes" + }, + "109": + { + "hitbox":"upperHalfHitbox", + "speType":"spikes" + }, + "11": + { + "animate":"1", + "next":"14", + "physic":"0", + "time":"0.1" + }, + "12": + { + "animate":"1", + "next":"15", + "physic":"0", + "time":"0.1" + }, + "13": + { + "animate":"1", + "next":"16", + "physic":"0", + "time":"0.1" + }, + "135": + { + "hitbox":"upperHalfHitbox" + }, + "14": + { + "animate":"1", + "next":"17", + "physic":"0", + "time":"0.1" + }, + "144": + { + "hitbox":"lowerHalfHitbox" + }, + "15": + { + "animate":"1", + "next":"9", + "physic":"0", + "time":"0.08" + }, + "16": + { + "animate":"1", + "next":"10", + "physic":"0", + "time":"0.08" + }, + "17": + { + "animate":"1", + "next":"11", + "physic":"0", + "time":"0.08" + }, + "18": + { + "animate":"1", + "next":"21", + "physic":"0", + "time":"0.1" + }, + "19": + { + "animate":"1", + "next":"22", + "physic":"0", + "time":"0.1" + }, + "2": + { + "animate":"1", + "next":"5", + "physic":"0", + "time":"0.1" + }, + "20": + { + "animate":"1", + "next":"23", + "physic":"0", + "time":"0.1" + }, + "21": + { + "animate":"1", + "next":"24", + "physic":"0", + "time":"0.1" + }, + "22": + { + "animate":"1", + "next":"25", + "physic":"0", + "time":"0.1" + }, + "23": + { + "animate":"1", + "next":"26", + "physic":"0", + "time":"0.1" + }, + "24": + { + "animate":"1", + "next":"18", + "physic":"0", + "time":"0.08" + }, + "25": + { + "animate":"1", + "next":"19", + "physic":"0", + "time":"0.08" + }, + "26": + { + "animate":"1", + "next":"20", + "physic":"0", + "time":"0.08" + }, + "27": + { + "physic":"0" + }, + "28": + { + "physic":"0" + }, + "29": + { + "physic":"0" + }, + "3": + { + "animate":"1", + "next":"6", + "physic":"0", + "time":"0.1" + }, + "30": + { + "physic":"0" + }, + "31": + { + "physic":"0" + }, + "32": + { + "physic":"0" + }, + "33": + { + "physic":"0" + }, + "34": + { + "physic":"0" + }, + "36": + { + "physic":"0" + }, + "37": + { + "physic":"0" + }, + "38": + { + "physic":"0" + }, + "39": + { + "physic":"0" + }, + "4": + { + "animate":"1", + "next":"7", + "physic":"0", + "time":"0.1" + }, + "40": + { + "physic":"0" + }, + "41": + { + "physic":"0" + }, + "42": + { + "physic":"0" + }, + "43": + { + "physic":"0" + }, + "5": + { + "animate":"1", + "next":"8", + "physic":"0", + "time":"0.1" + }, + "53": + { + "hitbox":"upperTierHitbox", + "speType":"canCross" + }, + "6": + { + "animate":"1", + "next":"0", + "physic":"0", + "time":"0.08" + }, + "60": + { + "physic":"0" + }, + "62": + { + "speType":"canCross" + }, + "69": + { + "physic":"0" + }, + "7": + { + "animate":"1", + "next":"1", + "physic":"0", + "time":"0.08" + }, + "76": + { + "hitbox":"lowerHalfHitbox", + "speType":"spikes" + }, + "77": + { + "animate":"1", + "next":"78", + "speType":"water", + "time":"0.1" + }, + "78": + { + "animate":"1", + "next":"77", + "speType":"water", + "time":"0.1" + }, + "79": + { + "speType":"water" + }, + "8": + { + "animate":"1", + "next":"2", + "physic":"0", + "time":"0.08" + }, + "80": + { + "hitbox":"rightHalfHitbox" + }, + "81": + { + "speType":"canCross" + }, + "82": + { + "speType":"canCross" + }, + "83": + { + "speType":"canCross" + }, + "84": + { + "speType":"canCross" + }, + "85": + { + "speType":"canCross" + }, + "86": + { + "speType":"canCross" + }, + "87": + { + "alpha":"0", + "physic":"0" + }, + "88": + { + "alpha":"0", + "physic":"0" + }, + "89": + { + "hitbox":"leftHalfHitbox" + }, + "9": + { + "animate":"1", + "next":"12", + "physic":"0", + "time":"0.1" + }, + "91": + { + "hitbox":"rightHalfHitbox", + "speType":"spikes" + } + }, + "tilewidth":32 + }], + "tilewidth":32, + "version":1, + "width":27 +}+ \ No newline at end of file diff --git a/Maps/mapCastle_small13.png b/Maps/mapCastle_small13.png Binary files differ. diff --git a/Maps/mapCastle_small14.json b/Maps/mapCastle_small14.json @@ -0,0 +1,348 @@ +{ "height":16, + "layers":[ + { + "data":[57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 40, 57, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 40, 57, 57, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 40, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 57, 57, 57, 57, 40, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 57, 57, 57, 57, 40, 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, 40, 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, 40, 40, 40, 40, 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, 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, 57, 57, 57, 57, 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, 40, 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], + "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, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 0, 0, 0, 0, 80, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 28, 0, 0, 63, 63, 61, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 70, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 80, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 0, 0, 0, 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 2", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }], + "nextobjectid":1, + "orientation":"orthogonal", + "properties": + { + "doorLeft":"1", + "doorUp":"1" + }, + "renderorder":"right-down", + "tileheight":32, + "tilesets":[ + { + "firstgid":1, + "image":"Resources\/Images\/castle_1.png", + "imageheight":640, + "imagewidth":288, + "margin":0, + "name":"castle", + "properties": + { + + }, + "spacing":0, + "tileheight":32, + "tileproperties": + { + "0": + { + "animate":"1", + "next":"3", + "physic":"0", + "time":"0.1" + }, + "1": + { + "animate":"1", + "next":"4", + "physic":"0", + "time":"0.1" + }, + "10": + { + "animate":"1", + "next":"13", + "physic":"0", + "time":"0.1" + }, + "11": + { + "animate":"1", + "next":"14", + "physic":"0", + "time":"0.1" + }, + "12": + { + "animate":"1", + "next":"15", + "physic":"0", + "time":"0.1" + }, + "13": + { + "animate":"1", + "next":"16", + "physic":"0", + "time":"0.1" + }, + "14": + { + "animate":"1", + "next":"17", + "physic":"0", + "time":"0.1" + }, + "15": + { + "animate":"1", + "next":"9", + "physic":"0", + "time":"0.08" + }, + "16": + { + "animate":"1", + "next":"10", + "physic":"0", + "time":"0.08" + }, + "17": + { + "animate":"1", + "next":"11", + "physic":"0", + "time":"0.08" + }, + "18": + { + "animate":"1", + "next":"21", + "physic":"0", + "time":"0.1" + }, + "19": + { + "animate":"1", + "next":"22", + "physic":"0", + "time":"0.1" + }, + "2": + { + "animate":"1", + "next":"5", + "physic":"0", + "time":"0.1" + }, + "20": + { + "animate":"1", + "next":"23", + "physic":"0", + "time":"0.1" + }, + "21": + { + "animate":"1", + "next":"24", + "physic":"0", + "time":"0.1" + }, + "22": + { + "animate":"1", + "next":"25", + "physic":"0", + "time":"0.1" + }, + "23": + { + "animate":"1", + "next":"26", + "physic":"0", + "time":"0.1" + }, + "24": + { + "animate":"1", + "next":"18", + "physic":"0", + "time":"0.08" + }, + "25": + { + "animate":"1", + "next":"19", + "physic":"0", + "time":"0.08" + }, + "26": + { + "animate":"1", + "next":"20", + "physic":"0", + "time":"0.08" + }, + "27": + { + "physic":"0" + }, + "28": + { + "physic":"0" + }, + "29": + { + "physic":"0" + }, + "3": + { + "animate":"1", + "next":"6", + "physic":"0", + "time":"0.1" + }, + "30": + { + "physic":"0" + }, + "31": + { + "physic":"0" + }, + "32": + { + "physic":"0" + }, + "33": + { + "physic":"0" + }, + "34": + { + "physic":"0" + }, + "36": + { + "physic":"0" + }, + "37": + { + "physic":"0" + }, + "38": + { + "physic":"0" + }, + "39": + { + "physic":"0" + }, + "4": + { + "animate":"1", + "next":"7", + "physic":"0", + "time":"0.1" + }, + "40": + { + "physic":"0" + }, + "41": + { + "physic":"0" + }, + "42": + { + "physic":"0" + }, + "43": + { + "physic":"0" + }, + "5": + { + "animate":"1", + "next":"8", + "physic":"0", + "time":"0.1" + }, + "53": + { + "speType":"canCross" + }, + "6": + { + "animate":"1", + "next":"0", + "physic":"0", + "time":"0.08" + }, + "60": + { + "physic":"0" + }, + "62": + { + "speType":"canCross" + }, + "69": + { + "physic":"0" + }, + "7": + { + "animate":"1", + "next":"1", + "physic":"0", + "time":"0.08" + }, + "76": + { + "hitbox":"lowerHalfHitbox", + "speType":"spikes" + }, + "77": + { + "animate":"1", + "next":"78", + "speType":"water", + "time":"0.1" + }, + "78": + { + "animate":"1", + "next":"77", + "speType":"water", + "time":"0.1" + }, + "79": + { + "speType":"water" + }, + "8": + { + "animate":"1", + "next":"2", + "physic":"0", + "time":"0.08" + }, + "9": + { + "animate":"1", + "next":"12", + "physic":"0", + "time":"0.1" + } + }, + "tilewidth":32 + }], + "tilewidth":32, + "version":1, + "width":27 +}+ \ No newline at end of file diff --git a/Maps/mapCastle_small15.json b/Maps/mapCastle_small15.json @@ -0,0 +1,345 @@ +{ "height":16, + "layers":[ + { + "data":[49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 40, 40, 40, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 57, 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, 57, 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, 57, 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, 57, 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, 57, 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, 57, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 40, 40, 40, 55, 56, 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, 55, 56, 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, 56, 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, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 56, 40, 40, 40, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56, 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, 55, 56, 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, 55, 56, 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, 55, 56, 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, 55, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 40, 40, 40, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49], + "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, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 57, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 0, 57, 0, 0, 0, 19, 20, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 57, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 57, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 57, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 57, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 0, 0, 0, 77, 77, 77, 77, 77, 77, 77, 77, 77, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":16, + "name":"Tile Layer 2", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }], + "nextobjectid":1, + "orientation":"orthogonal", + "properties": + { + "doorDown":"1", + "doorRight":"1", + "doorUp":"1" + }, + "renderorder":"right-down", + "tileheight":32, + "tilesets":[ + { + "firstgid":1, + "image":"Resources\/Images\/castle_1.png", + "imageheight":640, + "imagewidth":288, + "margin":0, + "name":"castle", + "properties": + { + + }, + "spacing":0, + "tileheight":32, + "tileproperties": + { + "0": + { + "animate":"1", + "next":"3", + "physic":"0", + "time":"0.1" + }, + "1": + { + "animate":"1", + "next":"4", + "physic":"0", + "time":"0.1" + }, + "10": + { + "animate":"1", + "next":"13", + "physic":"0", + "time":"0.1" + }, + "11": + { + "animate":"1", + "next":"14", + "physic":"0", + "time":"0.1" + }, + "12": + { + "animate":"1", + "next":"15", + "physic":"0", + "time":"0.1" + }, + "13": + { + "animate":"1", + "next":"16", + "physic":"0", + "time":"0.1" + }, + "14": + { + "animate":"1", + "next":"17", + "physic":"0", + "time":"0.1" + }, + "15": + { + "animate":"1", + "next":"9", + "physic":"0", + "time":"0.08" + }, + "16": + { + "animate":"1", + "next":"10", + "physic":"0", + "time":"0.08" + }, + "17": + { + "animate":"1", + "next":"11", + "physic":"0", + "time":"0.08" + }, + "18": + { + "animate":"1", + "next":"21", + "physic":"0", + "time":"0.1" + }, + "19": + { + "animate":"1", + "next":"22", + "physic":"0", + "time":"0.1" + }, + "2": + { + "animate":"1", + "next":"5", + "physic":"0", + "time":"0.1" + }, + "20": + { + "animate":"1", + "next":"23", + "physic":"0", + "time":"0.1" + }, + "21": + { + "animate":"1", + "next":"24", + "physic":"0", + "time":"0.1" + }, + "22": + { + "animate":"1", + "next":"25", + "physic":"0", + "time":"0.1" + }, + "23": + { + "animate":"1", + "next":"26", + "physic":"0", + "time":"0.1" + }, + "24": + { + "animate":"1", + "next":"18", + "physic":"0", + "time":"0.08" + }, + "25": + { + "animate":"1", + "next":"19", + "physic":"0", + "time":"0.08" + }, + "26": + { + "animate":"1", + "next":"20", + "physic":"0", + "time":"0.08" + }, + "27": + { + "physic":"0" + }, + "28": + { + "physic":"0" + }, + "29": + { + "physic":"0" + }, + "3": + { + "animate":"1", + "next":"6", + "physic":"0", + "time":"0.1" + }, + "30": + { + "physic":"0" + }, + "31": + { + "physic":"0" + }, + "32": + { + "physic":"0" + }, + "33": + { + "physic":"0" + }, + "34": + { + "physic":"0" + }, + "36": + { + "physic":"0" + }, + "37": + { + "physic":"0" + }, + "38": + { + "physic":"0" + }, + "39": + { + "physic":"0" + }, + "4": + { + "animate":"1", + "next":"7", + "physic":"0", + "time":"0.1" + }, + "40": + { + "physic":"0" + }, + "41": + { + "physic":"0" + }, + "42": + { + "physic":"0" + }, + "43": + { + "physic":"0" + }, + "5": + { + "animate":"1", + "next":"8", + "physic":"0", + "time":"0.1" + }, + "53": + { + "speType":"canCross" + }, + "6": + { + "animate":"1", + "next":"0", + "physic":"0", + "time":"0.08" + }, + "60": + { + "physic":"0" + }, + "69": + { + "physic":"0" + }, + "7": + { + "animate":"1", + "next":"1", + "physic":"0", + "time":"0.08" + }, + "76": + { + "hitbox":"lowerHalfHitbox", + "speType":"spikes" + }, + "77": + { + "animate":"1", + "next":"78", + "speType":"water", + "time":"0.1" + }, + "78": + { + "animate":"1", + "next":"77", + "speType":"water", + "time":"0.1" + }, + "79": + { + "speType":"water" + }, + "8": + { + "animate":"1", + "next":"2", + "physic":"0", + "time":"0.08" + }, + "9": + { + "animate":"1", + "next":"12", + "physic":"0", + "time":"0.1" + } + }, + "tilewidth":32 + }], + "tilewidth":32, + "version":1, + "width":27 +}+ \ No newline at end of file diff --git a/Maps/mapCastle_small16.json b/Maps/mapCastle_small16.json @@ -0,0 +1,351 @@ +{ "height":16, + "layers":[ + { + "data":[57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 56, 40, 40, 40, 55, 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, 50, 49, 49, 49, 49, 49, 49, 49, 51, 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, 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, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 50, 49, 49, 49, 49, 49, 49, 49, 51, 40, 40, 40, 40, 40, 40, 40, 55, 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, 55, 47, 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, 57, 47, 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, 57, 57, 47, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 50, 49, 49, 49, 49, 49, 51, 40, 55, 57, 57, 57, 47, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 57, 57, 57, 57, 47, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 51, 40, 40, 40, 50, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49], + "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, 28, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 37, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 61, 0, 0, 0, 0, 19, 20, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 77, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 77, 77, 0, 0, 0, 0, 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 2", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }], + "nextobjectid":1, + "orientation":"orthogonal", + "properties": + { + "doorDown":"1", + "doorLeft":"1", + "doorUp":"1" + }, + "renderorder":"right-down", + "tileheight":32, + "tilesets":[ + { + "firstgid":1, + "image":"Resources\/Images\/castle_1.png", + "imageheight":640, + "imagewidth":288, + "margin":0, + "name":"castle", + "properties": + { + + }, + "spacing":0, + "tileheight":32, + "tileproperties": + { + "0": + { + "animate":"1", + "next":"3", + "physic":"0", + "time":"0.1" + }, + "1": + { + "animate":"1", + "next":"4", + "physic":"0", + "time":"0.1" + }, + "10": + { + "animate":"1", + "next":"13", + "physic":"0", + "time":"0.1" + }, + "11": + { + "animate":"1", + "next":"14", + "physic":"0", + "time":"0.1" + }, + "12": + { + "animate":"1", + "next":"15", + "physic":"0", + "time":"0.1" + }, + "13": + { + "animate":"1", + "next":"16", + "physic":"0", + "time":"0.1" + }, + "14": + { + "animate":"1", + "next":"17", + "physic":"0", + "time":"0.1" + }, + "15": + { + "animate":"1", + "next":"9", + "physic":"0", + "time":"0.08" + }, + "16": + { + "animate":"1", + "next":"10", + "physic":"0", + "time":"0.08" + }, + "17": + { + "animate":"1", + "next":"11", + "physic":"0", + "time":"0.08" + }, + "18": + { + "animate":"1", + "next":"21", + "physic":"0", + "time":"0.1" + }, + "19": + { + "animate":"1", + "next":"22", + "physic":"0", + "time":"0.1" + }, + "2": + { + "animate":"1", + "next":"5", + "physic":"0", + "time":"0.1" + }, + "20": + { + "animate":"1", + "next":"23", + "physic":"0", + "time":"0.1" + }, + "21": + { + "animate":"1", + "next":"24", + "physic":"0", + "time":"0.1" + }, + "22": + { + "animate":"1", + "next":"25", + "physic":"0", + "time":"0.1" + }, + "23": + { + "animate":"1", + "next":"26", + "physic":"0", + "time":"0.1" + }, + "24": + { + "animate":"1", + "next":"18", + "physic":"0", + "time":"0.08" + }, + "25": + { + "animate":"1", + "next":"19", + "physic":"0", + "time":"0.08" + }, + "26": + { + "animate":"1", + "next":"20", + "physic":"0", + "time":"0.08" + }, + "27": + { + "physic":"0" + }, + "28": + { + "physic":"0" + }, + "29": + { + "physic":"0" + }, + "3": + { + "animate":"1", + "next":"6", + "physic":"0", + "time":"0.1" + }, + "30": + { + "physic":"0" + }, + "31": + { + "physic":"0" + }, + "32": + { + "physic":"0" + }, + "33": + { + "physic":"0" + }, + "34": + { + "physic":"0" + }, + "36": + { + "physic":"0" + }, + "37": + { + "physic":"0" + }, + "38": + { + "physic":"0" + }, + "39": + { + "physic":"0" + }, + "4": + { + "animate":"1", + "next":"7", + "physic":"0", + "time":"0.1" + }, + "40": + { + "physic":"0" + }, + "41": + { + "physic":"0" + }, + "42": + { + "physic":"0" + }, + "43": + { + "physic":"0" + }, + "5": + { + "animate":"1", + "next":"8", + "physic":"0", + "time":"0.1" + }, + "53": + { + "speType":"canCross" + }, + "6": + { + "animate":"1", + "next":"0", + "physic":"0", + "time":"0.08" + }, + "60": + { + "physic":"0" + }, + "69": + { + "physic":"0" + }, + "7": + { + "animate":"1", + "next":"1", + "physic":"0", + "time":"0.08" + }, + "71": + { + "isFlying":"1", + "physic":"0", + "spawnEnemy":"1" + }, + "76": + { + "hitbox":"lowerHalfHitbox", + "speType":"spikes" + }, + "77": + { + "animate":"1", + "next":"78", + "speType":"water", + "time":"0.1" + }, + "78": + { + "animate":"1", + "next":"77", + "speType":"water", + "time":"0.1" + }, + "79": + { + "speType":"water" + }, + "8": + { + "animate":"1", + "next":"2", + "physic":"0", + "time":"0.08" + }, + "9": + { + "animate":"1", + "next":"12", + "physic":"0", + "time":"0.1" + } + }, + "tilewidth":32 + }], + "tilewidth":32, + "version":1, + "width":27 +}+ \ No newline at end of file diff --git a/Maps/mapCastle_small17.json b/Maps/mapCastle_small17.json @@ -0,0 +1,344 @@ +{ "height":16, + "layers":[ + { + "data":[78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 57, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 57, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 57, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 57, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 57, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 57, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 57, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 46, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 56, 40, 40, 40, 67, 40, 40, 67, 40, 40, 40, 67, 40, 40, 40, 55, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 51, 40, 40, 40, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49], + "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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 77, 0, 77, 77, 77, 0, 77, 77, 77, 0, 0, 0, 0, 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 2", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }], + "nextobjectid":1, + "orientation":"orthogonal", + "properties": + { + "doorDown":"1", + "doorRight":"1" + }, + "renderorder":"right-down", + "tileheight":32, + "tilesets":[ + { + "firstgid":1, + "image":"Resources\/Images\/castle_1.png", + "imageheight":640, + "imagewidth":288, + "margin":0, + "name":"castle", + "properties": + { + + }, + "spacing":0, + "tileheight":32, + "tileproperties": + { + "0": + { + "animate":"1", + "next":"3", + "physic":"0", + "time":"0.1" + }, + "1": + { + "animate":"1", + "next":"4", + "physic":"0", + "time":"0.1" + }, + "10": + { + "animate":"1", + "next":"13", + "physic":"0", + "time":"0.1" + }, + "11": + { + "animate":"1", + "next":"14", + "physic":"0", + "time":"0.1" + }, + "12": + { + "animate":"1", + "next":"15", + "physic":"0", + "time":"0.1" + }, + "13": + { + "animate":"1", + "next":"16", + "physic":"0", + "time":"0.1" + }, + "14": + { + "animate":"1", + "next":"17", + "physic":"0", + "time":"0.1" + }, + "15": + { + "animate":"1", + "next":"9", + "physic":"0", + "time":"0.08" + }, + "16": + { + "animate":"1", + "next":"10", + "physic":"0", + "time":"0.08" + }, + "17": + { + "animate":"1", + "next":"11", + "physic":"0", + "time":"0.08" + }, + "18": + { + "animate":"1", + "next":"21", + "physic":"0", + "time":"0.1" + }, + "19": + { + "animate":"1", + "next":"22", + "physic":"0", + "time":"0.1" + }, + "2": + { + "animate":"1", + "next":"5", + "physic":"0", + "time":"0.1" + }, + "20": + { + "animate":"1", + "next":"23", + "physic":"0", + "time":"0.1" + }, + "21": + { + "animate":"1", + "next":"24", + "physic":"0", + "time":"0.1" + }, + "22": + { + "animate":"1", + "next":"25", + "physic":"0", + "time":"0.1" + }, + "23": + { + "animate":"1", + "next":"26", + "physic":"0", + "time":"0.1" + }, + "24": + { + "animate":"1", + "next":"18", + "physic":"0", + "time":"0.08" + }, + "25": + { + "animate":"1", + "next":"19", + "physic":"0", + "time":"0.08" + }, + "26": + { + "animate":"1", + "next":"20", + "physic":"0", + "time":"0.08" + }, + "27": + { + "physic":"0" + }, + "28": + { + "physic":"0" + }, + "29": + { + "physic":"0" + }, + "3": + { + "animate":"1", + "next":"6", + "physic":"0", + "time":"0.1" + }, + "30": + { + "physic":"0" + }, + "31": + { + "physic":"0" + }, + "32": + { + "physic":"0" + }, + "33": + { + "physic":"0" + }, + "34": + { + "physic":"0" + }, + "36": + { + "physic":"0" + }, + "37": + { + "physic":"0" + }, + "38": + { + "physic":"0" + }, + "39": + { + "physic":"0" + }, + "4": + { + "animate":"1", + "next":"7", + "physic":"0", + "time":"0.1" + }, + "40": + { + "physic":"0" + }, + "41": + { + "physic":"0" + }, + "42": + { + "physic":"0" + }, + "43": + { + "physic":"0" + }, + "5": + { + "animate":"1", + "next":"8", + "physic":"0", + "time":"0.1" + }, + "53": + { + "speType":"canCross" + }, + "6": + { + "animate":"1", + "next":"0", + "physic":"0", + "time":"0.08" + }, + "60": + { + "physic":"0" + }, + "69": + { + "physic":"0" + }, + "7": + { + "animate":"1", + "next":"1", + "physic":"0", + "time":"0.08" + }, + "76": + { + "hitbox":"lowerHalfHitbox", + "speType":"spikes" + }, + "77": + { + "animate":"1", + "next":"78", + "speType":"water", + "time":"0.1" + }, + "78": + { + "animate":"1", + "next":"77", + "speType":"water", + "time":"0.1" + }, + "79": + { + "speType":"water" + }, + "8": + { + "animate":"1", + "next":"2", + "physic":"0", + "time":"0.08" + }, + "9": + { + "animate":"1", + "next":"12", + "physic":"0", + "time":"0.1" + } + }, + "tilewidth":32 + }], + "tilewidth":32, + "version":1, + "width":27 +}+ \ No newline at end of file diff --git a/Maps/mapCastle_small18.json b/Maps/mapCastle_small18.json @@ -0,0 +1,344 @@ +{ "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, 57, 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, 57, 57, 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, 57, 57, 40, 40, 40, 40, 40, 40, 40, 40, 40, 46, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 57, 57, 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, 57, 57, 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, 57, 57, 40, 40, 40, 40, 50, 51, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 57, 57, 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, 57, 40, 40, 40, 40, 40, 55, 56, 40, 40, 40, 66, 40, 40, 40, 66, 40, 40, 40, 40, 66, 40, 40, 40, 40, 40, 40, 57, 40, 40, 40, 40, 40, 55, 56, 40, 40, 40, 75, 40, 40, 40, 75, 40, 40, 40, 40, 75, 40, 40, 40, 40, 40, 40, 57, 57, 40, 40, 40, 40, 55, 56, 40, 40, 40, 50, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 51, 40, 40, 40, 57, 57, 40, 40, 40, 40, 57, 57, 40, 40, 40, 40, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 57, 57, 40, 40, 40, 40, 57, 57, 40, 40, 40, 40, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 57, 57, 40, 40, 40, 40, 57, 57, 40, 40, 40, 40, 56, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 57, 57, 40, 40, 40, 40, 57, 57, 40, 40, 40, 40, 65, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57], + "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, 61, 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, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 38, 39, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 32, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 77, 77, 0, 77, 77, 77, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 78, 78, 78, 0, 0, 78, 78, 78, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 80, 80, 0, 0, 80, 80, 80, 80, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 63, 63, 0, 0, 80, 80, 80, 80, 0, 0, 80, 80, 80, 80, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 61, 0, 0, 0, 80, 80, 80, 80, 0, 0, 80, 80, 80, 80, 56, 0, 0, 0, 0, 19, 20, 21, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":16, + "name":"Tile Layer 2", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }], + "nextobjectid":1, + "orientation":"orthogonal", + "properties": + { + "doorDown":"1", + "doorLeft":"1" + }, + "renderorder":"right-down", + "tileheight":32, + "tilesets":[ + { + "firstgid":1, + "image":"Resources\/Images\/castle_1.png", + "imageheight":640, + "imagewidth":288, + "margin":0, + "name":"castle", + "properties": + { + + }, + "spacing":0, + "tileheight":32, + "tileproperties": + { + "0": + { + "animate":"1", + "next":"3", + "physic":"0", + "time":"0.1" + }, + "1": + { + "animate":"1", + "next":"4", + "physic":"0", + "time":"0.1" + }, + "10": + { + "animate":"1", + "next":"13", + "physic":"0", + "time":"0.1" + }, + "11": + { + "animate":"1", + "next":"14", + "physic":"0", + "time":"0.1" + }, + "12": + { + "animate":"1", + "next":"15", + "physic":"0", + "time":"0.1" + }, + "13": + { + "animate":"1", + "next":"16", + "physic":"0", + "time":"0.1" + }, + "14": + { + "animate":"1", + "next":"17", + "physic":"0", + "time":"0.1" + }, + "15": + { + "animate":"1", + "next":"9", + "physic":"0", + "time":"0.08" + }, + "16": + { + "animate":"1", + "next":"10", + "physic":"0", + "time":"0.08" + }, + "17": + { + "animate":"1", + "next":"11", + "physic":"0", + "time":"0.08" + }, + "18": + { + "animate":"1", + "next":"21", + "physic":"0", + "time":"0.1" + }, + "19": + { + "animate":"1", + "next":"22", + "physic":"0", + "time":"0.1" + }, + "2": + { + "animate":"1", + "next":"5", + "physic":"0", + "time":"0.1" + }, + "20": + { + "animate":"1", + "next":"23", + "physic":"0", + "time":"0.1" + }, + "21": + { + "animate":"1", + "next":"24", + "physic":"0", + "time":"0.1" + }, + "22": + { + "animate":"1", + "next":"25", + "physic":"0", + "time":"0.1" + }, + "23": + { + "animate":"1", + "next":"26", + "physic":"0", + "time":"0.1" + }, + "24": + { + "animate":"1", + "next":"18", + "physic":"0", + "time":"0.08" + }, + "25": + { + "animate":"1", + "next":"19", + "physic":"0", + "time":"0.08" + }, + "26": + { + "animate":"1", + "next":"20", + "physic":"0", + "time":"0.08" + }, + "27": + { + "physic":"0" + }, + "28": + { + "physic":"0" + }, + "29": + { + "physic":"0" + }, + "3": + { + "animate":"1", + "next":"6", + "physic":"0", + "time":"0.1" + }, + "30": + { + "physic":"0" + }, + "31": + { + "physic":"0" + }, + "32": + { + "physic":"0" + }, + "33": + { + "physic":"0" + }, + "34": + { + "physic":"0" + }, + "36": + { + "physic":"0" + }, + "37": + { + "physic":"0" + }, + "38": + { + "physic":"0" + }, + "39": + { + "physic":"0" + }, + "4": + { + "animate":"1", + "next":"7", + "physic":"0", + "time":"0.1" + }, + "40": + { + "physic":"0" + }, + "41": + { + "physic":"0" + }, + "42": + { + "physic":"0" + }, + "43": + { + "physic":"0" + }, + "5": + { + "animate":"1", + "next":"8", + "physic":"0", + "time":"0.1" + }, + "53": + { + "speType":"canCross" + }, + "6": + { + "animate":"1", + "next":"0", + "physic":"0", + "time":"0.08" + }, + "60": + { + "physic":"0" + }, + "69": + { + "physic":"0" + }, + "7": + { + "animate":"1", + "next":"1", + "physic":"0", + "time":"0.08" + }, + "76": + { + "hitbox":"lowerHalfHitbox", + "speType":"spikes" + }, + "77": + { + "animate":"1", + "next":"78", + "speType":"water", + "time":"0.1" + }, + "78": + { + "animate":"1", + "next":"77", + "speType":"water", + "time":"0.1" + }, + "79": + { + "speType":"water" + }, + "8": + { + "animate":"1", + "next":"2", + "physic":"0", + "time":"0.08" + }, + "9": + { + "animate":"1", + "next":"12", + "physic":"0", + "time":"0.1" + } + }, + "tilewidth":32 + }], + "tilewidth":32, + "version":1, + "width":27 +}+ \ No newline at end of file diff --git a/Maps/mapCastle_small5.json b/Maps/mapCastle_small5.json @@ -0,0 +1,240 @@ +{ "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, 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, 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, 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, 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, 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, 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, 40, 40, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 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, 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, 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, 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, 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], + "height":16, + "name":"Calque de Tile 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, 28, 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, 37, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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":"Calque 2", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }], + "nextobjectid":1, + "orientation":"orthogonal", + "properties": + { + "door_left":"1", + "door_right":"1" + }, + "renderorder":"right-down", + "tileheight":32, + "tilesets":[ + { + "firstgid":1, + "image":"Resources\/Images\/castel.png", + "imageheight":640, + "imagewidth":288, + "margin":0, + "name":"castel", + "properties": + { + + }, + "spacing":0, + "tileheight":32, + "tileproperties": + { + "0": + { + "physic":"0" + }, + "1": + { + "physic":"0" + }, + "10": + { + "physic":"0" + }, + "11": + { + "physic":"0" + }, + "12": + { + "physic":"0" + }, + "13": + { + "physic":"0" + }, + "14": + { + "physic":"0" + }, + "15": + { + "physic":"0" + }, + "16": + { + "physic":"0" + }, + "17": + { + "physic":"0" + }, + "18": + { + "physic":"0" + }, + "19": + { + "physic":"0" + }, + "2": + { + "physic":"0" + }, + "20": + { + "physic":"0" + }, + "21": + { + "physic":"0" + }, + "22": + { + "physic":"0" + }, + "23": + { + "physic":"0" + }, + "24": + { + "physic":"0" + }, + "25": + { + "physic":"0" + }, + "26": + { + "physic":"0" + }, + "27": + { + "physic":"0" + }, + "28": + { + "physic":"0" + }, + "29": + { + "physic":"0" + }, + "3": + { + "physic":"0" + }, + "30": + { + "physic":"0" + }, + "31": + { + "physic":"0" + }, + "32": + { + "physic":"0" + }, + "33": + { + "physic":"0" + }, + "34": + { + "physic":"0" + }, + "35": + { + "physic":"0" + }, + "36": + { + "physic":"0" + }, + "37": + { + "physic":"0" + }, + "38": + { + "physic":"0" + }, + "39": + { + "physic":"0" + }, + "4": + { + "physic":"0" + }, + "40": + { + "physic":"0" + }, + "41": + { + "physic":"0" + }, + "42": + { + "physic":"0" + }, + "43": + { + "physic":"0" + }, + "44": + { + "physic":"0" + }, + "5": + { + "physic":"0" + }, + "6": + { + "physic":"0" + }, + "62": + { + "speType":"canCross" + }, + "7": + { + "physic":"0" + }, + "8": + { + "physic":"0" + }, + "9": + { + "physic":"0" + } + }, + "tilewidth":32 + }], + "tilewidth":32, + "version":1, + "width":27 +}+ \ No newline at end of file diff --git a/Maps/mapCastle_small6.json b/Maps/mapCastle_small6.json @@ -0,0 +1,241 @@ +{ "height":16, + "layers":[ + { + "data":[57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 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, 46, 47, 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, 46, 47, 40, 40, 40, 40, 40, 55, 56, 40, 40, 40, 40, 46, 48, 48, 47, 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, 46, 48, 48, 48, 47, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 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, 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, 40, 40, 49, 49, 49, 51, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 46, 48, 48, 47, 40, 40, 40, 40, 50, 57, 57, 57, 56, 40, 40, 40, 40, 40, 40, 73, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 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, 55, 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, 50, 57, 57, 57, 57, 56, 40, 40, 40, 50, 49, 49, 49, 49, 49, 51, 40, 40, 50, 49, 49, 49, 49, 49, 49, 49, 49, 57, 57, 57, 57, 57, 65, 40, 40, 40, 64, 57, 57, 57, 57, 57, 65, 40, 40, 64, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57], + "height":16, + "name":"Calque de Tile 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, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 18, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 76, 76, 76, 0, 0, 0, 0, 0, 0, 0, 76, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":16, + "name":"Calque 2", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }], + "nextobjectid":1, + "orientation":"orthogonal", + "properties": + { + "doorLeft":"1", + "doorRight":"1", + "doorUp":"1" + }, + "renderorder":"right-down", + "tileheight":32, + "tilesets":[ + { + "firstgid":1, + "image":"Resources\/Images\/castel.png", + "imageheight":640, + "imagewidth":288, + "margin":0, + "name":"castel", + "properties": + { + + }, + "spacing":0, + "tileheight":32, + "tileproperties": + { + "0": + { + "physic":"0" + }, + "1": + { + "physic":"0" + }, + "10": + { + "physic":"0" + }, + "11": + { + "physic":"0" + }, + "12": + { + "physic":"0" + }, + "13": + { + "physic":"0" + }, + "14": + { + "physic":"0" + }, + "15": + { + "physic":"0" + }, + "16": + { + "physic":"0" + }, + "17": + { + "physic":"0" + }, + "18": + { + "physic":"0" + }, + "19": + { + "physic":"0" + }, + "2": + { + "physic":"0" + }, + "20": + { + "physic":"0" + }, + "21": + { + "physic":"0" + }, + "22": + { + "physic":"0" + }, + "23": + { + "physic":"0" + }, + "24": + { + "physic":"0" + }, + "25": + { + "physic":"0" + }, + "26": + { + "physic":"0" + }, + "27": + { + "physic":"0" + }, + "28": + { + "physic":"0" + }, + "29": + { + "physic":"0" + }, + "3": + { + "physic":"0" + }, + "30": + { + "physic":"0" + }, + "31": + { + "physic":"0" + }, + "32": + { + "physic":"0" + }, + "33": + { + "physic":"0" + }, + "34": + { + "physic":"0" + }, + "35": + { + "physic":"0" + }, + "36": + { + "physic":"0" + }, + "37": + { + "physic":"0" + }, + "38": + { + "physic":"0" + }, + "39": + { + "physic":"0" + }, + "4": + { + "physic":"0" + }, + "40": + { + "physic":"0" + }, + "41": + { + "physic":"0" + }, + "42": + { + "physic":"0" + }, + "43": + { + "physic":"0" + }, + "44": + { + "physic":"0" + }, + "5": + { + "physic":"0" + }, + "6": + { + "physic":"0" + }, + "62": + { + "speType":"canCross" + }, + "7": + { + "physic":"0" + }, + "8": + { + "physic":"0" + }, + "9": + { + "physic":"0" + } + }, + "tilewidth":32 + }], + "tilewidth":32, + "version":1, + "width":27 +}+ \ No newline at end of file diff --git a/Maps/mapCastle_small7.json b/Maps/mapCastle_small7.json @@ -0,0 +1,191 @@ +{ "height":16, + "layers":[ + { + "data":[57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 1, 2, 3, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 1, 2, 3, 57, 57, 57, 40, 40, 40, 10, 11, 12, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 10, 11, 12, 40, 40, 40, 40, 40, 40, 19, 20, 21, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 19, 20, 21, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57], + "height":16, + "name":"Calque de Tile 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, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 2", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }], + "nextobjectid":1, + "orientation":"orthogonal", + "properties": + { + "doorDown":"1", + "doorLeft":"1", + "doorRight":"1", + "doorUp":"1" + }, + "renderorder":"right-down", + "tileheight":32, + "tilesets":[ + { + "firstgid":1, + "image":"Resources\/Images\/castle_1.png", + "imageheight":640, + "imagewidth":288, + "margin":0, + "name":"castle", + "properties": + { + + }, + "spacing":0, + "tileheight":32, + "tileproperties": + { + "0": + { + "physic":"0" + }, + "1": + { + "physic":"0" + }, + "10": + { + "physic":"0" + }, + "11": + { + "physic":"0" + }, + "12": + { + "physic":"0" + }, + "13": + { + "physic":"0" + }, + "14": + { + "physic":"0" + }, + "15": + { + "physic":"0" + }, + "16": + { + "physic":"0" + }, + "17": + { + "physic":"0" + }, + "18": + { + "physic":"0" + }, + "19": + { + "physic":"0" + }, + "2": + { + "physic":"0" + }, + "20": + { + "physic":"0" + }, + "21": + { + "physic":"0" + }, + "22": + { + "physic":"0" + }, + "23": + { + "physic":"0" + }, + "24": + { + "physic":"0" + }, + "25": + { + "physic":"0" + }, + "26": + { + "physic":"0" + }, + "27": + { + "physic":"0" + }, + "3": + { + "physic":"0" + }, + "36": + { + "physic":"0" + }, + "39": + { + "physic":"0" + }, + "4": + { + "physic":"0" + }, + "5": + { + "physic":"0" + }, + "6": + { + "physic":"0" + }, + "60": + { + "physic":"0" + }, + "62": + { + "hitbox":"upperTierHitbox", + "speType":"canCross" + }, + "69": + { + "physic":"0" + }, + "7": + { + "physic":"0" + }, + "8": + { + "physic":"0" + }, + "9": + { + "physic":"0" + } + }, + "tilewidth":32 + }], + "tilewidth":32, + "version":1, + "width":27 +}+ \ No newline at end of file diff --git a/Maps/mapCastle_small8.json b/Maps/mapCastle_small8.json @@ -0,0 +1,173 @@ +{ "height":16, + "layers":[ + { + "data":[57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 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, 66, 40, 40, 40, 40, 40, 40, 66, 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, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 55, 40, 40, 40, 40, 40, 40, 66, 40, 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, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 51, 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, 50, 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, 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, 66, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 66, 40, 40, 55, 65, 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, 64], + "height":16, + "name":"Calque de Tile 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, 1, 2, 3, 0, 0, 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 7, 8, 9, 0, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 13, 14, 15, 0, 0, 0, 0, 0, 0, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 0], + "height":16, + "name":"Calque 2", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }], + "nextobjectid":1, + "orientation":"orthogonal", + "properties": + { + "door_left":"1", + "door_right":"1", + "door_up":"1" + }, + "renderorder":"right-down", + "tileheight":32, + "tilesets":[ + { + "firstgid":1, + "image":"Resources\/Images\/castel.png", + "imageheight":640, + "imagewidth":288, + "margin":0, + "name":"castel", + "properties": + { + + }, + "spacing":0, + "tileheight":32, + "tileproperties": + { + "0": + { + "physic":"0" + }, + "1": + { + "physic":"0" + }, + "10": + { + "physic":"0" + }, + "11": + { + "physic":"0" + }, + "12": + { + "physic":"0" + }, + "13": + { + "physic":"0" + }, + "14": + { + "physic":"0" + }, + "15": + { + "physic":"0" + }, + "16": + { + "physic":"0" + }, + "17": + { + "physic":"0" + }, + "18": + { + "physic":"0" + }, + "19": + { + "physic":"0" + }, + "2": + { + "physic":"0" + }, + "20": + { + "physic":"0" + }, + "21": + { + "physic":"0" + }, + "22": + { + "physic":"0" + }, + "23": + { + "physic":"0" + }, + "24": + { + "physic":"0" + }, + "25": + { + "physic":"0" + }, + "26": + { + "physic":"0" + }, + "3": + { + "physic":"0" + }, + "39": + { + "physic":"0" + }, + "4": + { + "physic":"0" + }, + "5": + { + "physic":"0" + }, + "6": + { + "physic":"0" + }, + "62": + { + "speType":"canCross" + }, + "7": + { + "physic":"0" + }, + "8": + { + "physic":"0" + }, + "9": + { + "physic":"0" + } + }, + "tilewidth":32 + }], + "tilewidth":32, + "version":1, + "width":27 +}+ \ No newline at end of file diff --git a/Maps/mapCastle_small9.json b/Maps/mapCastle_small9.json @@ -0,0 +1,239 @@ +{ "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, 50, 49, 49, 49, 49, 49, 49, 51, 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, 66, 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, 66, 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, 66, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 66, 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, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 40, 40, 40, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57], + "height":16, + "name":"Calque de Tile 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, 28, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":16, + "name":"Calque 2", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":27, + "x":0, + "y":0 + }], + "nextobjectid":1, + "orientation":"orthogonal", + "properties": + { + "door_down":"1" + }, + "renderorder":"right-down", + "tileheight":32, + "tilesets":[ + { + "firstgid":1, + "image":"Resources\/Images\/castel.png", + "imageheight":640, + "imagewidth":288, + "margin":0, + "name":"castel", + "properties": + { + + }, + "spacing":0, + "tileheight":32, + "tileproperties": + { + "0": + { + "physic":"0" + }, + "1": + { + "physic":"0" + }, + "10": + { + "physic":"0" + }, + "11": + { + "physic":"0" + }, + "12": + { + "physic":"0" + }, + "13": + { + "physic":"0" + }, + "14": + { + "physic":"0" + }, + "15": + { + "physic":"0" + }, + "16": + { + "physic":"0" + }, + "17": + { + "physic":"0" + }, + "18": + { + "physic":"0" + }, + "19": + { + "physic":"0" + }, + "2": + { + "physic":"0" + }, + "20": + { + "physic":"0" + }, + "21": + { + "physic":"0" + }, + "22": + { + "physic":"0" + }, + "23": + { + "physic":"0" + }, + "24": + { + "physic":"0" + }, + "25": + { + "physic":"0" + }, + "26": + { + "physic":"0" + }, + "27": + { + "physic":"0" + }, + "28": + { + "physic":"0" + }, + "29": + { + "physic":"0" + }, + "3": + { + "physic":"0" + }, + "30": + { + "physic":"0" + }, + "31": + { + "physic":"0" + }, + "32": + { + "physic":"0" + }, + "33": + { + "physic":"0" + }, + "34": + { + "physic":"0" + }, + "35": + { + "physic":"0" + }, + "36": + { + "physic":"0" + }, + "37": + { + "physic":"0" + }, + "38": + { + "physic":"0" + }, + "39": + { + "physic":"0" + }, + "4": + { + "physic":"0" + }, + "40": + { + "physic":"0" + }, + "41": + { + "physic":"0" + }, + "42": + { + "physic":"0" + }, + "43": + { + "physic":"0" + }, + "44": + { + "physic":"0" + }, + "5": + { + "physic":"0" + }, + "6": + { + "physic":"0" + }, + "62": + { + "speType":"canCross" + }, + "7": + { + "physic":"0" + }, + "8": + { + "physic":"0" + }, + "9": + { + "physic":"0" + } + }, + "tilewidth":32 + }], + "tilewidth":32, + "version":1, + "width":27 +}+ \ No newline at end of file diff --git a/README.md b/README.md @@ -1,5 +1,5 @@ # Rogue-Like -[![Build Status](https://travis-ci.org/Ne02ptzero/Grog-Like.svg?branch=master)](https://travis-ci.org/Ne02ptzero/Grog-Like) +[![Build Status](https://travis-ci.org/Ne02ptzero/Grog-Like.svg?branch=build)](https://travis-ci.org/Ne02ptzero/Grog-Like) ![Language](https://img.shields.io/badge/language-c%2B%2B-orange.svg) [![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) diff --git a/Resources/Elements/Armors/ChestArmor.json b/Resources/Elements/Armors/ChestArmor.json @@ -4,10 +4,10 @@ "flavor": "Hey look, its a ARMOR. A pretty shitty one actually...", "lvlRequired": 1, "sprites": "Resources/Images/Armors/ChestArmor.png", - "lootLevel": 1, - "bonus": { - "type": "hp_buff", - "amount": 50 - } + "lootLevel": 1 + }, + "bonus": { + "hpBuff": 25, + "manaBuff": 0 } } diff --git a/Resources/Elements/Armors/Robes.json b/Resources/Elements/Armors/Robes.json @@ -4,7 +4,10 @@ "flavor": "Hey look, its a ARMOR. A pretty shitty one actually...", "lvlRequired": 1, "sprites": "Resources/Images/Armors/Robes.png", - "lootLevel": 2, - "bonus": {} - } + "lootLevel": 2 + }, + "bonus": { + "hpBuff": 45, + "manaBuff": 90 + } } diff --git a/Resources/Elements/Enemies/Enemy.json b/Resources/Elements/Enemies/Enemy.json @@ -27,7 +27,7 @@ "loot": { "consumableRate": 50, "equipmentRate": 25, - "HPReward": 50, + "HPReward": 25, "XPReward": 20, "EqReward": 1 }, diff --git a/Resources/Elements/Enemies/Enemy2.json b/Resources/Elements/Enemies/Enemy2.json @@ -27,7 +27,7 @@ "loot": { "consumableRate": 50, "equipmentRate": 25, - "HPReward": 50, + "HPReward": 25, "XPReward": 20, "EqReward": 2 }, @@ -37,6 +37,19 @@ "endFrame": 5, "size": 2, "time": 0.1 - } + }, + "forward": { + "beginFrame": 0, + "endFrame": 6, + "time": 0.05, + "force": 3 + }, + "backward": { + "beginFrame": 0, + "endFrame": 6, + "time": 0.05, + "force": 3 + } + } } diff --git a/Resources/Elements/Hero.json b/Resources/Elements/Hero.json @@ -2,7 +2,10 @@ "infos": { "name": "Hero", "id": 0, - "HP": 125, + "HP": 75, + "maxHP": 75, + "mana": 80, + "maxMana": 100, "sprites": "Resources/Images/Hero/hero_000.png", "size": 1.3, "maxSpeed": 5, @@ -56,6 +59,23 @@ "endFrame_down": 60, "time": 0.1 }, + "loadAttack_charge": { + "beginFrame_right": 64, + "holdFrame_right": 65, + "endFrame_right": 66, + "beginFrame_left": 69, + "holdFrame_left": 70, + "endFrame_left": 71, + "time": 0.1 + }, + "loadAttack_done": { + "beginFrame_right": 66, + "endFrame_right": 68, + "beginFrame_left": 71, + "endFrame_left": 73, + + "time": 0.1 + }, "down": { "subscribe": "down" }, diff --git a/Resources/Images/HUD/empty_heart.png b/Resources/Images/HUD/empty_heart.png Binary files differ. diff --git a/Resources/Images/HUD/minimap_background.png b/Resources/Images/HUD/minimap_background.png Binary files differ. diff --git a/Resources/Images/HUD/map_bar_empty_end.png b/Resources/Images/HUD/mp_bar_empty_end.png Binary files differ. diff --git a/Resources/Images/HUD/talk.png b/Resources/Images/HUD/talk.png Binary files differ. diff --git a/Resources/Images/Hero/hero_064.png b/Resources/Images/Hero/hero_064.png Binary files differ. diff --git a/Resources/Images/Hero/hero_065.png b/Resources/Images/Hero/hero_065.png Binary files differ. diff --git a/Resources/Images/Hero/hero_066.png b/Resources/Images/Hero/hero_066.png Binary files differ. diff --git a/Resources/Images/Hero/hero_067.png b/Resources/Images/Hero/hero_067.png Binary files differ. diff --git a/Resources/Images/Hero/hero_068.png b/Resources/Images/Hero/hero_068.png Binary files differ. diff --git a/Resources/Images/Hero/hero_069.png b/Resources/Images/Hero/hero_069.png Binary files differ. diff --git a/Resources/Images/Hero/hero_070.png b/Resources/Images/Hero/hero_070.png Binary files differ. diff --git a/Resources/Images/Hero/hero_071.png b/Resources/Images/Hero/hero_071.png Binary files differ. diff --git a/Resources/Images/Hero/hero_072.png b/Resources/Images/Hero/hero_072.png Binary files differ. diff --git a/Resources/Images/Hero/hero_073.png b/Resources/Images/Hero/hero_073.png Binary files differ. diff --git a/Resources/Images/bag.png b/Resources/Images/bag.png Binary files differ. diff --git a/Resources/Images/bag_slot.png b/Resources/Images/bag_slot.png Binary files differ. diff --git a/Resources/Images/castel.png b/Resources/Images/castel.png Binary files differ. diff --git a/Resources/Images/castle_1.png b/Resources/Images/castle_1.png Binary files differ. diff --git a/Resources/Images/mana.png b/Resources/Images/mana.png Binary files differ. diff --git a/Resources/Images/round.png b/Resources/Images/round.png Binary files differ. diff --git a/Sources/inc/Armor.hpp b/Sources/inc/Armor.hpp @@ -47,7 +47,6 @@ public: void EndContact(Elements *elem, b2Contact *contact); void ReceiveMessage(Message *m); - Bonus *getBonus(void); std::string getName(void); std::string getType(void); std::string getFlavor(void); @@ -65,7 +64,6 @@ private: std::string _sprite; int _lootLevel; int _hp; - Bonus *_bonus; void _readFile(std::string name); void _parseJson(std::string file); diff --git a/Sources/inc/ArmorList.hpp b/Sources/inc/ArmorList.hpp @@ -52,6 +52,7 @@ public: ~ArmorList(void); void statArmor(std::string); + int checkExists(std::string); Armor* getArmor(std::string); Armor* getArmorRandom(void); Armor* getArmorRandom(int level); diff --git a/Sources/inc/Bonus.hpp b/Sources/inc/Bonus.hpp @@ -1,52 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * File: Bonus.hpp - * Creation: 2015-05-20 12:48 - * Manon Budin <mbudin@student.42.fr> - */ - - #include <iostream> - - class Bonus - { - public: - - enum BonusType - { - NONE, - HP_BUFF, - MANA_BUFF, - SPEED_BUFF - }; - - Bonus(BonusType type, float amount); - ~Bonus(void); - - float getAmount(); - BonusType getType(); - static BonusType parseType(std::string); - -private: - BonusType _type; - float _buffAmount; - - - };- \ No newline at end of file diff --git a/Sources/inc/Characters.hpp b/Sources/inc/Characters.hpp @@ -26,10 +26,13 @@ #ifndef __Characters__ # define __Characters__ +# include "Inventory.hpp" # include "Weapon.hpp" # include "Armor.hpp" # include "Ring.hpp" # include "Log.hpp" + +class Inventory; class Weapon; class Armor; class Ring; @@ -50,6 +53,8 @@ class Characters : public Elements { public: friend class Game; + friend class Pattern; + friend class PassivePattern; enum Orientation { UP, @@ -70,10 +75,15 @@ class Characters : public Elements { std::string getLastAction(void); int getGold(void); int getHP(void); - void setHP(int h); + void setHP(int hp); + int getMana(void); + void setMana(int mana); + int getMaxMana(void); + int getMaxHP(void); Weapon *getWeapon(void); Armor *getArmor(void); Ring *getRing(void); + // Virtual function, overwritten in childs virtual void actionCallback(std::string name, int status) {}; virtual void equipWeapon(Weapon* weapon); @@ -101,13 +111,19 @@ class Characters : public Elements { int _hp; int _gold; int _maxHp; + int _mana; + int _maxMana; bool _canMove; bool _canJump; bool _invincibility; + bool _attackPressed; + int _isLoadingAttack; + bool _fullChargedAttack; Weapon* _weapon; Armor* _armor; Ring* _ring; Elements* _item; + Inventory* _inventory; Characters::Orientation _orientation; Characters::Orientation _latOrientation; std::list<Elements*> _grounds; @@ -127,6 +143,7 @@ class Characters : public Elements { virtual void _pickupItem(int status); virtual void _run(void); void _destroyEnemy(void); + Elements* getItem(void); private: std::map<std::string, std::map<std::string, Json::Value> > _attr; diff --git a/Sources/inc/Elements.hpp b/Sources/inc/Elements.hpp @@ -31,7 +31,7 @@ # include <string> # include <list> # include "../../Angel/Angel.h" -# include "Bonus.hpp" + class Weapon; @@ -45,6 +45,8 @@ public: void setXStart(float X); void setYStart(float Y); + int getXStart(void); + int getYStart(void); void setWidth(int w); void setHeight(int h); void setCutWidth(int w); @@ -69,6 +71,7 @@ public: int getOrientationY(void); int getLateralOrientation(void); bool isDead(void); + int isAdded(void); protected: @@ -91,6 +94,7 @@ private: int _width; int _cutHeight; int _cutWidth; + int _isAdded; int _frame; std::list<Animation *> _animationList; std::list<Animation *>::iterator _animIt; diff --git a/Sources/inc/Enemy.hpp b/Sources/inc/Enemy.hpp @@ -29,6 +29,9 @@ # include "Characters.hpp" # include "Loot.hpp" +# include "Map.hpp" +# include "Pattern.hpp" +# include "PassivePattern.hpp" class Enemy : public Characters { public: @@ -40,11 +43,20 @@ public: void actionCallback(std::string name, int status); void init(void); void BeginContact(Elements* m, b2Contact* contact); + void EndContact(Elements *m, b2Contact *contact); bool toBeDeleted(void); + void setMap(Map *m); + Map *getMap(void); + void setPattern(CPattern *p); + CPattern *getPattern(void); + bool dead(void); protected: + int _isTakingDamage; bool isDead; - + Map *_map; + CPattern *_pattern; + int _lastElement; }; #endif diff --git a/Sources/inc/Game.hpp b/Sources/inc/Game.hpp @@ -47,6 +47,7 @@ class Characters; # include "ArmorList.hpp" # include "RingList.hpp" # include "LevelGenerator.hpp" +# include "Tooltip.hpp" class ArmorList; class EnemyList; @@ -71,9 +72,10 @@ class Game { void displayObject(Elements & Object); void showMap(void); void displayHUD(void); - void setHero(Characters &h); + void setHero(Characters *h); void moveCamera(void); - Characters &getHero(void); + void simulateHeroItemContact(void); + Characters *getHero(void); static bool endGame; static bool ended; @@ -99,6 +101,7 @@ class Game { Maps *maps; std::vector<Room*> *gameMap; + Tooltip *tooltip; static int currentIds; static std::map<int, Elements *> elementMap; static std::list<Elements *> bodiesToDestroy; @@ -117,12 +120,13 @@ class Game { static int currentY; static int minY; static int started; + static int cameraTick; private: float beginXHero; float beginYHero; std::vector<std::vector<int> > _tmpMap; - Characters &_hero; + Characters *_hero; }; #endif diff --git a/Sources/inc/HUDWindow.hpp b/Sources/inc/HUDWindow.hpp @@ -29,6 +29,7 @@ # include "../../Angel/Angel.h" # include "Game.hpp" +# include "Map.hpp" class Game; class Ring; class Armor; @@ -40,7 +41,7 @@ class HUDWindow : public HUDActor { public: class Text { - public: + public: Text() {}; ~Text() {}; std::string str; @@ -51,6 +52,9 @@ class HUDWindow : public HUDActor { int colorG; int colorB; int colorA; + Characters *toFollow; + int isFading; + int isTalk; }; HUDWindow(void); @@ -59,11 +63,13 @@ class HUDWindow : public HUDActor { 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, int alpha, std::string font); + HUDWindow::Text *setText(std::string str, Characters *toFollow, Vector3 color, int isFading, int isTalk); void removeText(std::string str); void removeText(HUDWindow::Text *t); void displayText(void); - void addImage(std::string p, int x, int y); - void addImage(std::string path, int x, int y, float size); + HUDActor *addImage(std::string p, int x, int y); + HUDActor *addImage(std::string path, int x, int y, float size); + HUDActor *addImage(std::string path, int x, int y, float size, int layer); void life(int l); void mana(int mana); void gold(int g); @@ -73,16 +79,27 @@ class HUDWindow : public HUDActor { void items(Ring *r); void armor(void); void boots(void); - void consumable(void); + void consumable(std::map<int, std::string> m); void minimap(void); void setGame(Game *); + void setMaxMana(int m); + void setMaxHP(int h); + void bag(void); + void initMinimapBackground(void); private: Game *_g; std::list<HUDActor *> _hearts; std::list<HUDActor *> _mana; + std::list<HUDActor *> _bag; + std::list<HUDActor *> _minimap; + std::map<std::string, Elements*> _dialog; std::list<HUDWindow::Text *> _text; HUDWindow::Text * _gold; + int _maxMana; + int _maxHP; + + void _drawDoor(Vector2 size, Vector2 position); }; #endif diff --git a/Sources/inc/Inventory.hpp b/Sources/inc/Inventory.hpp @@ -0,0 +1,57 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * File: Inventory.hpp + * Creation: 2015-05-27 04:44 + * Vincent Rey <vrey@student.42.fr> + */ + +#ifndef __Inventory__ +# define __Inventory__ + +# include "Log.hpp" +# include "Elements.hpp" +# ifdef __APPLE__ +# include "../../Tools/jsoncpp/include/json/json.h" +# else +# include "json/json.h" +# endif + +class Inventory { + +public: + Inventory(int slots); + + void changeItemFocus(void); + std::string getCurrentFocus(void); + int addItemToInventory(std::string item); + std::string dropSelectedItem(void); + std::string equipSelectedItem(void); + void swapEquipmentAndInventory(std::string item); + std::map<int, std::string> getItems(void); + +private: + int _slots; + int _focused; + int _inInventory; + std::map<int, std::string> _items; +}; + +#endif diff --git a/Sources/inc/LevelGenerator.hpp b/Sources/inc/LevelGenerator.hpp @@ -39,21 +39,25 @@ public: LevelGenerator(int maxMapSize, int minPathLenght, int doorsPopRate); ~LevelGenerator(); - void print(); - void execute(); //execute generation process - void createFirstRoom(); - void firstPass(int distance); //generate base rooms - void generateRoomsBehindDoors(Room* room); - Room* generateRoom(int x, int y, int distance, Room* prevRoom, int origin); + void print(void); + void execute(void); //execute generation process + void createFirstRoom(void); + void firstPass(int distance); //generate base rooms + void generateRoomsBehindDoors(Room* room); + Room* generateRoom(int x, int y, int distance, Room* prevRoom, int origin); + bool testDoor(int x, int y); + bool testRoom(int x, int y); + void linkAdjacentRooms(Room *room); + void shockwave(void); + int getEntryId(void); + int id(void); + std::vector<std::vector<int> > getLevel(void); + std::vector<Room*> *_rooms; + int getStartX(); + int getStartY(); + int getNbMaps(); - bool testDoor(int x, int y); - bool testRoom(int x, int y); - void linkAdjacentRooms(Room *room); - void shockwave(); - int getEntryId(); - int id(); - std::vector<Room*> *_rooms; private: int _id; @@ -63,9 +67,9 @@ private: int _minPathLenght; int _maxMapSize; int _doorsPopRate; + int _startX; + int _startY; - - LevelGenerator(); }; #endif diff --git a/Sources/inc/Loot.hpp b/Sources/inc/Loot.hpp @@ -29,12 +29,16 @@ # include "Characters.hpp" # include "Object.hpp" -class Equipment; +class Ring; +class Weapon; +class Armor; class Loot { public: Loot(Characters *c); - Loot(Characters *c, Equipment* toDrop); + Loot(Characters *c, Weapon* toDrop); + Loot(Characters *c, Armor* toDrop); + Loot(Characters *c, Ring* toDrop); ~Loot(void); private: Loot(void); diff --git a/Sources/inc/Map.hpp b/Sources/inc/Map.hpp @@ -29,6 +29,7 @@ # include <vector> # include <list> # include <iostream> +class Enemy; # include "Game.hpp" # ifdef __APPLE__ @@ -53,7 +54,7 @@ class Map { void setTileWidth(int w); void setImageHeight(int h); void setImageWidth(int w); - void addElement(Elements *e); + void addElement(Elements * e); void addMapElement(int n); void setMap(std::vector<int> map); void setProperties(std::map<int, std::map<std::string, Json::Value> > p); @@ -61,13 +62,18 @@ class Map { void setXStart(int x); void setYStart(int y); void setUsed(int n); - void display(void); + Map display(void); int getHeight(void); int getWidth(void); int getXMid(void); int getYMid(void); int getXStart(void); int getYStart(void); + int getIsUsed(void); + void destroyMap(void); + std::list<Enemy *> getEnemies(void); + std::vector<std::vector<int> > getPhysicMap(void); + void callAllPatterns(void); private: int _mapCount; @@ -86,8 +92,10 @@ class Map { int _xStart; int _yStart; int _isUsed; - std::list<Elements *> _elems; + std::list<Elements *> _elemOfTheMap; + std::list<Enemy *> _enemies; std::map<int, std::map<std::string, Json::Value> > _properties; + std::vector<std::vector<int> > _physicMap; }; #endif diff --git a/Sources/inc/Maps.hpp b/Sources/inc/Maps.hpp @@ -55,7 +55,8 @@ class Maps { std::map<int, Map *> _maps; Map *getMapByDoor(int n); void displayLevel(std::vector<std::vector<int> > map); - std::vector<std::map<int, Map *> > getMapXY(void); + std::vector<std::vector<Map> > getMapXY(void); + std::vector<std::vector<Map> > _XYMap; private: void _getMap(void); @@ -64,7 +65,6 @@ class Maps { Json::Value _root; Json::Reader _reader; std::map<int, std::list<Map *> > _mapByDoor; - std::vector<std::map<int, Map *> > _XYMap; }; # include "Elements.hpp" diff --git a/Sources/inc/PassivePattern.hpp b/Sources/inc/PassivePattern.hpp @@ -0,0 +1,41 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * File: PassivePattern.cpp + * Creation: 2015-05-03 10:25 + * Louis Solofrizzo <louis@ne02ptzero.me> + */ + +#ifndef __PassivePattern__ +# define __PassivePattern__ +# include "Pattern.hpp" +# include "Map.hpp" + +class PassivePattern : public CPattern { + public: + PassivePattern(void); + ~PassivePattern(void); + + virtual void tick(Map m); + + private: + int _tickNumber; +}; +#endif diff --git a/Sources/inc/Pattern.hpp b/Sources/inc/Pattern.hpp @@ -0,0 +1,55 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * File: Pattern.cpp + * Creation: 2015-05-03 10:22 + * Louis Solofrizzo <louis@ne02ptzero.me> + */ + +#ifndef __Pattern__ +# define __Pattern__ +# include <iostream> +class Enemy; +class Map; + +class CPattern { + public: + CPattern(void); + CPattern(std::string name); + CPattern(CPattern & p); + ~CPattern(void); + + virtual void tick(Map m); + void setEnemy(Enemy *); + std::string getName(void); + Enemy *getEnemy(void); + + protected: + std::string _name; + Enemy *_enemy; + int _x; + int _y; + int _orientation; +}; + +# include "Enemy.hpp" +# include "Map.hpp" + +#endif diff --git a/Sources/inc/Ring.hpp b/Sources/inc/Ring.hpp @@ -47,7 +47,6 @@ public: void EndContact(Elements *elem, b2Contact *contact); void ReceiveMessage(Message *m); - Bonus *getBonus(void); std::string getName(void); std::string getType(void); std::string getFlavor(void); @@ -62,7 +61,6 @@ private: std::string _flavor; std::string _sprite; int _lootLevel; - Bonus *_bonus; void _readFile(std::string name); void _parseJson(std::string file); diff --git a/Sources/inc/RingList.hpp b/Sources/inc/RingList.hpp @@ -50,6 +50,7 @@ public: ~RingList(void); void statRing(std::string); + int checkExists(std::string); Ring* getRing(std::string); Ring* getRingRandom(void); Ring* getRingRandom(int level); diff --git a/Sources/inc/Room.hpp b/Sources/inc/Room.hpp @@ -25,6 +25,7 @@ #ifndef __Room__ # define __Room__ +# include <iostream> enum DepthType { CEIL, STD, FLOOR }; @@ -51,6 +52,7 @@ public: Room* getLeftRoom() const; Room* getBottomRoom() const; Room* getRightRoom() const; + void closeDoor(void); void addLink(); diff --git a/Sources/inc/Tooltip.hpp b/Sources/inc/Tooltip.hpp @@ -0,0 +1,63 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * File: Tooltip.hpp + * Creation: 2015-06-03 14:59 + * Manon Budin <mbudin@student.42.fr> + */ + +#ifndef __Tooltip__ +# define __Tooltip__ + +# include "Log.hpp" +# include "../../Angel/Angel.h" + +class Characters; +class Elements; + + +# ifdef __APPLE__ +# include "../../Tools/jsoncpp/include/json/json.h" +# else +# include "json/json.h" +# endif + + +class Tooltip : public MessageListener { + public: + Tooltip(); + ~Tooltip(); + + void tip(Elements *elem, Characters *c); + void info(Elements *elem); + void clearInfo(void); + void ReceiveMessage(Message *m); + + + private: + HUDActor *_equip; + std::string _name; + std::string _val; +}; + + +# include "Characters.hpp" + +#endif+ \ No newline at end of file diff --git a/Sources/inc/WeaponList.hpp b/Sources/inc/WeaponList.hpp @@ -50,6 +50,7 @@ public: ~WeaponList(void); void statWeapon(std::string); + int checkExists(std::string); Weapon* getWeapon(std::string); Weapon* getWeaponRandom(void); Weapon* getWeaponRandom(int level); diff --git a/Sources/src/Armor.cpp b/Sources/src/Armor.cpp @@ -43,10 +43,14 @@ Armor::Armor(std::string name) : _name(name) { Armor::Armor(Armor* Armor) { this->_name = Armor->getName(); this->addAttribute("type3", "Armor"); + this->addAttribute("name", this->_name); this->_flavor = Armor->getFlavor(); this->_sprite = Armor->getSprite(); this->_lootLevel = Armor->getLootLevel(); - this->_bonus = Armor->getBonus(); + if (Armor->getAttribute("hpBuff") != "") + this->addAttribute("hpBuff", Armor->getAttribute("hpBuff")); + if (Armor->getAttribute("manaBuff") != "") + this->addAttribute("manaBuff", Armor->getAttribute("manaBuff")); } @@ -94,11 +98,8 @@ void Armor::_parseJson(std::string file) { this->_flavor = json["infos"].get("flavor", "").asString(); this->_lootLevel = json["infos"].get("lootLevel", "").asInt(); this->_sprite = json["infos"].get("sprites", "").asString(); - if (!json["infos"].get("bonus", "").empty()){ - this->_bonus = new Bonus(Bonus::parseType(json["infos"].get("bonus", "").get("type", "none").asString()), json["infos"].get("bonus", "").get("amount", 0).asInt()); - } else { - this->_bonus = nullptr; - } + for (i = json["bonus"].begin(); i != json["bonus"].end(); i++) + this->addAttribute( i.key().asString(), (*i).asString()); this->addAttribute("type3", "Armor"); } @@ -126,7 +127,6 @@ void Armor::ReceiveMessage(Message *m) { } /* GETTERS */ -Bonus* Armor::getBonus(void) { return this->_bonus; } std::string Armor::getName(void) { return this->_name; } std::string Armor::getFlavor(void) { return this->_flavor; } std::string Armor::getSprite(void) { return this->_sprite; } diff --git a/Sources/src/ArmorList.cpp b/Sources/src/ArmorList.cpp @@ -54,6 +54,17 @@ ArmorList::~ArmorList(void) { return; } +int ArmorList::checkExists(std::string name) { + std::list<Armor*>::iterator it; + + for (it = this->_allArmors.begin(); it != this->_allArmors.end(); it++) { + if (name == (*it)->getName()) { + return 1; + } + } + return 0; +} + //! Returns a Armor in order to use it afterwards /** * Get a Armor obj by name diff --git a/Sources/src/Bonus.cpp b/Sources/src/Bonus.cpp @@ -1,52 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * File: Bonus.cpp - * Creation: 2015-05-20 12:49 - * Manon Budin <mbudin@student.42.fr> - */ - - #include "Bonus.hpp" - - Bonus::Bonus(BonusType type, float buffAmount) : _type(type), _buffAmount(buffAmount) { - return; - } - - Bonus::~Bonus(void) { - return; - } - -Bonus::BonusType Bonus::parseType(std::string type) -{ - if (type == "hp_buff") { - return BonusType::HP_BUFF; - } else if (type == "mana_buff") { - return BonusType::MANA_BUFF; - } else if (type == "speed_buff") { - return BonusType::SPEED_BUFF; - } - return BonusType::NONE; -} - -/* GETTERS */ - -float Bonus::getAmount(void) { return this->_buffAmount; } -Bonus::BonusType Bonus::getType(void) { return this->_type; } - diff --git a/Sources/src/Characters.cpp b/Sources/src/Characters.cpp @@ -24,6 +24,7 @@ */ # include "Characters.hpp" +#include <cstdlib> //! Base constructor Characters::Characters(void) { @@ -34,6 +35,7 @@ Characters::Characters(void) { /** * Setting base physic, some attributes and some intern variables * @param name The name of the character (Enemy, Hero, etc ...) + * @todo gotta parse the right number of slots from json for inventory */ Characters::Characters(std::string name) : _name(name), _isRunning(0), _isJump(0) { this->addAttribute("physic", "1"); @@ -46,12 +48,14 @@ Characters::Characters(std::string name) : _name(name), _isRunning(0), _isJump(0 this->_readFile(name); this->_canMove = true; this->_canJump = true; + this->_inventory = new Inventory(3); this->_invincibility = false; this->_grounds.clear(); this->_walls.clear(); this->_item = nullptr; this->_isAttacking = 0; this->_gold = 0; + this->_isLoadingAttack = 0; this->SetLayer(100); } @@ -76,7 +80,7 @@ void Characters::_readFile(std::string name) { fd.open(file.c_str()); if (!fd.is_open()) Log::error("Can't open the file for the " + - name + " class. (Supposed path is Resources/Elements/" + name +".json)"); + name + " class. (Supposed path is Resources/Elements/" + name +".json)"); buffer << fd.rdbuf(); this->_parseJson(buffer.str()); } @@ -106,7 +110,12 @@ void Characters::_parseJson(std::string file) { this->_size = json["infos"].get("size", "").asFloat(); this->_maxSpeed = json["infos"].get("maxSpeed", "").asFloat(); this->_hp = json["infos"].get("HP", "").asInt(); - this->_maxHp = json["infos"].get("HP", "").asInt(); + if (json["infos"].get("maxHP", "").isConvertibleTo(Json::ValueType::intValue)) + this->_maxHp = json["infos"].get("maxHP", "").asInt(); + if (json["infos"].get("mana", "").isConvertibleTo(Json::ValueType::intValue)) + this->_mana = json["infos"].get("mana", "").asInt(); + if (json["infos"].get("maxMana", "").isConvertibleTo(Json::ValueType::intValue)) + this->_maxMana = json["infos"].get("maxMana", "").asInt(); this->_hitboxType = json["infos"].get("hitboxType", "").asString(); this->_hitbox = json["infos"].get("hitbox", "").asString(); this->addAttribute("spritesFrame", json["infos"].get("sprites", "").asString()); @@ -183,11 +192,19 @@ void Characters::ReceiveMessage(Message *m) { int status; if (m->GetMessageName() == "canMove") { - if (this->getHP() > 0) { + if (this->getHP() > 0) { this->changeCanMove(); if (this->_grounds.size() > 0) - this->AnimCallback("base"); - } + this->AnimCallback("base"); + } + } + else if (m->GetMessageName() == "fullChargedAttack") { + this->_fullChargedAttack = true; + theSwitchboard.UnsubscribeFrom(this, "fullChargedAttack"); + } + else if (m->GetMessageName() == "startChargeAttack") { + this->_isLoadingAttack = 1; + theSwitchboard.UnsubscribeFrom(this, "startChargeAttack"); } else if (m->GetMessageName() == "endInvincibility") { theSwitchboard.UnsubscribeFrom(this, "colorDamageBlink1"); @@ -215,33 +232,19 @@ void Characters::ReceiveMessage(Message *m) { this->_weapon->attack(this); } else if (m->GetMessageName() == "disableAttackHitbox") { - this->_isAttacking = false; + this->_isAttacking = false; } else if (m->GetMessageName() == "moveHeroDown") { if (this->_latOrientation == RIGHT && this->_canMove && this->_isAttacking == false) this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, - this->_getAttr("jump", "fallingFrame_right").asInt(), - this->_getAttr("jump", "endFrame_right").asInt() - 3, "jump"); + this->_getAttr("jump", "fallingFrame_right").asInt(), + this->_getAttr("jump", "endFrame_right").asInt() - 3, "jump"); else if (this->_latOrientation == LEFT && this->_canMove && this->_isAttacking == false) this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, - this->_getAttr("jump", "fallingFrame_left").asInt(), - this->_getAttr("jump", "endFrame_left").asInt() - 3, "jump"); - } - else if (m->GetMessageName() == "startPathing" + this->GetName()) { - if (this->_grounds.size() > 0) { - if (this->_wallsLeft.size() > 0) - this->_orientation = RIGHT; - else if (this->_wallsRight.size() > 0) - this->_orientation = LEFT; - if (this->_orientation == RIGHT) - this->GetBody()->SetLinearVelocity(b2Vec2(5,0)); - if (this->_orientation == LEFT) - this->GetBody()->SetLinearVelocity(b2Vec2(-5,0)); - } - theSwitchboard.DeferredBroadcast(new Message("startPathing" + this->GetName()), 0.2f); - return; + this->_getAttr("jump", "fallingFrame_left").asInt(), + this->_getAttr("jump", "endFrame_left").asInt() - 3, "jump"); } - else if (m->GetMessageName() == "destroyEnemy") { + else if (m->GetMessageName() == "destroyEnemy") { new Loot(this); this->_destroyEnemy(); return; @@ -250,6 +253,30 @@ void Characters::ReceiveMessage(Message *m) { this->GetBody()->SetType(b2_staticBody); return; } + else if (m->GetMessageName() == "equipSelectedItem") { + std::string item; + + item = this->_inventory->equipSelectedItem(); + if (item != "") { + if (Game::wList->checkExists(item) == 1) { + Weapon* w = new Weapon(Game::wList->getWeapon(item)); + this->unequipWeapon(); + this->equipWeapon(w); + } else if (Game::aList->checkExists(item) == 1) { + Armor* w = new Armor(Game::aList->getArmor(item)); + this->unequipArmor(); + this->equipArmor(w); + } else if (Game::rList->checkExists(item) == 1) { + Ring* w = new Ring(Game::rList->getRing(item)); + this->unequipRing(); + this->equipRing(w); + } + Game::getHUD()->consumable(this->_inventory->getItems()); + } + } + else if (m->GetMessageName() == "cycleInventory") { + this->_inventory->changeItemFocus(); + } for (i = this->_attr.begin(); i != this->_attr.end(); i++) { attrName = this->_getAttr(i->first, "subscribe").asString(); if (!strncmp(attrName.c_str(), m->GetMessageName().c_str(), strlen(attrName.c_str()))) { @@ -290,30 +317,45 @@ void Characters::AnimCallback(String s) { this->_setCategory("breath"); if (s == "base") { this->_isAttacking = 0; - this->changeSizeTo(Vector2(1, 1)); - if (this->_isRunning == 0 && this->_isAttacking == 0) { + if (this->_isRunning == 0 && this->_isAttacking == 0 && this->_isLoadingAttack == 0) { + this->changeSizeTo(Vector2(1, 1)); if (this->_latOrientation == LEFT) { this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, - this->_getAttr("beginFrame_left").asInt(), - this->_getAttr("endFrame_left").asInt(), "base"); + this->_getAttr("beginFrame_left").asInt(), + this->_getAttr("endFrame_left").asInt(), "base"); } else if (this->_latOrientation == RIGHT) { this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, - this->_getAttr("beginFrame_right").asInt(), - this->_getAttr("endFrame_right").asInt(), "base"); - } else { + this->_getAttr("beginFrame_right").asInt(), + this->_getAttr("endFrame_right").asInt(), "base"); + } else { this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, - this->_getAttr("beginFrame_right").asInt(), - this->_getAttr("endFrame_right").asInt(), "base"); + this->_getAttr("beginFrame_right").asInt(), + this->_getAttr("endFrame_right").asInt(), "base"); } - } else { - if (this->_isRunning == 1) { - this->_setCategory("forward"); - } else if (this->_isRunning == 2) { - this->_setCategory("backward"); + } else if (this->_isAttacking == 0) { + if (this->_isLoadingAttack == 0) { + this->changeSizeTo(Vector2(1, 1)); + if (this->_isRunning == 1) { + this->_setCategory("forward"); + } else if (this->_isRunning == 2) { + this->_setCategory("backward"); + } + this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), + SAT_Loop, + this->_getAttr("beginFrame").asInt(), + this->_getAttr("endFrame").asInt()); + } else { + std::string orientation; + if (this->_latOrientation == RIGHT) { + orientation = "right"; + } else if (this->_latOrientation == LEFT) + orientation = "left"; + this->_setCategory("loadAttack_charge"); + this->changeSizeTo(Vector2(2, 2)); + this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, + this->_getAttr("endFrame_" + orientation).asInt(), + this->_getAttr("endFrame_" + orientation).asInt(), "loadAttack_charge"); } - this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_Loop, - this->_getAttr("beginFrame").asInt(), - this->_getAttr("endFrame").asInt()); } } } @@ -328,28 +370,34 @@ void Characters::AnimCallback(String s) { */ void Characters::BeginContact(Elements *elem, b2Contact *contact) { if (elem->getAttributes()["type"] == "ground") { - if (this->_isAttacking == 0) + if (this->_isAttacking == 0 && this->_isLoadingAttack == 0) this->changeSizeTo(Vector2(1, 1)); if (this->GetBody()->GetWorldCenter().y - 0.905 >= elem->GetBody()->GetWorldCenter().y) { - if (this->_grounds.size() > 0) + if (this->_grounds.size() > 0) { contact->SetEnabled(false); + } else { this->GetBody()->SetLinearVelocity(b2Vec2(0, this->GetBody()->GetLinearVelocity().y)); if (this->_hp <= 0) { - this->_heroDeath(); + this->_heroDeath(); return; } } if (this->_isJump > 0) { this->_isJump = 0; - if (this->_latOrientation == RIGHT && this->_isAttacking == false) - this->PlaySpriteAnimation(0.1f, SAT_OneShot, - this->_getAttr("jump", "endFrame_right").asInt() - 2, - this->_getAttr("jump", "endFrame_right").asInt(), "base"); - if (this->_latOrientation == LEFT && this->_isAttacking == false) - this->PlaySpriteAnimation(0.1f, SAT_OneShot, - this->_getAttr("jump", "endFrame_left").asInt() - 2, - this->_getAttr("jump", "endFrame_left").asInt(), "base"); + if (this->_latOrientation == RIGHT && this->_isAttacking == false && this->_isLoadingAttack == 0) { + this->changeSizeTo(Vector2(1, 1)); + this->PlaySpriteAnimation(0.1f, SAT_OneShot, + this->_getAttr("jump", "endFrame_right").asInt() - 2, + this->_getAttr("jump", "endFrame_right").asInt(), "base"); + } else if (this->_latOrientation == LEFT && + this->_isAttacking == false && + this->_isLoadingAttack == 0) { + this->changeSizeTo(Vector2(1, 1)); + this->PlaySpriteAnimation(0.1f, SAT_OneShot, + this->_getAttr("jump", "endFrame_left").asInt() - 2, + this->_getAttr("jump", "endFrame_left").asInt(), "base"); + } } this->_grounds.push_back(elem); } else if (this->GetBody()->GetWorldCenter().x >= elem->GetBody()->GetWorldCenter().x) { @@ -361,6 +409,17 @@ void Characters::BeginContact(Elements *elem, b2Contact *contact) { contact->SetEnabled(false); this->_wallsRight.push_back(elem); } + if (elem->getAttribute("speType") == "canCross") { + if (this->GetBody()->GetWorldCenter().y - 1 < + elem->GetBody()->GetWorldCenter().y) { + contact->SetEnabled(false); + contact->enableContact = false; + } + else if (this->getOrientation() == Characters::DOWN) { + contact->SetEnabled(false); + contact->enableContact = false; + } + } } } @@ -379,14 +438,17 @@ void Characters::EndContact(Elements *elem, b2Contact *contact) { this->_grounds.remove(elem); if (this->_grounds.size() == 0) { this->_isJump++; - if (this->_lastAction == "forward" && this->_canMove && this->_isAttacking == false) + if (this->_lastAction == "forward" && this->_canMove && this->_isAttacking == false && this->_isLoadingAttack == 0) { + this->changeSizeTo(Vector2(1, 1)); this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, - this->_getAttr("jump", "fallingFrame_right").asInt(), - this->_getAttr("jump", "endFrame_right").asInt() - 3, "jump"); - else if (this->_lastAction == "backward" && this->_canMove && this->_isAttacking == false) + this->_getAttr("jump", "fallingFrame_right").asInt(), + this->_getAttr("jump", "endFrame_right").asInt() - 3, "jump"); + } else if (this->_lastAction == "backward" && this->_canMove && this->_isAttacking == false && this->_isLoadingAttack == 0) { + this->changeSizeTo(Vector2(1, 1)); this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, - this->_getAttr("jump", "fallingFrame_left").asInt(), - this->_getAttr("jump", "endFrame_left").asInt() - 3, "jump"); + this->_getAttr("jump", "fallingFrame_left").asInt(), + this->_getAttr("jump", "endFrame_left").asInt() - 3, "jump"); + } } } else @@ -429,16 +491,22 @@ void Characters::_forward(int status) { this->_orientation = RIGHT; this->_latOrientation = RIGHT; if ((this->GetSpriteFrame() < this->_getAttr("beginFrame").asInt() || - (this->GetSpriteFrame() >= this->_getAttr("backward", "beginFrame").asInt() && - this->GetSpriteFrame() <= this->_getAttr("backward", "endFrame").asInt())) && !this->_isJump) + (this->GetSpriteFrame() >= this->_getAttr("backward", "beginFrame").asInt() && + this->GetSpriteFrame() <= this->_getAttr("backward", "endFrame").asInt())) && !this->_isJump) this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_Loop, - this->_getAttr("beginFrame").asInt(), this->_getAttr("endFrame").asInt()); + this->_getAttr("beginFrame").asInt(), this->_getAttr("endFrame").asInt()); else if (this->_isJump) { this->_setCategory("jump"); if (this->GetSpriteFrame() >= this->_getAttr("beginFrame_left").asInt() && this->GetSpriteFrame() <= this->_getAttr("endFrame_left").asInt()) this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, - this->GetSpriteFrame() - 8, - this->_getAttr("endFrame_right").asInt() - 3, "jump"); + this->GetSpriteFrame() - 8, + this->_getAttr("endFrame_right").asInt() - 3, "jump"); + this->_setCategory("forward"); + } else if (this->_isLoadingAttack) { + this->_setCategory("loadAttack_charge"); + this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, + this->_getAttr("endFrame_right").asInt(), + this->_getAttr("endFrame_right").asInt(), "loadAttack_charge"); this->_setCategory("forward"); } Game::startRunning(this); @@ -452,10 +520,8 @@ void Characters::_forward(int status) { if (!this->_isJump && !this->_isAttacking) this->AnimCallback("base"); } else { - if (this->GetBody()->GetLinearVelocity().x < this->_maxSpeed) { if (this->_wallsRight.size() == 0 && this->_canMove == true) this->GetBody()->SetLinearVelocity(b2Vec2(this->_getAttr("force").asFloat(), this->GetBody()->GetLinearVelocity().y)); - } } return ; } @@ -468,20 +534,26 @@ void Characters::_forward(int status) { * @sa Characters::_forward */ void Characters::_backward(int status) { - this->_setCategory("backward"); + this->_setCategory("backward"); if (status == 1) { this->_orientation = LEFT; this->_latOrientation = LEFT; if (this->GetSpriteFrame() < this->_getAttr("beginFrame").asInt() && !this->_isJump) this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_Loop, - this->_getAttr("beginFrame").asInt(), - this->_getAttr("endFrame").asInt()); + this->_getAttr("beginFrame").asInt(), + this->_getAttr("endFrame").asInt()); else if (this->_isJump) { this->_setCategory("jump"); if (this->GetSpriteFrame() >= this->_getAttr("beginFrame_right").asInt() && this->GetSpriteFrame() <= this->_getAttr("endFrame_right").asInt()) this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, - this->GetSpriteFrame() + 8, - this->_getAttr("endFrame_left").asInt() - 3, "jump"); + this->GetSpriteFrame() + 8, + this->_getAttr("endFrame_left").asInt() - 3, "jump"); + this->_setCategory("backward"); + } else if (this->_isLoadingAttack) { + this->_setCategory("loadAttack_charge"); + this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, + this->_getAttr("endFrame_left").asInt(), + this->_getAttr("endFrame_left").asInt(), "loadAttack_charge"); this->_setCategory("backward"); } Game::startRunning(this); @@ -495,10 +567,8 @@ void Characters::_backward(int status) { if (!this->_isJump && !this->_isAttacking) this->AnimCallback("base"); } else { - if (this->GetBody()->GetLinearVelocity().x > -(this->_maxSpeed)) { if (this->_wallsLeft.size() == 0 && this->_canMove == true) this->GetBody()->SetLinearVelocity(b2Vec2(-this->_getAttr("force").asFloat(), this->GetBody()->GetLinearVelocity().y)); - } } return ; } @@ -522,16 +592,17 @@ void Characters::_jump(int status) { else { this->ApplyLinearImpulse(Vector2(0, this->_getAttr("force").asFloat()), Vector2(0, 0)); } - if (this->_isAttacking == false) { + if (this->_isAttacking == false && this->_isLoadingAttack == 0) { + this->changeSizeTo(Vector2(1, 1)); if (this->_latOrientation == RIGHT) { this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, - this->_getAttr("beginFrame_right").asInt(), - this->_getAttr("endFrame_right").asInt() - 3, "jump"); + this->_getAttr("beginFrame_right").asInt(), + this->_getAttr("endFrame_right").asInt() - 3, "jump"); } else if (this->_latOrientation == LEFT) { this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, - this->_getAttr("beginFrame_left").asInt(), - this->_getAttr("endFrame_left").asInt() - 3, "jump"); + this->_getAttr("beginFrame_left").asInt(), + this->_getAttr("endFrame_left").asInt() - 3, "jump"); } } if (this->_grounds.size() == 0) @@ -555,7 +626,7 @@ void Characters::_up(int status) { if (status == 1) this->_orientation = UP; else - this->_orientation = this->_latOrientation; + this->_orientation = this->_latOrientation; } //! Down button action @@ -584,7 +655,7 @@ void Characters::_down(int status) { } } else - this->_orientation = this->_latOrientation; + this->_orientation = this->_latOrientation; } //! Attack action @@ -595,10 +666,36 @@ void Characters::_down(int status) { * @sa Weapon::attack */ void Characters::_attack(int status) { - this->_setCategory("attack"); if (status == 1 && this->_weapon->attackReady() == 1) { + if (!this->_attackPressed && !this->_isLoadingAttack) { + this->_attackPressed = 1; + theSwitchboard.SubscribeTo(this, "startChargeAttack"); + theSwitchboard.DeferredBroadcast(new Message("startChargeAttack"), + 0.3f); + } + if (this->_isLoadingAttack == 1 && this->_attackPressed == 1) { + this->_attackPressed = 0; + this->_fullChargedAttack = false; + theSwitchboard.SubscribeTo(this, "fullChargedAttack"); + theSwitchboard.DeferredBroadcast(new Message("fullChargedAttack"), + 0.5f); + this->actionCallback("loadAttack_charge", 1); + } + } + else if (status == 0 && this->_weapon->attackReady() == 1 && (this->_fullChargedAttack == true || this->_isLoadingAttack == 0)) { + theSwitchboard.UnsubscribeFrom(this, "fullChargedAttack"); + theSwitchboard.UnsubscribeFrom(this, "startChargeAttack"); this->_isAttacking = 1; - theSwitchboard.DeferredBroadcast(new Message("enableAttackHitbox"), 0.05f); + this->_isLoadingAttack = 0; + this->_attackPressed = 0; + theSwitchboard.DeferredBroadcast(new Message("enableAttackHitbox"), + 0.05f); + } else if (status == 0) { + theSwitchboard.UnsubscribeFrom(this, "fullChargedAttack"); + theSwitchboard.UnsubscribeFrom(this, "startChargeAttack"); + this->_isLoadingAttack = 0; + this->_attackPressed = 0; + this->AnimCallback("base"); } } @@ -612,20 +709,19 @@ void Characters::_attack(int status) { void Characters::_pickupItem(int status) { if (this->_item == nullptr) return; - if (this->_item->getAttribute("type3") == "Weapon"){ - unequipWeapon(); - this->equipWeapon(static_cast<Equipment*>(this->_item)->getWeapon()); - } - else if (this->_item->getAttribute("type3") == "Ring") { - unequipRing(); - this->equipRing(static_cast<Equipment*>(this->_item)->getRing()); - } - else if (this->_item->getAttribute("type3") == "Armor") - { - unequipArmor(); - this->equipArmor(static_cast<Equipment*>(this->_item)->getArmor()); + if (this->_inventory->addItemToInventory(this->_item->getAttribute("name")) == 1) { + if (Game::wList->checkExists(this->_inventory->getCurrentFocus())) + new Loot(this, Game::wList->getWeapon(this->_inventory->dropSelectedItem())); + else if (Game::aList->checkExists(this->_inventory->getCurrentFocus())) + new Loot(this, Game::aList->getArmor(this->_inventory->dropSelectedItem())); + else if (Game::rList->checkExists(this->_inventory->getCurrentFocus())) + new Loot(this, Game::rList->getRing(this->_inventory->dropSelectedItem())); + else + Log::error("An error occured trying to drop " + this->_inventory->getCurrentFocus()); + this->_inventory->addItemToInventory(this->_item->getAttribute("name")); } - theSwitchboard.Broadcast(new Message("DeleteEquipment" + this->_item->GetName())); + theSwitchboard.Broadcast(new Message("DeleteEquipment" + + this->_item->GetName())); this->_item = nullptr; } @@ -636,8 +732,8 @@ void Characters::_pickupItem(int status) { * @param The Weapon object */ void Characters::equipWeapon(Weapon* weapon) { - this->_weapon = new Weapon(weapon); - Game::getHUD()->items(this->_weapon); + this->_weapon = new Weapon(weapon); + Game::getHUD()->items(this->_weapon); } //! Unequip a weapon @@ -645,8 +741,9 @@ void Characters::equipWeapon(Weapon* weapon) { * Unequip old weapon to the Character, and update the HUD. * @param The Weapon object */ -void Characters::unequipWeapon(void) { } - +void Characters::unequipWeapon(void) { + this->_inventory->swapEquipmentAndInventory(this->_weapon->getAttribute("name")); +} //! Equip a armor /** @@ -655,8 +752,10 @@ void Characters::unequipWeapon(void) { } */ void Characters::equipArmor(Armor* armor) { this->_armor = new Armor(armor); - if (this->_armor && this->_armor->getBonus() != nullptr && this->_armor->getBonus()->getType() == Bonus::BonusType::HP_BUFF) - this->_maxHp += this->_armor->getBonus()->getAmount(); + if (this->_armor->getAttribute("hpBuff") != "") + this->_maxHp += std::stoi(this->_armor->getAttribute("hpBuff")); + if (this->_armor->getAttribute("manaBuff") != "") + this->_maxMana += std::stoi(this->_armor->getAttribute("manaBuff")); Game::getHUD()->items(this->_armor); } @@ -666,8 +765,11 @@ void Characters::equipArmor(Armor* armor) { * @param void */ void Characters::unequipArmor(void) { - if (this->_armor && this->_armor->getBonus() != nullptr && this->_armor->getBonus()->getType() == Bonus::BonusType::HP_BUFF) - this->_maxHp -= this->_armor->getBonus()->getAmount(); + this->_inventory->swapEquipmentAndInventory(this->_armor->getAttribute("name")); + if (this->_armor->getAttribute("hpBuff") != "") + this->_maxHp -= std::stoi(this->_armor->getAttribute("hpBuff")); + if (this->_armor->getAttribute("manaBuff") != "") + this->_maxMana -= std::stoi(this->_armor->getAttribute("manaBuff")); } //! Equip a ring @@ -677,8 +779,10 @@ void Characters::unequipArmor(void) { */ void Characters::equipRing(Ring* ring) { this->_ring = new Ring(ring); - if (this->_ring && this->_ring->getBonus() != nullptr && this->_ring->getBonus()->getType() == Bonus::BonusType::HP_BUFF) - this->_maxHp += this->_ring->getBonus()->getAmount(); + if (this->_ring->getAttribute("hpBuff") != "") + this->_maxHp += std::stoi(this->_ring->getAttribute("hpBuff")); + if (this->_ring->getAttribute("manaBuff") != "") + this->_maxMana += std::stoi(this->_ring->getAttribute("manaBuff")); Game::getHUD()->items(this->_ring); } @@ -688,8 +792,11 @@ void Characters::equipRing(Ring* ring) { * @param The ring object */ void Characters::unequipRing(void) { - if (this->_ring && this->_ring->getBonus() != nullptr && this->_ring->getBonus()->getType() == Bonus::BonusType::HP_BUFF) - this->_maxHp -= this->_ring->getBonus()->getAmount(); + this->_inventory->swapEquipmentAndInventory(this->_ring->getAttribute("name")); + if (this->_ring->getAttribute("hpBuff") != "") + this->_maxHp -= std::stoi(this->_ring->getAttribute("hpBuff")); + if (this->_ring->getAttribute("manaBuff") != "") + this->_maxMana -= std::stoi(this->_ring->getAttribute("manaBuff")); } //! Set basics hp @@ -704,6 +811,18 @@ void Characters::setHP(int hp) { this->_hp = hp; }; +//! Set basics mana +/** + * Set Mana to the Character. + * @param mana The Mana number + */ +void Characters::setMana(int mana) { + if (mana > this->_maxMana) + this->_mana = this->_maxMana; + else + this->_mana = mana; +}; + //! Destroy an Enemy. /** * Made theSwitchboard Unsubscribe from the object, and destroy it. @@ -721,21 +840,25 @@ void Characters::_destroyEnemy(void) { void Characters::_heroDeath(void) { this->_setCategory("death"); this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, - this->_getAttr("beginFrame_right").asInt(), - this->_getAttr("endFrame_right").asInt(), "death"); + this->_getAttr("beginFrame_right").asInt(), + this->_getAttr("endFrame_right").asInt(), "death"); Game::endGame = true; Actor* ghost = new Actor(); ghost->SetPosition(this->GetBody()->GetWorldCenter().x, this->GetBody()->GetWorldCenter().y - 1.7f); ghost->SetSprite("Resources/Images/Ghost/ghost_000.png", 0); ghost->LoadSpriteFrames("Resources/Images/Ghost/ghost_000.png"); ghost->MoveTo(Vector2(this->GetBody()->GetWorldCenter().x, this->GetBody()->GetWorldCenter().y + 7), 4); - theWorld.Add(ghost); + theWorld.Add(ghost); ghost->PlaySpriteAnimation(0.2f, SAT_OneShot, 0, 10, "ghost"); } Characters::Orientation Characters::getOrientation(void) { return this->_orientation; } std::string Characters::getLastAction(void) { return this->_lastAction; }; +Elements* Characters::getItem(void) { return this->_item; } int Characters::getHP(void) { return this->_hp; }; +int Characters::getMana(void) { return this->_mana; }; +int Characters::getMaxMana(void) { return this->_maxMana; }; +int Characters::getMaxHP(void) { return this->_maxHp; }; int Characters::getGold(void) { return this->_gold; }; void Characters::changeCanMove(void) { this->_canMove = (this->_canMove ? false : true); }; Weapon *Characters::getWeapon(void) { return this->_weapon; }; diff --git a/Sources/src/Consumable.cpp b/Sources/src/Consumable.cpp @@ -37,9 +37,9 @@ Consumable::Consumable(void) { this->addAttribute("type2", "Consumable"); this->addAttribute("type3", "HP"); - this->addAttribute("value", "50"); + this->addAttribute("value", "25"); this->SetSprite("Resources/Images/heart.png"); - this->SetPosition(9, -4); + this->SetPosition(45, -27); this->InitPhysics(); theWorld.Add(this); } @@ -56,15 +56,19 @@ Consumable::Consumable(void) { */ Consumable::Consumable(Characters* c) { this->addAttribute("type2", "Consumable"); - if (rand() % 2 == 1) { - this->addAttribute("type3", "HP"); - this->addAttribute("value", "50"); - this->SetSprite("Resources/Images/heart.png"); + if (rand() % 3 == 1) { + this->addAttribute("type3", "HP"); + this->addAttribute("value", "25"); + this->SetSprite("Resources/Images/heart.png"); } - else { - this->addAttribute("type3", "gold"); - this->addAttribute("value", "50"); - this->SetSprite("Resources/Images/gold.png"); + else if (rand() %3 == 2 ){ + this->addAttribute("type3", "gold"); + this->addAttribute("value", "50"); + this->SetSprite("Resources/Images/gold.png"); + } else { + this->addAttribute("type3", "mana"); + this->addAttribute("value", "50"); + this->SetSprite("Resources/Images/mana.png"); } this->SetPosition(c->GetBody()->GetWorldCenter().x, c->GetBody()->GetWorldCenter().y); Game::bodiesToCreate.push_back(this); @@ -84,8 +88,10 @@ Consumable::Consumable(std::string type, std::string value, Characters* c) { this->addAttribute("value", value); if (type == "HP") this->SetSprite("Resources/Images/heart.png"); - else + else if (type == "gold") this->SetSprite("Resources/Images/gold.png"); + else + this->SetSprite("Resources/Images/mana.png"); this->SetPosition(c->GetBody()->GetWorldCenter().x, c->GetBody()->GetWorldCenter().y); Game::bodiesToCreate.push_back(this); } diff --git a/Sources/src/ContactFilter.cpp b/Sources/src/ContactFilter.cpp @@ -28,22 +28,37 @@ bool ContactFilter::ShouldCollide(b2Fixture* fixA, b2Fixture* fixB) { - Elements* attrA = static_cast<Elements*>(fixB->GetBody()->GetUserData()); - Elements* attrB = static_cast<Elements*>(fixA->GetBody()->GetUserData()); + Elements* attrA; + Elements* attrB; + + attrA = static_cast<Elements*>(fixB->GetBody()->GetUserData()); + attrB = static_cast<Elements*>(fixA->GetBody()->GetUserData()); if (static_cast<Elements*>(fixA->GetBody()->GetUserData())->getAttribute("type") == "Hero") { Elements* attrA = static_cast<Elements*>(fixA->GetBody()->GetUserData()); Elements* attrB = static_cast<Elements*>(fixB->GetBody()->GetUserData()); } - if (attrA->getAttribute("type") == "Hero" && - attrB->getAttribute("type") == "ground" && - attrB->getAttribute("speType") == "canCross") { - if (attrA->GetBody()->GetWorldCenter().y - 1 < - attrB->GetBody()->GetWorldCenter().y) { - return false; - } - else if (static_cast<Characters*>(attrA)->getOrientation() == Characters::DOWN) { - return false; - } + if (attrA->getAttribute("type") == "Hero") + if (attrA->getAttribute("type") == "Object" && attrB->getAttribute("type") != "ground" + || attrB->getAttribute("type") == "Object" && attrA->getAttribute("type") != "ground") { + if (attrA->getAttribute("type") == "Hero") + attrA->BeginContact(attrB, nullptr); + return false; } + // if (attrA->getAttribute("type") == "Hero" && + // attrB->getAttribute("type") == "ground" && + // attrB->getAttribute("speType") == "canCross") { + // std::cout << "found one" << std::endl; + // if (attrA->GetBody()->GetWorldCenter().y - 1 < + // attrB->GetBody()->GetWorldCenter().y) { + // std::cout << "crossing from bottom" << std::endl; + // return false; + // } + // else if (static_cast<Characters*>(attrA)->getOrientation() == Characters::DOWN) { + // std::cout << "crossing from top" << std::endl; + // return false; + // } + // std::cout << "not crossing" << std::endl; + + // } return true; } diff --git a/Sources/src/Elements.cpp b/Sources/src/Elements.cpp @@ -31,14 +31,14 @@ * @param id The future id of the element * @fixme This function is outdated due to recent changes in the API. */ -Elements::Elements(int id) : PhysicsActor() { +Elements::Elements(int id) : PhysicsActor(), _isAdded(0) { this->setId(Game::getNextId()); Game::addElement(*this); return ; } //! Base constructor -Elements::Elements(void) : PhysicsActor() { +Elements::Elements(void) : PhysicsActor(), _isAdded(0) { this->setId(Game::getNextId()); Game::addElement(*this); return ; @@ -51,7 +51,8 @@ Elements::Elements(void) : PhysicsActor() { */ Elements::Elements(Elements & obj) : PhysicsActor(obj) { this->_attributes = obj.getAttributes(); - this->setId(Game::getNextId()); + this->setId(obj.getId()); + this->_isAdded = obj.isAdded(); Game::addElement(*this); } @@ -170,6 +171,7 @@ void Elements::display(void) { this->_animIt = this->_animationList.begin(); this->PlaySpriteAnimation((*this->_animIt)->time, SAT_OneShot, (*this->_animIt)->frame, (*this->_animIt)->frame, "baseAnimation"); } + this->_isAdded = 1; theWorld.Add(this); } @@ -177,12 +179,15 @@ void Elements::display(void) { void Elements::setXStart(float X) { this->_XStartPos = X; }; void Elements::setYStart(float Y) { this->_YStartPos = Y; }; +int Elements::getXStart(void) { return this->_XStartPos; }; +int Elements::getYStart(void) { return this->_YStartPos; }; void Elements::setWidth(int w) { this->_width = w; }; void Elements::setHeight(int h) { this->_height = h; }; void Elements::setCutWidth(int w) { this->_cutWidth = w; }; void Elements::setCutHeight(int h) { this->_cutHeight = h; }; void Elements::setFrame(int n) { this->_frame = n; }; void Elements::setHitbox(std::string n) { this->_hitbox = n; this->_hitboxType = "special"; }; +int Elements::isAdded(void) { return this->_isAdded; }; /* GETTERS */ std::map<std::string, std::string> Elements::getAttributes(void) { return this->_attributes; }; diff --git a/Sources/src/Enemy.cpp b/Sources/src/Enemy.cpp @@ -41,12 +41,11 @@ Enemy::Enemy(void) : Characters("Enemy") { */ Enemy::Enemy(std::string str) : Characters(str) { this->SetName("Enemy"); - theSwitchboard.SubscribeTo(this, "startPathing" + this->GetName()); - theSwitchboard.DeferredBroadcast(new Message("startPathing" + this->GetName()), 0.2f); this->addAttribute("type", "Enemy"); this->addAttribute("name", str); this->addAttribute("enemy", "1"); this->_isDead = false; + this->_isTakingDamage = 0; return ; } @@ -91,8 +90,15 @@ void Enemy::BeginContact(Elements* m, b2Contact *contact) { Characters::BeginContact(m, contact); Weapon* w = static_cast<Weapon*>(m); Projectile* p = static_cast<Projectile*>(m); - if (m->getAttributes()["type"] == "HeroWeaponHitBox") { + if (m->getAttribute("type") == "ground") { + Game::startRunning(this); + this->_isTakingDamage = 0; + } + if (m->getAttribute("type") == "HeroWeaponHitBox") { + this->GetBody()->SetLinearVelocity(b2Vec2(-2, 2)); + Game::stopRunning(this); if (this->takeDamage(w->getDamage()) == 1) { + this->_isTakingDamage = 1; if (this->GetBody()->GetWorldCenter().x > m->GetBody()->GetWorldCenter().x) { this->ApplyLinearImpulse(Vector2(w->getPushback(), w->getPushback()), Vector2(0,0)); } else { @@ -102,7 +108,10 @@ void Enemy::BeginContact(Elements* m, b2Contact *contact) { else { this->GetBody()->SetLinearVelocity(b2Vec2(0, 0)); } - } else if (m->getAttributes()["type"] == "HeroProjectile") { + } else if (m->getAttribute("type") == "HeroProjectile") { + this->GetBody()->SetLinearVelocity(b2Vec2(-2, 2)); + Game::stopRunning(this); + this->_isTakingDamage = 1; if (this->takeDamage(p->getDamage()) == 1) { if (this->GetBody()->GetWorldCenter().x > m->GetBody()->GetWorldCenter().x) { this->ApplyLinearImpulse(Vector2(p->getPushback(), p->getPushback()), Vector2(0,0)); @@ -113,7 +122,8 @@ void Enemy::BeginContact(Elements* m, b2Contact *contact) { else { this->GetBody()->SetLinearVelocity(b2Vec2(0, 0)); } - } else if (m->getAttributes()["type"] == "Hero") { + } else if (m->getAttribute("type") == "Hero") { + this->_isTakingDamage = 1; if (this->_orientation == LEFT) this->_orientation = RIGHT; else @@ -132,6 +142,7 @@ void Enemy::BeginContact(Elements* m, b2Contact *contact) { this->_orientation = LEFT; } else if (m->getAttribute("speType") == "spikes") { + this->_isTakingDamage = 1; if (this->GetBody()->GetWorldCenter().x > m->GetBody()->GetWorldCenter().x) { this->ApplyLinearImpulse(Vector2(5, 5), Vector2(0,0)); } else { @@ -140,6 +151,17 @@ void Enemy::BeginContact(Elements* m, b2Contact *contact) { } } +void Enemy::EndContact(Elements *m, b2Contact *contact) { + Characters::EndContact(m, contact); + if (m->getAttribute("type") == "ground" && !this->_isDead && !this->_isTakingDamage) { + if (this->_lastElement != m->getId()) { + this->_pattern->tick(Game::currentGame->maps->getMapXY()[Game::currentY][Game::currentX]); + this->_lastElement = m->getId(); + } + } + +} + //! Take Damage /** * Function that applies damage @@ -165,10 +187,19 @@ int Enemy::takeDamage(int damage) { this->_getAttr("endFrame").asInt()); theSwitchboard.SubscribeTo(this, "destroyEnemy"); theSwitchboard.DeferredBroadcast(new Message("destroyEnemy"), 0.5); - theSwitchboard.UnsubscribeFrom(this, "startPathing" + this->GetName()); - theSwitchboard.UnsubscribeFrom(this, "setToStatic" + this->GetName()); return 0; } this->_hp -= damage; return 1; } + +/* SETTERS */ + +void Enemy::setMap(Map *m) { this->_map = m; }; +void Enemy::setPattern(CPattern *p) { this->_pattern = p; }; + +/* GETTERS */ + +Map *Enemy::getMap(void) { return this->_map; }; +CPattern *Enemy::getPattern(void) { return this->_pattern; }; +bool Enemy::dead(void) { return this->_isDead; }; diff --git a/Sources/src/Equipment.cpp b/Sources/src/Equipment.cpp @@ -65,6 +65,7 @@ Equipment::Equipment(Weapon *w, Characters* c): Object() { this->SetPosition(c->GetBody()->GetWorldCenter().x, c->GetBody()->GetWorldCenter().y); this->_weapon = new Weapon(w); this->_name = w->getName(); + this->addAttribute("name", w->getName()); this->SetSprite(this->_weapon->getSprite()); this->SetName("loot"); theSwitchboard.SubscribeTo(this, "DeleteEquipment" + this->GetName()); @@ -79,6 +80,7 @@ Equipment::Equipment(Armor *w, Characters* c): Object() { this->SetPosition(c->GetBody()->GetWorldCenter().x, c->GetBody()->GetWorldCenter().y); this->_armor = new Armor(w); this->_name = w->getName(); + this->addAttribute("name", w->getName()); this->SetSprite(this->_armor->getSprite()); this->SetName("loot"); theSwitchboard.SubscribeTo(this, "DeleteEquipment" + this->GetName()); @@ -92,6 +94,7 @@ Equipment::Equipment(Ring *w, Characters* c): Object() { this->SetPosition(c->GetBody()->GetWorldCenter().x, c->GetBody()->GetWorldCenter().y); this->_ring = new Ring(w); this->_name = w->getName(); + this->addAttribute("name", w->getName()); this->SetSprite(this->_ring->getSprite()); this->SetName("loot"); theSwitchboard.SubscribeTo(this, "DeleteEquipment" + this->GetName()); @@ -99,13 +102,11 @@ Equipment::Equipment(Ring *w, Characters* c): Object() { Game::bodiesToCreate.push_back(this); } - //! Destructor /* * Basic Destructor */ Equipment::~Equipment(void) { - return; } //! Collision begin callback diff --git a/Sources/src/Game.cpp b/Sources/src/Game.cpp @@ -32,7 +32,7 @@ * Load the maps with Maps::Maps * @sa Maps */ -Game::Game(void) : _hero(*(new Characters())) { +Game::Game(void) : _hero((new Characters())) { #ifdef __APPLE__ theWorld.Initialize(1920, 1080, NAME, false, false); #else @@ -52,7 +52,7 @@ Game::Game(void) : _hero(*(new Characters())) { * @param width The width of the window * @param heigh The height of the window */ -Game::Game(unsigned int width, unsigned int height) : _hero(*(new Characters())) { +Game::Game(unsigned int width, unsigned int height) : _hero((new Characters())) { theWorld.Initialize(width, height, NAME); theWorld.SetupPhysics(); GameContactListener *gListen = new GameContactListener(); @@ -83,43 +83,36 @@ void Game::start(void) { Game::eList = new EnemyList(); Game::aList = new ArmorList(); Game::rList = new RingList(); + this->tooltip = new Tooltip(); Game::currentGame = this; Hero *hero = new Hero(); - LevelGenerator *levelGenerator = new LevelGenerator(9, 5, 60); - levelGenerator->execute(); - //this->gameMap = levelGenerator->_rooms; - - // THIS IS AN EXAMPLE - // That's a test map. - this->_tmpMap.push_back(std::vector<int>()); - this->_tmpMap.push_back(std::vector<int>()); - this->_tmpMap.push_back(std::vector<int>()); - this->_tmpMap[0].push_back(0); - this->_tmpMap[0].push_back(4); - this->_tmpMap[0].push_back(0); - this->_tmpMap[1].push_back(2); - this->_tmpMap[1].push_back(15); - this->_tmpMap[1].push_back(8); - this->_tmpMap[2].push_back(0); - this->_tmpMap[2].push_back(1); - this->_tmpMap[2].push_back(0); + + LevelGenerator *levelGenerator = new LevelGenerator(4, 3, 60); + levelGenerator->execute(); + this->_tmpMap = levelGenerator->getLevel(); this->maps->displayLevel(this->_tmpMap); - this->displayHero(*(hero)); +// Log::info("NbMaps: " + std::to_string(levelGenerator->getNbMaps())); +// Log::info("NbEnemy:" + trouver le nombre d ennemy); +// Log::info("NbMaps: " + info sur la sauvegarde (nivau du hero, gold etc...)); + //theCamera.LockTo(hero); - Game::currentX = 1; - Game::currentY = 1; - theCamera.SetPosition(this->maps->getMapXY()[Game::currentY][Game::currentX]->getXMid(), - this->maps->getMapXY()[Game::currentY][Game::currentX]->getYMid() + 1.8, 9.001); - // 9.2 + 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(); + this->displayHero(*(hero)); hero->init(); + hero->equipWeapon(Game::wList->getWeapon("Sword")); hero->equipRing(Game::rList->getRing("SmallRing")); hero->equipArmor(Game::aList->getArmor("ChestArmor")); - this->setHero(*hero); + this->setHero(hero); this->displayHUD(); + Game::started = 1; } @@ -148,8 +141,8 @@ void Game::showMap(void) { */ void Game::displayHero(Elements & Hero) { //Here starts the game - parse the 1st map coordinates and hero start - Hero.setXStart(28); - Hero.setYStart(-28); + Hero.setXStart(this->maps->getMapXY()[Game::currentY][Game::currentX].getXMid()); + Hero.setYStart(this->maps->getMapXY()[Game::currentY][Game::currentX].getYMid()); Hero.addAttribute("hero", "1"); Hero.display(); } @@ -189,31 +182,53 @@ int Game::getNextId(void) { } void Game::checkHeroPosition(void) { - if (Game::started == 1) + if (Game::started == 1) { Game::currentGame->moveCamera(); + Game::currentGame->simulateHeroItemContact(); + } +} + +void Game::simulateHeroItemContact(void) { + if (this->_hero->getItem() != nullptr) { + if ((this->_hero->getItem()->GetBody()->GetWorldCenter().x >= + this->_hero->GetBody()->GetWorldCenter().x + 1) || + (this->_hero->getItem()->GetBody()->GetWorldCenter().x <= + this->_hero->GetBody()->GetWorldCenter().x - 1) || + (this->_hero->getItem()->GetBody()->GetWorldCenter().y >= + this->_hero->GetBody()->GetWorldCenter().y + 1) || + (this->_hero->getItem()->GetBody()->GetWorldCenter().y <= + this->_hero->GetBody()->GetWorldCenter().y - 1)) + this->_hero->EndContact(this->_hero->getItem(), nullptr); + } } void Game::moveCamera(void) { bool asChanged = false; - Map *tmp = this->maps->getMapXY()[Game::currentY][Game::currentX]; + Map &tmp = this->maps->_XYMap[Game::currentY][Game::currentX]; - if (this->_hero.GetBody()->GetWorldCenter().x >= (tmp->getXStart() + tmp->getWidth() - 0.5)) { + if (this->_hero->GetBody()->GetWorldCenter().x >= (tmp.getXStart() + tmp.getWidth() - 0.5)) { + this->maps->getMapXY()[Game::currentY][Game::currentX].destroyMap(); Game::currentX++; asChanged = true; - } else if (this->_hero.GetBody()->GetWorldCenter().x <= (tmp->getXStart() - 1)) { + } else if (this->_hero->GetBody()->GetWorldCenter().x <= (tmp.getXStart() - 1)) { + this->maps->getMapXY()[Game::currentY][Game::currentX].destroyMap(); Game::currentX--; asChanged = true; - } if (this->_hero.GetBody()->GetWorldCenter().y >= tmp->getYStart()) { + } else if (this->_hero->GetBody()->GetWorldCenter().y >= tmp.getYStart()) { + this->maps->getMapXY()[Game::currentY][Game::currentX].destroyMap(); Game::currentY--; asChanged = true; - } else if (this->_hero.GetBody()->GetWorldCenter().y <= (tmp->getYStart() - tmp->getHeight())) { + } else if (this->_hero->GetBody()->GetWorldCenter().y <= (tmp.getYStart() - tmp.getHeight())) { + this->maps->getMapXY()[Game::currentY][Game::currentX].destroyMap(); Game::currentY++; asChanged = true; } - if (asChanged) { - 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(); + theCamera.SetPosition(this->maps->getMapXY()[Game::currentY][Game::currentX].getXMid(), + this->maps->getMapXY()[Game::currentY][Game::currentX].getYMid() + 1.8); + Game::getHUD()->minimap(); + asChanged = false; } } @@ -224,8 +239,12 @@ void Game::moveCamera(void) { * @param elem The Elements to add at the list */ void Game::addElement(Elements & elem) { - Game::elementMap[Game::currentIds] = &elem; - Game::currentIds += 1; + if (Game::elementMap[elem.getId()]) + Game::elementMap[elem.getId()] = &elem; + else { + Game::elementMap[Game::currentIds] = &elem; + Game::currentIds += 1; + } } //! Delete an element @@ -304,7 +323,10 @@ bool Game::destroyAllBodies(void) { return true; } else { for (std::list<Elements*>::iterator it = Game::bodiesToDestroy.begin(); it != Game::bodiesToDestroy.end(); it++) { - theWorld.GetPhysicsWorld().DestroyBody((*it)->GetBody()); + if ((*it)->getAttribute("physic") != "") { + (*it)->GetBody()->SetActive(false); + theWorld.GetPhysicsWorld().DestroyBody((*it)->GetBody()); + } theWorld.Remove(*it); Game::delElement(*it); } @@ -407,7 +429,7 @@ HUDWindow *Game::getHUD(void) { */ void Game::displayHUD(void) { HUDWindow *w = new HUDWindow(); - Characters &lol = Game::getHero(); + Characters* hero = Game::getHero(); w->SetPosition(theCamera.GetWindowWidth() / 2 - 100, 50); w->SetSize(theCamera.GetWindowWidth() - 200, 100.0f); w->SetSprite("Resources/Images/HUD/background_hud.png"); @@ -417,17 +439,24 @@ void Game::displayHUD(void) { theWorld.Add(w); Game *g = this; w->setGame(g); - w->life(125); - w->mana(90); + w->setMaxMana(hero->getMaxMana()); + w->setMaxHP(hero->getMaxHP()); + w->life(hero->getHP()); + w->mana(hero->getMana()); w->gold(0); - w->consumable(); + w->bag(); + w->initMinimapBackground(); w->minimap(); + + // Work + /* w->setText("Burp.", this->_hero, Vector3(0, 0, 0), 0, 1);*/ + /*w->removeText("Burp.");*/ Game::addHUDWindow(w); } /* SETTERS */ -void Game::setHero(Characters & h) { this->_hero = h; }; -Characters &Game::getHero(void) { return this->_hero; }; +void Game::setHero(Characters * h) { this->_hero = h; }; +Characters* Game::getHero(void) { return this->_hero; }; // Set for the statics int Game::currentIds = 0; @@ -451,3 +480,4 @@ int Game::currentX = 0; int Game::currentY = 0; Game* Game::currentGame = 0; int Game::started = 0; +int Game::cameraTick = 0; diff --git a/Sources/src/GameContactListener.cpp b/Sources/src/GameContactListener.cpp @@ -38,8 +38,10 @@ void GameContactListener::BeginContact(b2Contact * contact) { p1 = static_cast<PhysicsActor*>(contact->GetFixtureA()->GetBody()->GetUserData()); p2 = static_cast<PhysicsActor*>(contact->GetFixtureB()->GetBody()->GetUserData()); - Game::elementMap[p1->getId()]->BeginContact(Game::elementMap[p2->getId()], contact); - Game::elementMap[p2->getId()]->BeginContact(Game::elementMap[p1->getId()], contact); +// if (Game::elementMap[p1->getId()] && Game::elementMap[p2->getId()]) { + Game::elementMap[p1->getId()]->BeginContact(Game::elementMap[p2->getId()], contact); + Game::elementMap[p2->getId()]->BeginContact(Game::elementMap[p1->getId()], contact); +// } } //! Function that allows the overload of the BeginContact in the classes used in our game @@ -55,6 +57,8 @@ void GameContactListener::EndContact(b2Contact * contact) { p1 = static_cast<PhysicsActor*>(contact->GetFixtureA()->GetBody()->GetUserData()); p2 = static_cast<PhysicsActor*>(contact->GetFixtureB()->GetBody()->GetUserData()); - Game::elementMap[p1->getId()]->EndContact(Game::elementMap[p2->getId()], contact); - Game::elementMap[p2->getId()]->EndContact(Game::elementMap[p1->getId()], contact); + // if (Game::elementMap[p1->getId()] && Game::elementMap[p2->getId()]) { + Game::elementMap[p1->getId()]->EndContact(Game::elementMap[p2->getId()], contact); + Game::elementMap[p2->getId()]->EndContact(Game::elementMap[p1->getId()], contact); +// } } diff --git a/Sources/src/HUDWindow.cpp b/Sources/src/HUDWindow.cpp @@ -31,6 +31,7 @@ */ HUDWindow::HUDWindow(void) : HUDActor() { RegisterFont("Resources/font.ttf", 14, "Gamefont"); + RegisterFont("Resources/font.ttf", 8, "SmallGamefont"); RegisterFont("Resources/Fonts/fail.otf", 80, "dead"); return; } @@ -57,6 +58,7 @@ HUDWindow::Text *HUDWindow::setText(std::string str, int x, int y) { t->y = y; t->colorR = t->colorG = t->colorB = t->colorA = 1; t->font = "Gamefont"; + t->toFollow = nullptr; this->_text.push_back(t); return t; } @@ -80,6 +82,7 @@ HUDWindow::Text *HUDWindow::setText(std::string str, int x, int y, Vector3 colo t->colorB = color.Z; t->colorA = alpha; t->font = "Gamefont"; + t->toFollow = nullptr; this->_text.push_back(t); return t; } @@ -104,6 +107,66 @@ HUDWindow::Text *HUDWindow::setText(std::string str, int x, int y, Vector3 colo t->colorB = color.Z; t->colorA = alpha; t->font = font; + t->toFollow = nullptr; + this->_text.push_back(t); + return t; +} + +//! Characters-follow Text +/** + * Set a Text on a Character + * @param str The Text + * @param toFollow The Character + * @param color The RGB Color + * @param isFading 0 / 1 If the text has to fade + * @param isTalk 0 / 1 If the text is a dialog + * @note isFading and isTalk can't be true at the same time + */ +HUDWindow::Text *HUDWindow::setText(std::string str, Characters *toFollow, + Vector3 color, int isFading, int isTalk) { + HUDWindow::Text *t = new HUDWindow::Text(); + + t->str = str; + t->toFollow = toFollow; + t->colorR = color.X; + t->colorG = color.Y; + t->colorB = color.Z; + t->colorA = 1; + t->isFading = isFading; + t->isTalk = isTalk; + t->font = "Gamefont"; + t->y = 0; + if (isTalk) { + Elements *test; + + test = new Elements(); + test->SetPosition(Game::currentGame->getHero()->GetBody()->GetWorldCenter().x, + (Game::currentGame->getHero()->GetBody()->GetWorldCenter().y + 1)); + test->SetSize(2.5, 0.7); + 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->SetLayer(1500); + test->InitPhysics(); + b2DistanceJointDef jointDef1; + b2DistanceJointDef jointDef2; + jointDef1.Initialize(Game::currentGame->getHero()->GetBody(), test->GetBody(), + b2Vec2(Game::currentGame->getHero()->GetBody()->GetWorldCenter().x + 0.4f, + Game::currentGame->getHero()->GetBody()->GetWorldCenter().y + 0.4f), test->GetBody()->GetWorldCenter()); + jointDef1.collideConnected = false; + jointDef2.Initialize(Game::currentGame->getHero()->GetBody(), test->GetBody(), + b2Vec2(Game::currentGame->getHero()->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); + this->_dialog[t->str] = test; + } this->_text.push_back(t); return t; } @@ -120,8 +183,13 @@ void HUDWindow::removeText(std::string str) { if ((*i)->str == str) break ; } - if (i != this->_text.end()) + if (i != this->_text.end()) { + if (this->_dialog[str]) { + Game::addToDestroyList(this->_dialog[str]); + this->_dialog.erase(this->_dialog.find(str)); + } this->_text.erase(i); + } } //! Remove a text with an object @@ -136,8 +204,9 @@ void HUDWindow::removeText(HUDWindow::Text *text) { if ((*i) == text) break ; } - if (i != this->_text.end()) + if (i != this->_text.end()) { this->_text.erase(i); + } } //! Callback for Display text @@ -150,7 +219,23 @@ void HUDWindow::displayText(void) { for (i = this->_text.begin(); i != this->_text.end(); i++) { glColor4f((*i)->colorR, (*i)->colorG, (*i)->colorB, (*i)->colorA); - DrawGameText((*i)->str, (*i)->font, (*i)->x, (*i)->y, theCamera.GetRotation()); + 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->maps->_XYMap[Game::currentY][Game::currentX]; + + x = ((((*i)->toFollow->GetBody()->GetWorldCenter().x + 0.5) - m.getXStart()) * 40) - 40; + y = -((((*i)->toFollow->GetBody()->GetWorldCenter().y - 0.5) - m.getYStart()) * 40) + 50; + if ((*i)->isFading) { + DrawGameText((*i)->str, (*i)->font, x, y - (*i)->y, theCamera.GetRotation()); + (*i)->y += 1; + } 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()); + } + } } } @@ -161,7 +246,7 @@ void HUDWindow::displayText(void) { * @param x X position * @param y Y position */ -void HUDWindow::addImage(std::string path, int x, int y) { +HUDActor *HUDWindow::addImage(std::string path, int x, int y) { HUDActor *tmp = new HUDActor(); tmp->SetSprite(path); tmp->SetPosition(x, y); @@ -169,6 +254,7 @@ void HUDWindow::addImage(std::string path, int x, int y) { tmp->SetDrawShape(ADS_Square); tmp->SetLayer(100); theWorld.Add(tmp); + return tmp; } //! Add an image @@ -179,7 +265,7 @@ void HUDWindow::addImage(std::string path, int x, int y) { * @param y Y position * @param size Size, in float. */ -void HUDWindow::addImage(std::string path, int x, int y, float size) { +HUDActor *HUDWindow::addImage(std::string path, int x, int y, float size) { HUDActor *tmp = new HUDActor(); tmp->SetSprite(path); tmp->SetPosition(x, y); @@ -187,8 +273,30 @@ void HUDWindow::addImage(std::string path, int x, int y, float size) { tmp->SetDrawShape(ADS_Square); tmp->SetLayer(100); theWorld.Add(tmp); + return tmp; +} + +//! Add an image +/** + * Add an image in the HUD + * @param path The path of the img + * @param x X position + * @param y Y position + * @param size Size, in float. + * @param layer The desired layer + */ +HUDActor *HUDWindow::addImage(std::string path, int x, int y, float size, int layer) { + HUDActor *tmp = new HUDActor(); + tmp->SetSprite(path); + tmp->SetPosition(x, y); + tmp->SetSize(size); + tmp->SetDrawShape(ADS_Square); + tmp->SetLayer(layer); + theWorld.Add(tmp); + return tmp; } + //! Display HP function /** * Life is life (lalala) @@ -197,7 +305,7 @@ void HUDWindow::addImage(std::string path, int x, int y, float size) { * @todo Empty heart, half-heart. */ void HUDWindow::life(int life) { - int x; + int x, v, sLife = life; std::list<HUDActor *>::iterator i; int index; HUDActor *tmp; @@ -218,6 +326,16 @@ void HUDWindow::life(int life) { life -= 25; } } + if (sLife < this->_maxHP) { + for (v = 0; (this->_maxHP - sLife) > v; v += 25) { + tmp = new HUDActor(); + tmp->SetSprite("Resources/Images/HUD/empty_heart.png"); + tmp->SetPosition((x + v), 38); + tmp->SetSize(30); + theWorld.Add(tmp); + this->_hearts.push_back(tmp); + } + } } //! Display mana function @@ -228,7 +346,7 @@ void HUDWindow::life(int life) { */ void HUDWindow::mana(int mana) { std::list<HUDActor *>::iterator i; - int x = 200, y, max = 90; + int x = 200, y, max = this->_maxMana; for (i = this->_mana.begin(); i != this->_mana.end(); i++) theWorld.Remove(*(i)); @@ -241,8 +359,11 @@ void HUDWindow::mana(int mana) { } if (y == max) this->addImage("Resources/Images/HUD/mp_bar_full_end.png", x, 60, 12.0f); - else - this->addImage("Resources/Images/HUD/mp_bar_end.png", x, 60, 12.0f); + else { + for (; y < max; y += 10, x += 11) + this->addImage("Resources/Images/HUD/mp_bar_empty.png", x, 60, 12.0f); + this->addImage("Resources/Images/HUD/mp_bar_empty_end.png", x, 60, 12.0f); + } } //! Display gold function @@ -266,7 +387,7 @@ void HUDWindow::gold(int gold) { void HUDWindow::updateGold(int gold) { this->removeText(this->_gold); this->_gold = this->setText((std::to_string(gold)), 375, 55, - Vector3(246.0f, 255.0f, 0.0f), 1); + Vector3(246.0f, 255.0f, 0.0f), 1); } //! Display items (Weapon) @@ -332,16 +453,56 @@ void HUDWindow::boots(void) { * Display the consumable (potions, etc) in the HUD * @todo Same here, no callback or object. */ -void HUDWindow::consumable(void) { - this->addImage("Resources/Images/HUD/consumable_background.png", 500, 50, 40.0f); - this->addImage("Resources/Images/HUD/potion_life.png", 500, 50, 25.0f); - this->addImage("Resources/Images/HUD/consumable_background.png", 550, 50, 40.0f); - this->addImage("Resources/Images/HUD/potion_life.png", 550, 50, 25.0f); - this->addImage("Resources/Images/HUD/consumable_background.png", 600, 50, 40.0f); - this->addImage("Resources/Images/HUD/potion_mana.png", 600, 50, 25.0f); +void HUDWindow::consumable(std::map<int, std::string> items) { + int i, x; + std::list<HUDActor *>::iterator it; + + for (it = this->_bag.begin(); it != this->_bag.end(); it++) + theWorld.Remove((*it)); + + for (i = 0, x = 445; i < 4; i++, x += 47) { + if (items[i] != "") { + HUDActor *tmp; + if (Game::wList->checkExists(items[i])) { + Weapon *w = new Weapon(Game::wList->getWeapon(items[i])); + tmp = this->addImage(w->getSprite(), x, 50, 30); + } else if (Game::aList->checkExists(items[i])) { + Armor* w = new Armor(Game::aList->getArmor(items[i])); + tmp = this->addImage(w->getSprite(), x, 50, 30); + } else if (Game::rList->checkExists(items[i])) { + Ring* w = new Ring(Game::rList->getRing(items[i])); + tmp = this->addImage(w->getSprite(), x, 50, 30); + } + this->_bag.push_back(tmp); + } + } } -//! Display the minimap in the HUd +//! Init the background of the minimap +void HUDWindow::initMinimapBackground(void) { + HUDActor *tmp; + + tmp = new HUDActor(); + tmp->SetSize(201, 100); + tmp->SetPosition(theCamera.GetWindowWidth() - 101, 50); + tmp->SetSprite("Resources/Images/HUD/minimap_background.png"); + tmp->SetDrawShape(ADS_Square); + theWorld.Add(tmp); +} + +void HUDWindow::_drawDoor(Vector2 size, Vector2 position) { + HUDActor *t; + + t = new HUDActor(); + t->SetColor(1, 1, 1); + t->SetDrawShape(ADS_Square); + t->SetPosition(position.X, position.Y); + t->SetSize(size.X, size.Y); + theWorld.Add(t); + this->_minimap.push_back(t); +} + +//! Display the minimap in the HUD /** * This function is not finished at all. * So don't use it. @@ -349,13 +510,69 @@ void HUDWindow::consumable(void) { * @todo Make this function work normally. */ void HUDWindow::minimap(void) { - HUDActor *minimap = new HUDActor(); + int x, y, x2, y2; + HUDActor *tmp; + std::list<HUDActor *>::iterator it; - minimap->SetSize(200, 100); - minimap->SetPosition(theCamera.GetWindowWidth() - 100, 50); - minimap->SetColor(1, 0, 0); - minimap->SetDrawShape(ADS_Square); - theWorld.Add(minimap); + for (it = this->_minimap.begin(); it != this->_minimap.end(); it++) + theWorld.Remove(*it); + + x = theCamera.GetWindowWidth() - 180; + y = 18; + for (x2 = Game::currentX - 2, y2 = Game::currentY - 1; ; x2++, x += 41) { + if (x2 == Game::currentX + 4) { + y2++; + x2 = Game::currentX - 2; + y += 28; + x = theCamera.GetWindowWidth() - 180; + if (y2 == Game::currentY + 2) + break; + } + if (Game::currentGame->maps->getMapXY()[y2][x2].getIsUsed()) { + tmp = new HUDActor(); + tmp->SetSize(40, 27); + tmp->SetPosition(x, y); + if (x2 == Game::currentX && y2 == Game::currentY) + tmp->SetColor(0, 1, 0); + else + tmp->SetColor(1, 1, 1); + tmp->SetDrawShape(ADS_Square); + theWorld.Add(tmp); + this->_minimap.push_back(tmp); + + if (Game::currentGame->maps->getMapXY()[y2][x2 + 1].getXStart()) + this->_drawDoor(Vector2(1, 5), Vector2(x + (40 / 2), y)); + if (Game::currentGame->maps->getMapXY()[y2][x2 - 1].getXStart()) + this->_drawDoor(Vector2(1, 5), Vector2(x - (40 / 2), y)); + if (Game::currentGame->maps->getMapXY()[y2 - 1][x2].getXStart()) + this->_drawDoor(Vector2(5, 1), Vector2(x, y - (27 / 2) - 1)); + if (Game::currentGame->maps->getMapXY()[y2 + 1][x2].getXStart()) + this->_drawDoor(Vector2(5, 1), Vector2(x, y + (27 / 2) - 1)); + } + } +} + +//! Bag display function +/** + * This function display an empty bag at the beggining of the game + */ +void HUDWindow::bag(void) { + HUDActor *bag = new HUDActor(); + int i, x; + + bag->SetSize(200, 60); + bag->SetPosition(theCamera.GetWindowWidth() - 510, 50); + bag->SetSprite("Resources/Images/bag.png"); + bag->SetDrawShape(ADS_Square); + theWorld.Add(bag); + + for (i = 0, x = 445; i < 4; i++, x += 47) { + this->addImage("Resources/Images/bag_slot.png", x, 51, 40); + this->addImage("Resources/Images/round.png", x + 15, 65, 20, 200); + this->setText("S-" + std::to_string(i + 1), x + 10, 67, Vector3(255, 255, 255), 1, "SmallGamefont"); + } } void HUDWindow::setGame(Game *g) { this->_g = g; }; +void HUDWindow::setMaxMana(int m) { this->_maxMana = m; }; +void HUDWindow::setMaxHP(int h) { this->_maxHP = h; }; diff --git a/Sources/src/Hero.cpp b/Sources/src/Hero.cpp @@ -34,6 +34,9 @@ Hero::Hero(void) : Characters("Hero") { theSwitchboard.SubscribeTo(this, "endInvincibility"); theSwitchboard.SubscribeTo(this, "enableAttackHitbox"); theSwitchboard.SubscribeTo(this, "disableAttackHitbox"); + theSwitchboard.SubscribeTo(this, "equipSelectedItem"); + theSwitchboard.SubscribeTo(this, "cycleInventory"); + return ; } @@ -63,9 +66,11 @@ void Hero::init(void) { * @todo Extract the values from the consumable */ void Hero::actionCallback(std::string name, int status) { - if (name == "attack" && status == 1 && this->_weapon->attackReady() == 1) { - std::string orientation; - float x = 2, y = 1; + std::string orientation; + float x = 2, y = 1; + if (name == "attack" && status == 0 && this->_weapon->attackReady() == 1 && + this->_fullChargedAttack == false && this->_isLoadingAttack == 0 && + this->_isAttacking == 1) { this->_weapon->isAttacking(0); if (this->_orientation == RIGHT) { orientation = "right"; @@ -79,10 +84,49 @@ void Hero::actionCallback(std::string name, int status) { orientation = "down"; } this->changeSizeTo(Vector2(x, y)); + this->_setCategory("attack"); this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, - this->_getAttr("beginFrame_" + orientation).asInt(), - this->_getAttr("endFrame_" + orientation).asInt(), "base"); + this->_getAttr("beginFrame_" + + orientation).asInt(), + this->_getAttr("endFrame_" + + orientation).asInt(), "base"); + } else if (name == "attack" && status == 0 && + this->_weapon->attackReady() == 1 && + this->_fullChargedAttack == true) { + if (this->_orientation == RIGHT) { + orientation = "right"; + } else if (this->_orientation == LEFT) { + orientation = "left"; + } else if (this->_orientation == UP) { + x = 1.5f; y = 2; + orientation = "up"; + } else if (this->_orientation == DOWN) { + x = 1; y = 2.5f; + orientation = "down"; + } + this->_setCategory("loadAttack_done"); + this->_weapon->isAttacking(0); + this->_isLoadingAttack = 0; + this->_fullChargedAttack = false; + this->changeSizeTo(Vector2(2, 2)); + if (this->_latOrientation == LEFT) + this->GetBody()->SetLinearVelocity(b2Vec2(-5, 3)); + else + this->GetBody()->SetLinearVelocity(b2Vec2(5, 3)); + this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, + this->_getAttr("beginFrame_" + orientation).asInt(), + this->_getAttr("endFrame_" + orientation).asInt(), "base"); + } else if (name == "loadAttack_charge") { + if (this->_latOrientation == RIGHT) { + orientation = "right"; + } else if (this->_latOrientation == LEFT) + orientation = "left"; + this->_setCategory("loadAttack_charge"); + this->changeSizeTo(Vector2(2, 2)); + this->PlaySpriteAnimation(this->_getAttr("time").asFloat(), SAT_OneShot, + this->_getAttr("beginFrame_" + orientation).asInt(), + this->_getAttr("endFrame_" + orientation).asInt()); } return ; } @@ -110,16 +154,26 @@ void Hero::BeginContact(Elements* elem, b2Contact *contact) { if (this->_hp != this->_maxHp) { Game::addToDestroyList(elem); this->setHP(this->getHP() + stoi(elem->getAttribute("value"))); + Game::currentGame->tooltip->tip(elem, this); Game::getHUD()->life(this->getHP()); } + } else if (elem->getAttribute("type3") == "mana") { + if (this->_mana < this->_maxMana) { + Game::addToDestroyList(elem); + this->setMana(this->getMana() + stoi(elem->getAttribute("value"))); + Game::currentGame->tooltip->tip(elem, this); + Game::getHUD()->mana(this->getMana()); + } } if (elem->getAttribute("type3") == "gold") { Game::addToDestroyList(elem); this->_gold += stoi(elem->getAttribute("value")); + Game::currentGame->tooltip->tip(elem, this); Game::getHUD()->updateGold(this->getGold()); } } else if (elem->getAttribute("type2") == "Equipment") { + Game::currentGame->tooltip->info(elem); this->_item = elem; } } @@ -143,15 +197,18 @@ void Hero::BeginContact(Elements* elem, b2Contact *contact) { */ void Hero::EndContact(Elements *elem, b2Contact *contact) { Characters::EndContact(elem, contact); - if (elem->getAttribute("type") == "Object") { - if (elem->getAttributes()["type2"] == "Equipment") { - this->_item = nullptr; + if (elem->getAttribute("type") == "Object") { + if (elem->getAttributes()["type2"] == "Equipment") { + this->_item = nullptr; + } + } + if (elem->getAttribute("type") == "Enemy" || + elem->getAttribute("speType") == "spikes") { + this->_enemiesTouched.remove(elem); + } + if (elem->getAttribute("type2") == "Equipment") { + Game::currentGame->tooltip->clearInfo(); } - } - if (elem->getAttribute("type") == "Enemy" || - elem->getAttribute("speType") == "spikes") { - this->_enemiesTouched.remove(elem); - } /* if (elem->getAttribute("speType") == "water")*/ /*this->GetBody()->SetGravityScale(1);*/ } @@ -160,6 +217,7 @@ void Hero::EndContact(Elements *elem, b2Contact *contact) { /** * Called by BeginContact mostly * @param the elem that has damaged hero + * @todo monster damage should not be hard-written to 25 */ void Hero::_takeDamage(Elements* elem) { this->GetBody()->SetLinearVelocity(b2Vec2(0, 0)); diff --git a/Sources/src/Hitbox.cpp b/Sources/src/Hitbox.cpp @@ -62,7 +62,7 @@ b2PolygonShape Hitbox::_getPolygon(std::string res) { fd.open(file.c_str()); if (!fd.is_open()) Log::error("Can't open the file for the " + - res + " hitbox. (Expected path is Resources/Elements/Hitbox/" + res +".json)"); + res + " hitbox. (Expected path is Resources/Elements/Hitbox/" + res +".json)"); buffer << fd.rdbuf(); return this->_parseJson(buffer.str()); } @@ -76,7 +76,7 @@ b2PolygonShape Hitbox::_parseJson(std::string file) { std::vector<std::vector<int> > map; std::vector<int> tmp; - if (!read.parse(file, json)) + if (!read.parse(file, json)) Log::error("Error in json syntax :\n" + read.getFormattedErrorMessages()); hitbox = json["data"]["hitbox"]; @@ -112,15 +112,19 @@ b2PolygonShape Hitbox::_parseVertices(int v, std::vector<std::vector<int> > map) std::vector<int>::iterator itr2; std::vector<std::vector<int> >::reverse_iterator ritr; std::vector<int>::reverse_iterator ritr2; - b2Vec2 vertices[v]/* = new b2Vec2[v]*/; + b2Vec2 vertices[8]/* = new b2Vec2[8]*/; + //std::vector<b2Vec2> vertices(v * 8); + + //vertices = (b2Vec2 *)malloc(sizeof(b2Vec2) * v + 1); + int i = 0; + b2PolygonShape box; - int i = 0; float x2, y2, x, y = 0; for (itr = map.begin(); itr != map.end(); itr++, y++) { for (itr2 = (*itr).begin(), x = 0; itr2 != (*itr).end(); itr2++, x++) { if ((*itr2) == 1) { -// std::cout << x - 5 << ":" << -(y - 5) << std::endl; + // std::cout << x - 5 << ":" << -(y - 5) << std::endl; vertices[i].Set((x - 5) / 10, -(y - 5)/ 10 ); i++; x = 0; @@ -132,7 +136,7 @@ b2PolygonShape Hitbox::_parseVertices(int v, std::vector<std::vector<int> > map) for (ritr2 = (*ritr).rbegin(), x = 10; ritr2 != (*ritr).rend(); ritr2++, x--) { if ((*ritr2) == 1) { vertices[i].Set((x - 5) / 10, -(y - 5)/ 10 ); -// std::cout << x - 5 << ":" << -(y - 5) << std::endl; + // std::cout << x - 5 << ":" << -(y - 5) << std::endl; i++; break ; } diff --git a/Sources/src/Inventory.cpp b/Sources/src/Inventory.cpp @@ -0,0 +1,101 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * File: Inventory.cpp + * Creation: 2015-05-27 04:44 + * Vincent Rey <vrey@student.42.fr> + */ + +# include "Inventory.hpp" + +//! Main constructor +/** + * Constructor that initiates the inventory for a given character + * @param slots the number of slots you wanna give the inventory + */ + +Inventory::Inventory(int slots): _slots(slots), _focused(0), _inInventory(0) { +} + +//! change the currently selected item +/** + * Called by character when pressing the item button, + * to target another item for dropping/equipping + */ +void Inventory::changeItemFocus(void) { + if (this->_slots == 1) + return; + else if (this->_focused < this->_slots - 1) { + this->_focused++; + } else + this->_focused = 0; + std::cout << this->_focused << ": " << this->_items[this->_focused] << std::endl; + + +} + + +//! Called by char when picking up an item +/** + * When inventory is full, returns 1 and the game automatically drops the selected item through + * dropSelectedItem + * @param item the name of the item to add in the inventory + * @sa Characters::pickupItem + */ + +int Inventory::addItemToInventory(std::string item) { + if (!this->_items.empty() && this->_inInventory > 0 && + this->_items[this->_focused] != "") + return 1; + else { + this->_items[this->_focused] = item; + this->_inInventory++; + } + Game::getHUD()->consumable(this->_items); +} + + +std::string Inventory::getCurrentFocus(void) { + return this->_items[this->_focused]; +} + +void Inventory::swapEquipmentAndInventory(std::string item) { + this->_items[this->_focused] = item; +} + +std::string Inventory::dropSelectedItem(void) { + + std::string itemName; + + itemName = this->_items[this->_focused]; + this->_items[this->_focused].clear(); + this->_inInventory--; + return itemName; +} + +std::string Inventory::equipSelectedItem(void) { + if (this->_items[this->_focused].empty()) { + return ""; + } + return this->_items[this->_focused]; +} + +/* GETTERS */ +std::map<int, std::string> Inventory::getItems(void) { return this->_items; }; diff --git a/Sources/src/LevelGenerator.cpp b/Sources/src/LevelGenerator.cpp @@ -1,39 +1,39 @@ /** -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ /** -* File: LevelGenerator.cpp -* Creation: 2015-03-02 16:05 -* Matthieu Maudet <mmaudet@student.42.fr> -*/ + * File: LevelGenerator.cpp + * Creation: 2015-03-02 16:05 + * Matthieu Maudet <mmaudet@student.42.fr> + */ # include "LevelGenerator.hpp" # include "Room.hpp" /** -* Standard constructor with : -* - Height and Width -* - minPathLenght : Min path between entry and exit rooms -* - roomPopRate (of 100%) : Chances for a room to pop on given slot -* - doorsPopRate (of 100%) : Chances for a door to pop on given wall -* - nbMaps : Number of different maps -*/ + * Standard constructor with : + * - Height and Width + * - minPathLenght : Min path between entry and exit rooms + * - roomPopRate (of 100%) : Chances for a room to pop on given slot + * - doorsPopRate (of 100%) : Chances for a door to pop on given wall + * - nbMaps : Number of different maps + */ LevelGenerator::LevelGenerator(int maxMapSize, int minPathLenght, int doorsPopRate) : _maxMapSize(maxMapSize), _minPathLenght(minPathLenght), _doorsPopRate(doorsPopRate) { srand(time(NULL)); _rooms = new std::vector<Room*>; @@ -44,15 +44,16 @@ LevelGenerator::LevelGenerator(int maxMapSize, int minPathLenght, int doorsPopRa } /** -* Basic Destructor -*/ + * Basic Destructor + */ LevelGenerator::~LevelGenerator(void) { return; } void LevelGenerator::execute(void) { + int i; createFirstRoom(); - for (int distance = 0; distance < _maxMapSize; distance++) + for (int distance = 0; distance <= _maxMapSize; distance++) firstPass(distance); } @@ -140,3 +141,90 @@ bool LevelGenerator::testDoor(int x, int y) { return true; return false; } + +int LevelGenerator::getNbMaps(void) { + return this->_nbMaps; +} + +std::vector<std::vector<int> > LevelGenerator::getLevel(void) { + std::vector<std::vector<int> > map; + std::vector<std::vector<Room *> > roomMap; + int i, j, score, mid, maxDistance; + Room *tmp, *first; + + mid = this->_maxMapSize; + for (i = maxDistance = 0; i < this->_rooms->size(); i++) + maxDistance = (this->_rooms->at(i)->getDistance() > maxDistance ? + this->_rooms->at(i)->getDistance() : maxDistance); + if ((this->_maxMapSize / 2) < maxDistance) + this->_maxMapSize += maxDistance * 2; + for (i = 0; i < this->_maxMapSize; i++) { + map.push_back(std::vector<int>(this->_maxMapSize * 2)); + roomMap.push_back(std::vector<Room *>(this->_maxMapSize)); + } + map.push_back(std::vector<int>(this->_maxMapSize * 2)); + map.push_back(std::vector<int>(this->_maxMapSize * 2)); + map.push_back(std::vector<int>(this->_maxMapSize * 2)); + map.push_back(std::vector<int>(this->_maxMapSize * 2)); + map.push_back(std::vector<int>(this->_maxMapSize * 2)); + mid += 4; + for (i = score = 0; i < this->_rooms->size(); i++, score = 0) { + tmp = this->_rooms->at(i); + if (tmp->getTopDoor()) + score++; + if (tmp->getRightDoor()) + score += 2; + if (tmp->getBottomDoor()) + score += 4; + if (tmp->getLeftDoor()) + score += 8; + map[mid - tmp->getY()][tmp->getX() + mid] = score; + roomMap[mid - tmp->getY()][tmp->getX() + mid] = tmp; + if (tmp->getY() == 0 && tmp->getX() == 0) { + this->_startX = tmp->getX() + mid; + this->_startY = tmp->getY() + mid; + } + } + for (i = 0; i < map.size(); i++) { + for (j = 0; j < map[i].size(); j++) { + if (map[i][j]) { + // If a door is open and there is no room behind it + if (roomMap[i][j]->getTopDoor()) { + if ((i - 1) < 0) + map[i][j]--; + else if (!map[i - 1][j]) + map[i][j]--; + } if (roomMap[i][j]->getRightDoor()) { + if ((j + 1) > map[i].size()) + map[i][j] -= 2; + else if (!map[i][j + 1]) + map[i][j] -= 2; + } if (roomMap[i][j]->getBottomDoor()) { + if ((i + 1) > map.size()) + map[i][j] -= 4; + else if (!map[i + 1][j]) + map[i][j] -= 4; + } if (roomMap[i][j]->getLeftDoor()) { + if ((j - 1) < 0) + map[i][j] -= 8; + else if (!map[i][j - 1]) + map[i][j] -= 8; + } + + // If a door is closed and there is a room behind it + if (!roomMap[i][j]->getTopDoor() && i > 0 && roomMap[i - 1][j]) + map[i][j]++; + if (!roomMap[i][j]->getRightDoor() && (j + 1) < roomMap[i].size() && roomMap[i][j + 1]) + map[i][j] += 2; + if (!roomMap[i][j]->getBottomDoor() && (i + 1) < roomMap.size() && roomMap[i + 1][j]) + map[i][j] += 4; + if (!roomMap[i][j]->getLeftDoor() && j > 0 && roomMap[i][j - 1]) + map[i][j] += 8; + } + } + } + return map; +} + +int LevelGenerator::getStartX(void) { return this->_startX; }; +int LevelGenerator::getStartY(void) { return this->_startY; }; diff --git a/Sources/src/Loot.cpp b/Sources/src/Loot.cpp @@ -36,24 +36,29 @@ Loot::Loot(Characters* c) { int i; if (rand() % 100 <= c->_getAttr("loot", "consumableRate").asInt()) { if (rand() % 2 == 0) { - new Consumable("HP", c->_getAttr("loot", "HPReward").asString(), c); - } else + new Consumable("HP", c->_getAttr("loot", "HPReward").asString(), c); + } else new Consumable("gold", c->_getAttr("loot", "XPReward").asString(), c); } else if (rand() % 100 <= c->_getAttr("loot", "equipmentRate").asInt()) { - if (rand() % 2 == 1) - new Equipment(Game::wList->getWeaponRandom(c->_getAttr("loot", "EqReward").asInt()), c); - else if (rand() % 2 == 1) - new Equipment(Game::aList->getArmorRandom(c->_getAttr("loot", "EqReward").asInt()), c); + int rant; + rant = rand() % 3; + if (rant == 1) + new Equipment(Game::wList->getWeaponRandom(c->_getAttr("loot", "EqReward").asInt()), c); + else if (rant == 0) + new Equipment(Game::aList->getArmorRandom(c->_getAttr("loot", "EqReward").asInt()), c); else new Equipment(Game::rList->getRingRandom(c->_getAttr("loot", "EqReward").asInt()), c); } } -Loot::Loot(Characters* c, Equipment *toDrop) { - if (toDrop->getAttribute("type3") == "Weapon") +Loot::Loot(Characters* c, Weapon *toDrop) { new Equipment(Game::wList->getWeapon(toDrop->getName()), c); - else if (toDrop->getAttribute("type3") == "Armor") +} + +Loot::Loot(Characters* c, Armor *toDrop) { new Equipment(Game::aList->getArmor(toDrop->getName()), c); - else if (toDrop->getAttribute("type3") == "Ring") +} + +Loot::Loot(Characters* c, Ring *toDrop) { new Equipment(Game::rList->getRing(toDrop->getName()), c); } diff --git a/Sources/src/Map.cpp b/Sources/src/Map.cpp @@ -55,13 +55,15 @@ void Map::setTileWidth(int w) { this->_tileWidth = w; }; void Map::setImageHeight(int h) { this->_imageHeight = h; }; void Map::setImageWidth(int w) { this->_imageWidth = w; }; void Map::setProperties(std::map<int, std::map<std::string, Json::Value> > p) { this->_properties = p; }; -void Map::addElement(Elements *e) { this->_elems.push_back(e); }; +void Map::addElement(Elements * e) { ; }; void Map::addMapElement(int n) { ; }; void Map::setLayer(int n) {this->_layer = n; }; void Map::setMap(std::vector<int> map) { this->_map.push_back(map); }; void Map::setXStart(int x) { this->_xStart = x; }; void Map::setYStart(int y) { this->_yStart = y; }; void Map::setUsed(int n) { this->_isUsed = n; }; +std::list<Enemy *> Map::getEnemies(void) { return this->_enemies; }; +std::vector<std::vector<int> > Map::getPhysicMap(void) { return this->_physicMap; }; /* GETTERS */ @@ -71,20 +73,26 @@ int Map::getXMid(void) { return (this->_xStart + (this->_width / 2)); }; int Map::getYMid(void) { return this->_yStart - (this->_height / 2); }; int Map::getXStart(void) { return this->_xStart; }; int Map::getYStart(void) { return this->_yStart; }; +int Map::getIsUsed(void) { return this->_isUsed; }; //! Display the map /** * Iterate and display the element of a map. * Lot's of stuff in this function, but the code's pretty clear, see source for more information */ -void Map::display(void) { +Map Map::display(void) { float x, y; std::list<std::vector <int> >::iterator layers; std::vector<int>::iterator it; Elements *elem; int v = 0; - for (layers = this->_map.begin(); layers != this->_map.end(); layers++, v++) { + // Allocation for the _physicMap + if (!this->_isUsed) { + for (v = 0; v < this->_height; v++) + this->_physicMap.push_back(std::vector<int>(this->getWidth())); + } + for (layers = this->_map.begin(), v = 0; layers != this->_map.end(); layers++, v++) { x = this->_xStart; y = this->_yStart; Enemy *tmp; @@ -110,6 +118,7 @@ void Map::display(void) { elem->SetLayer(v); if (this->_properties.find(*it) == this->_properties.end()) { elem->addAttribute("physic", "TRUE"); + this->_physicMap[-(y - this->_yStart)][x - this->_xStart] = 1; } else { std::map<std::string, Json::Value>::iterator it2; int isPhysic = 1, isAnimated = 0; @@ -127,8 +136,12 @@ void Map::display(void) { elem->addAttribute(it2->first, it2->second.asString()); } } - if (isPhysic == 1) + if (isPhysic == 1) { elem->addAttribute("physic", "TRUE"); + this->_physicMap[-(y - this->_yStart)][x - this->_xStart] = 1; + } else { + this->_physicMap[-(y - this->_yStart)][x - this->_xStart] = 0; + } if (isAnimated == 1) { int v = atoi(elem->getAttribute("next").c_str()), next, count; float time; @@ -158,16 +171,64 @@ void Map::display(void) { } } if (elem->getAttribute("spawnEnemy") != "") { - if (elem->getAttribute("isFlying") != "") - tmp = new Enemy(Game::eList->getEnemyRandom(true)); - else - tmp = new Enemy(Game::eList->getEnemyRandom(false)); - tmp->setXStart(x); - tmp->setYStart(y); - tmp->init(); + if (!this->_isUsed) { + if (elem->getAttribute("isFlying") != "") + tmp = new Enemy(Game::eList->getEnemyRandom(true)); + else + tmp = new Enemy(Game::eList->getEnemyRandom(false)); + PassivePattern *p = new PassivePattern(); + tmp->setXStart(x); + tmp->setYStart(y); + tmp->setMap(this); + p->setEnemy(tmp); + tmp->setPattern(p); + tmp->init(); + tmp->GetBody()->ApplyLinearImpulse(b2Vec2(0, 3), b2Vec2(0, 0)); + this->_enemies.push_back(tmp); + } else { + std::list<Enemy *>::iterator en; + for (en = this->_enemies.begin(); en != this->_enemies.end(); en++) { + if (!(*en)->dead()) { + (*en)->GetBody()->SetActive(true); + (*en)->GetBody()->SetTransform(b2Vec2((*en)->getXStart(), (*en)->getYStart()), + (*en)->GetBody()->GetAngle()); + } + } + } } elem->display(); + this->_elemOfTheMap.push_back(elem); } } } + this->_isUsed = 1; + return *this; +} + +void Map::destroyMap(void) { + std::list<Elements *>::iterator it; + std::list<Enemy *>::iterator en; + + // Remove physics and remove the element + for (it = this->_elemOfTheMap.begin(); it != this->_elemOfTheMap.end(); it++) { + if ((*it)->getAttribute("physic") != "") { + (*it)->GetBody()->SetActive(false); + } + theWorld.Remove(*it); + } + + // Pause enemies + for (en = this->_enemies.begin(); en != this->_enemies.end(); en++) { + if (!(*en)->dead()) + (*en)->GetBody()->SetActive(false); + } +} + +void Map::callAllPatterns(void) { + std::list<Enemy *>::iterator en; + + //for (en = this->_enemies.begin(); en != this->_enemies.end(); en++) { + //if (!(*en)->dead()) + //(*en)->getPattern()->tick(*this); + /*}*/ } diff --git a/Sources/src/Maps.cpp b/Sources/src/Maps.cpp @@ -57,7 +57,7 @@ int Maps::rstrncmp(char *str, char *str2, int n) { int i, j; for (i = (strlen(str) - 1), j = (strlen(str2) - 1); str[i] && (i - strlen(str)) > -(n) - && str[i] == str2[j]; i--, j--); + && str[i] == str2[j]; i--, j--); if ((i - strlen(str)) == -(n)) return 0; return 1; @@ -137,13 +137,13 @@ void Maps::_getMap(void) { 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++) { - if (j.key().asString() == "doorUp") + if (j.key().asString() == "doorUp" || j.key().asString() == "door_up") n++; - if (j.key().asString() == "doorRight") + if (j.key().asString() == "doorRight" || j.key().asString() == "door_right") n += 2; - if (j.key().asString() == "doorDown") + if (j.key().asString() == "doorDown" || j.key().asString() == "door_down") n += 4; - if (j.key().asString() == "doorLeft") + if (j.key().asString() == "doorLeft" || j.key().asString() == "door_left") n += 8; } if (n != 0) @@ -162,10 +162,10 @@ void Maps::displayLevel(std::vector<std::vector<int> > map) { for (maxX = maxY = 0; maxY < (map.size() - 1); maxY++) { if ((map[maxY].size() - 1) > maxX) maxX = map[maxY].size() - 1; - this->_XYMap.push_back(std::map<int, Map *>()); + this->_XYMap.push_back(std::vector<Map>(16)); } // Last allocation (y <= maxY), so + 1 - this->_XYMap.push_back(std::map<int, Map *>()); + this->_XYMap.push_back(std::vector<Map>(16)); for (x = y = rX = rY = 0; y <= maxY; x++) { if (x > maxX) { @@ -180,10 +180,10 @@ void Maps::displayLevel(std::vector<std::vector<int> > map) { tmp = this->getMapByDoor(i); tmp->setXStart(rX); tmp->setYStart(rY); - tmp->display(); - this->_XYMap[y][x] = tmp; - } else - this->_XYMap[y][x] = nullptr; + this->_XYMap[y][x] = *tmp; + } else { + //this->_XYMap[y][x] = *(new Map()); + } rX += 27; } } @@ -205,4 +205,4 @@ Map *Maps::getMapByDoor(int n) { } -std::vector<std::map<int, Map *> > Maps::getMapXY(void) { return this->_XYMap; }; +std::vector<std::vector<Map> > Maps::getMapXY(void) { return this->_XYMap; }; diff --git a/Sources/src/Object.cpp b/Sources/src/Object.cpp @@ -32,11 +32,10 @@ Object::Object(void) { this->addAttribute("physic", "1"); this->addAttribute("type", "Object"); - this->SetDensity(0); + this->SetDensity(1); this->SetFriction(1.0f); - this->SetRestitution(0.0f); + this->SetRestitution(0.5f); this->SetFixedRotation(true); - this->SetIsSensor(true); } //! Overload from b2Body's BeginContact @@ -47,10 +46,6 @@ Object::Object(void) { * @note This function is called just before a collision */ void Object::BeginContact(Elements *elem, b2Contact *contact) { - if (elem->getAttributes()["type"] == "Hero"){ - static_cast<Characters*>(elem)->equipWeapon(Game::wList->getWeapon("Bow")); - Game::bodiesToDestroy.push_back(this); - } } //! Destructor diff --git a/Sources/src/PassivePattern.cpp b/Sources/src/PassivePattern.cpp @@ -0,0 +1,59 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * File: PassivePattern.cpp + * Creation: 2015-05-03 10:25 + * Louis Solofrizzo <louis@ne02ptzero.me> + */ + +# include "PassivePattern.hpp" + +PassivePattern::PassivePattern(void) : CPattern("passive"), _tickNumber(0) { + +} + +PassivePattern::~PassivePattern(void) { +} + +void PassivePattern::tick(Map m) { + CPattern::tick(m); + + if (this->_orientation == 1) { + if (!m.getPhysicMap()[this->_y + 1][this->_x + 1]) { + this->_orientation = 2; + this->_enemy->_backward(1); + } else if (!m.getPhysicMap()[this->_y][this->_x + 1]) + this->_enemy->_forward(1); + else if (m.getPhysicMap()[this->_y][this->_x + 1]) { + this->_orientation = 2; + this->_enemy->_backward(1); + } + } else if (this->_orientation == 2) { + if (!m.getPhysicMap()[this->_y +1][this->_x - 1]) { + this->_orientation = 1; + this->_enemy->_forward(1); + } else if (!m.getPhysicMap()[this->_y][this->_x - 1]) + this->_enemy->_backward(1); + else if (m.getPhysicMap()[this->_y][this->_x - 1]) { + this->_orientation = 1; + this->_enemy->_forward(1); + } + } +} diff --git a/Sources/src/Pattern.cpp b/Sources/src/Pattern.cpp @@ -0,0 +1,76 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * File: Pattern.cpp + * Creation: 2015-05-03 10:22 + * Louis Solofrizzo <louis@ne02ptzero.me> + */ + +# include "Pattern.hpp" + +//! Basic constructor +/** + * This a void constructor, useless ftm. + */ +CPattern::CPattern(void) { + +} + +//! Main constructor +/** + * That's the main constructor for a pattern, using the pattern name in argue. + * @param name The name of the Pattern. + */ +CPattern::CPattern(std::string name) : _name(name), _orientation(1) { + ; +} + +//! Copy constructor +/** + * Copy constructor of Pattern (Coplien o/) + */ +CPattern::CPattern(CPattern & p) { + this->_name = p.getName(); + this->_enemy = p.getEnemy(); +} + +//! Destructor +CPattern::~CPattern(void) { + +} + +//! Basic pattern tick. +/** + * This function is virtual, just here for structure purposes. + * If you looking for the actual code of a pattern, go if the Pattern child itself. + */ +void CPattern::tick(Map m) { + this->_x = (this->_enemy->GetBody()->GetWorldCenter().x + 0.5) - m.getXStart(); + this->_y = -((this->_enemy->GetBody()->GetWorldCenter().y - 0.5) - m.getYStart()); +} + +/* SETTERS */ + +void CPattern::setEnemy(Enemy *e) { this->_enemy = e; }; + +/* GETTERS */ + +std::string CPattern::getName(void) { return this->_name; }; +Enemy *CPattern::getEnemy(void) { return this->_enemy; }; diff --git a/Sources/src/Ring.cpp b/Sources/src/Ring.cpp @@ -45,8 +45,12 @@ Ring::Ring(Ring* Ring) { this->_flavor = Ring->getFlavor(); this->_sprite = Ring->getSprite(); this->addAttribute("type3", "Ring"); + this->addAttribute("name", this->_name); this->_lootLevel = Ring->getLootLevel(); - this->_bonus = Ring->getBonus(); + if (Ring->getAttribute("hpBuff") != "") + this->addAttribute("hpBuff", Ring->getAttribute("hpBuff")); + if (Ring->getAttribute("manaBuff") != "") + this->addAttribute("manaBuff", Ring->getAttribute("manaBuff")); } @@ -94,11 +98,9 @@ void Ring::_parseJson(std::string file) { this->_flavor = json["infos"].get("flavor", "").asString(); this->_lootLevel = json["infos"].get("lootLevel", "").asInt(); this->_sprite = json["infos"].get("sprites", "").asString(); - if (!json["infos"].get("bonus", "").empty()){ - this->_bonus = new Bonus(Bonus::parseType(json["infos"].get("bonus", "").get("type", "none").asString()), json["infos"].get("bonus", "").get("amount", 0).asInt()); - } else { - this->_bonus = nullptr; - } + for (i = json["bonus"].begin(); i != json["bonus"].end(); i++) + this->addAttribute( i.key().asString(), (*i).asString()); + this->addAttribute("type3", "Armor"); this->addAttribute("type3", "Ring"); } @@ -126,7 +128,6 @@ void Ring::ReceiveMessage(Message *m) { } /* GETTERS */ -Bonus* Ring::getBonus(void) { return this->_bonus; } std::string Ring::getName(void) { return this->_name; } std::string Ring::getFlavor(void) { return this->_flavor; } std::string Ring::getSprite(void) { return this->_sprite; } diff --git a/Sources/src/RingList.cpp b/Sources/src/RingList.cpp @@ -54,6 +54,17 @@ RingList::~RingList(void) { return; } +int RingList::checkExists(std::string name) { + std::list<Ring*>::iterator it; + + for (it = this->_allRings.begin(); it != this->_allRings.end(); it++) { + if (name == (*it)->getName()) { + return 1; + } + } + return 0; +} + //! Returns a Ring in order to use it afterwards /** * Get a Ring obj by name diff --git a/Sources/src/Room.cpp b/Sources/src/Room.cpp @@ -32,7 +32,8 @@ Room::Room(int id, int y, int x, int distance, int mapId, bool topDoor, bool leftDoor, bool bottomDoor, bool rightDoor) : _id(id), _y(y), _x(x), _distance(distance), _mapId(mapId), _topDoor(topDoor), _leftDoor(leftDoor), _bottomDoor(bottomDoor), - _rightDoor(rightDoor) { + _rightDoor(rightDoor), _bottomRoom(nullptr), _rightRoom(nullptr), + _topRoom(nullptr), _leftRoom(nullptr) { _links = 0; _specialType = NONE; @@ -153,3 +154,23 @@ void Room::setDistance(int distance) { void Room::setSpecialType(SpecialType type) { this->_specialType = type; } + +void Room::closeDoor(void) { + if (!this->_topRoom && this->_topDoor) { + this->_topDoor = false; + std::cout << "Closing top door" << std::endl; + } + if (!this->_leftRoom && this->_leftDoor) { + this->_leftDoor = false; + std::cout << "Closing left door" << std::endl; + } + if (!this->_bottomRoom && this->_bottomDoor) { + this->_bottomDoor = false; + std::cout << "Closing bottom door" << std::endl; + } + if (!this->_rightRoom && this->_rightDoor) { + this->_rightDoor = false; + std::cout << "Closing right door" << std::endl; + } + +} diff --git a/Sources/src/Tooltip.cpp b/Sources/src/Tooltip.cpp @@ -0,0 +1,102 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * File: Tooltip.cpp + * Creation: 2015-06-03 14:57 + * Manon Budin <mbudin@student.42.fr> + */ + +#include "Tooltip.hpp" + +//! Constructor +/** + * Basic constructor + */ + +Tooltip::Tooltip() : _name("") { + theSwitchboard.SubscribeTo(this, "deleteTip"); + return ; +} + + + +//! Destructor +/** + * Basic Destructor + */ + +Tooltip::~Tooltip() { + return ; +} + +//! Parse the type of the loot +/** + * Parse the type and set color and value + * @param elem The Loot + * @param c The Character + */ + +void Tooltip::tip(Elements *elem, Characters *c) { + std::string type = elem->getAttribute("type3"); + HUDWindow *hud = Game::getHUD(); + std::string val; + + if (type == "gold") { + val = elem->getAttribute("value"); + hud->setText("+" + val , c, Vector3(255, 204, 0), 1, 0); + } else if (type == "HP") { + val = elem->getAttribute("value"); + hud->setText("+" + val , c, Vector3(255, 0, 0), 1, 0); + } else if (type == "mana") { + val = elem->getAttribute("value"); + hud->setText("+" + val , c, Vector3(255, 51, 255), 1, 0); + } + this->_val = "+" + val; + theSwitchboard.DeferredBroadcast(new Message("deleteTip"), 2); + +} + +void Tooltip::info(Elements *elem) { + if (this->_name == "") { + HUDActor *equip = new HUDActor(); + HUDWindow *hud = Game::getHUD(); + this->_equip = equip; + this->_name = elem->getAttribute("name"); + + equip->SetSize(200, 100); + equip->SetPosition(theCamera.GetWindowWidth() - 100, 50); + equip->SetColor(0, 0, 0); + equip->SetDrawShape(ADS_Square); + theWorld.Add(equip); + hud->setText(this->_name,theCamera.GetWindowWidth() - 100, 50); + } + return ; +} + +void Tooltip::clearInfo(void) { + theWorld.Remove(this->_equip); + Game::getHUD()->removeText(this->_name); +} + +void Tooltip::ReceiveMessage(Message *m) { + if (m->GetMessageName() == "deleteTip") { + Game::getHUD()->removeText(this->_val); + } +} diff --git a/Sources/src/Weapon.cpp b/Sources/src/Weapon.cpp @@ -43,6 +43,7 @@ Weapon::Weapon(std::string name) : _name(name) { Weapon::Weapon(Weapon* weapon) { this->_name = weapon->getName(); + this->addAttribute("name", this->_name); this->_flavor = weapon->getFlavor(); this->_damage = weapon->getDamage(); this->_recovery = weapon->getRecovery(); @@ -85,9 +86,10 @@ Weapon::Weapon(Weapon* w, Characters* c) { this->addAttribute("type", "WeaponHitBox"); this->SetDrawShape(ADS_Square); this->SetColor(1, 1, 1, 0); + this->addAttribute("physic", "1"); this->_hitboxType = "special"; this->_hitbox = "octogonHitbox"; - this->SetDensity(0.1f); + this->SetDensity(0.001f); this->SetFixedRotation(true); this->Tag("weaponhitbox"); this->SetIsSensor(true); @@ -185,6 +187,7 @@ void Weapon::_parseJson(std::string file) { if (this->_name != json["infos"].get("name", "").asString()) Log::warning("The class name is different with the name in the config file: " + this->_name + "/" + json["infos"].get("name", "").asString()); this->_name = json["infos"].get("name", "").asString(); + this->_flavor = json["infos"].get("flavor", "").asString(); this->_active = json["infos"].get("active", "").asFloat(); this->_recovery = json["infos"].get("recovery", "").asFloat(); diff --git a/Sources/src/WeaponList.cpp b/Sources/src/WeaponList.cpp @@ -54,6 +54,17 @@ WeaponList::~WeaponList(void) { return; } +int WeaponList::checkExists(std::string name) { + std::list<Weapon*>::iterator it; + + for (it = this->_allWeapons.begin(); it != this->_allWeapons.end(); it++) { + if (name == (*it)->getName()) { + return 1; + } + } + return 0; +} + //! Returns a weapon in order to use it afterwards /** * Get a weapon obj by name