Detecting what the current tilemap is

I need help making it so the code knows what the current tilemap is, as in being able to know if the tilemap is currently area 1 so it can spawn the enemies for area 1 and not ones for area 5 and vise versa.

1 Like

create a variable and set its value to the number of the area, like if you’re in area 1 then the variable’s value is 1.

1 Like

Hi, this is simple to do and can be accomplished within a few steps.

1.Create both your levels.
2.Create your enemies and their behavior
3.Create a variable
4.Whenever your game loads a level set that variable to the level number.
5.When spawning your enemies create an if-statement like “If level = 1 then spawn level one enemies} else If level = 2 then spawn level two enemies and so on.

Here is an example I have created—> https://arcade.makecode.com/S80349-74461-63526-49199
Click “Edit Code” in the top left corner to see the code. Let me know if any further instruction is needed.

1 Like

Can you show me what that would look like?

1 Like