Master Cabalist
Member
Hi
I'm finishing up my map code and I'd like to do the following:
There are two for every pair of levels. What I mean is, when the map is displayed it shows two exes. One ex is black and represents completed levels,
and the other ex is yellow and represents the next level to go to. The exes are just draw on the current map.
So that's some background. I'd like to have a trail of mini bats go from the old, finished level, and follow a path to the next level. When a mini bat
reaches the next level it is destroyed and another one is spawned at the last level.
So the following code is for spawning a mini bat:
Output:
GrasslandsToForestTrail is a path in the room "GrasslandToForestMap"
ForestToSnowTrailbk is a path in the room "ForestToSnowPath"
SnowToLavaTrailbk is a path in the room "SnowToLavaPath"
Thanks everyone.
-TW
I'm finishing up my map code and I'd like to do the following:
There are two for every pair of levels. What I mean is, when the map is displayed it shows two exes. One ex is black and represents completed levels,
and the other ex is yellow and represents the next level to go to. The exes are just draw on the current map.
So that's some background. I'd like to have a trail of mini bats go from the old, finished level, and follow a path to the next level. When a mini bat
reaches the next level it is destroyed and another one is spawned at the last level.
So the following code is for spawning a mini bat:
GML:
if (global.completed_level1 == true && inst == noone)// && global.completed_level2 == false && inst != noone)
{
show_debug_message("Completed trail one");
inst = instance_create_depth(path_get_point_x(GrasslandsToForestTrail, 0), path_get_point_y(GrasslandsToForestTrail, 0),-1000, SentryBatWalkMap);
if (instance_exists(inst))
{
show_debug_message("Trail Instance Exists")
}
else
{
show_debug_message("Trail Instance Doesn't Exist")
}
}
///path from forest to snow
if (global.completed_level2== true && global.completed_level3 == false && inst2 == noone)
{
show_debug_message("Completed trail two");
inst2 = instance_create_depth(path_get_point_x(ForestToSnowTrailbk, 0), path_get_point_y(ForestToSnowTrailbk, 0),-1000, SentryBatWalkMap2);
//inst2 = instance_create_depth(464, 254,
}
//snow to lava
if (global.completed_level3 == true && global.completed_level4 == false && inst3 == noone)
{
show_debug_message("Completed trail three");
inst3 = instance_create_depth(path_get_point_x(SnowToLavaTrailbk, 0), path_get_point_y(SnowToLavaTrailbk, 0),-1000, SentryBatWalkMap3);
}
Code:
Before Completed trail one.
Completed trail one
Creating path for GrasslandsToForestTrail
Trail Instance Exists
ForestToSnowTrailbk is a path in the room "ForestToSnowPath"
SnowToLavaTrailbk is a path in the room "SnowToLavaPath"
Thanks everyone.
-TW