Permalink
Browse files

Linked the south west map with the noth west one.

  • Loading branch information...
1 parent 273c333 commit 5d5df76f4c119d35ccff89a40fa1af3470a4036b Yohann Ferreira committed Oct 27, 2012
View
15 dat/maps/layna_forest/layna_forest_north_west.lua
@@ -398,8 +398,12 @@ function _CreateCharacters()
if (GlobalManager:GetPreviousLocation() == "from_layna_forest_NE") then
hero:SetPosition(124, 42);
hero:SetDirection(hoa_map.MapMode.WEST);
+ elseif (GlobalManager:GetPreviousLocation() == "from forest SW") then
+ hero:SetPosition(116, 94);
+ hero:SetDirection(hoa_map.MapMode.NORTH);
end
+
Map:AddGroundObject(hero);
end
@@ -1109,6 +1113,8 @@ function _CreateEvents()
event = hoa_map.MapTransitionEvent("to forest NE", "dat/maps/layna_forest/layna_forest_north_east.lua", "from_layna_forest_NW");
EventManager:RegisterEvent(event);
+ event = hoa_map.MapTransitionEvent("to forest SW", "dat/maps/layna_forest/layna_forest_south_west.lua", "from_layna_forest_NW");
+ EventManager:RegisterEvent(event);
end
-- Create the different map zones triggering events
@@ -1119,17 +1125,22 @@ function _CreateZones()
to_forest_NE_zone = hoa_map.CameraZone(126, 128, 40, 45, hoa_map.MapMode.CONTEXT_01);
Map:AddZone(to_forest_NE_zone);
+
+ to_forest_SW_zone = hoa_map.CameraZone(114, 118, 95, 97, hoa_map.MapMode.CONTEXT_01);
+ Map:AddZone(to_forest_SW_zone);
end
-- Check whether the active camera has entered a zone. To be called within Update()
function _CheckZones()
if (to_forest_entrance_zone:IsCameraEntering() == true) then
hero:SetMoving(false);
EventManager:StartEvent("to forest entrance");
- end
- if (to_forest_NE_zone:IsCameraEntering() == true) then
+ elseif (to_forest_NE_zone:IsCameraEntering() == true) then
hero:SetMoving(false);
EventManager:StartEvent("to forest NE");
+ elseif (to_forest_SW_zone:IsCameraEntering() == true) then
+ hero:SetMoving(false);
+ EventManager:StartEvent("to forest SW");
end
end
View
16 dat/maps/layna_forest/layna_forest_south_west.lua
@@ -395,6 +395,11 @@ function _CreateCharacters()
hero:SetDirection(hoa_map.MapMode.WEST);
hero:SetMovementSpeed(hoa_map.MapMode.NORMAL_SPEED);
+ if (GlobalManager:GetPreviousLocation() == "from_layna_forest_NW") then
+ hero:SetPosition(54, 4); -- 52, 57, 0, 2
+ hero:SetDirection(hoa_map.MapMode.SOUTH);
+ end
+
Map:AddGroundObject(hero);
end
@@ -669,6 +674,9 @@ function _CreateEvents()
event = hoa_map.MapTransitionEvent("to forest SE", "dat/maps/layna_forest/layna_forest_south_east.lua", "from forest SW");
EventManager:RegisterEvent(event);
+
+ event = hoa_map.MapTransitionEvent("to forest NW", "dat/maps/layna_forest/layna_forest_north_west.lua", "from forest SW");
+ EventManager:RegisterEvent(event);
end
-- Create the different map zones triggering events
@@ -677,7 +685,7 @@ function _CreateZones()
to_forest_SE_zone = hoa_map.CameraZone(126, 128, 82, 87, hoa_map.MapMode.CONTEXT_01);
Map:AddZone(to_forest_SE_zone);
- to_forest_NW_zone = hoa_map.CameraZone(113, 117, 0, 2, hoa_map.MapMode.CONTEXT_01);
+ to_forest_NW_zone = hoa_map.CameraZone(52, 57, 0, 2, hoa_map.MapMode.CONTEXT_01);
Map:AddZone(to_forest_NW_zone);
end
@@ -687,6 +695,11 @@ function _CheckZones()
hero:SetMoving(false);
EventManager:StartEvent("to forest SE");
end
+
+ if (to_forest_NW_zone:IsCameraEntering() == true) then
+ hero:SetMoving(false);
+ EventManager:StartEvent("to forest NW");
+ end
end
-- Sets common battle environment settings for enemy sprites
@@ -706,4 +719,3 @@ end
map_functions = {
}
-

0 comments on commit 5d5df76

Please sign in to comment.