Hi! Iāve already shared this example and is featured on the examples page, but I just updated it with a new level and option for secret areas. 
Inspired by other games, the Example now has two options for secret areas:
Level 1 = Proximity reveals secret area.
Level 2 = Collision reveals secret area.
Click the arrow for the Level 2 option.

Enjoy!
A bit late for easter eggs, but now you can also add more secret areas/easter eggs on your game!

8 Likes
Interesting. These both work in different ways, but only use one extra object⦠Do you think thereād be another way to make this without using proximity or collision? Maybe use a custom proximity bundle to make a system that works like the proximity one, but doesnāt cause any lagā¦
This is very cool.
4 Likes
Thank you for the idea now Iāll put these everywhere in my game when I get indie.
3 Likes
XD. It doesnāt take many objects.
1 Like
no I mean after I make levels because having no indie puts me at a level cap so I pack my game full of features without levels to use the features. hereās my game check it out Monster County
1 Like
This is already pretty optimized to not cause any lag, check it out!
The code has InView behaviors and such, and itās pretty adjustable if needed.
2 Likes
Awesome! You go!
I can confirm that indie is cool indeed 
2 Likes
If youāre looking for optimizations you can use player Globals instead of a proximity. If you wanted you could even have the player send the X/Y on collision so the Globals arenāt constantly active (though it doesnāt matter much because they wouldnāt trigger the code, so itās a very very small change on performance).
You can also condense the 4 expressions down into 1 if youād like as well.
But the proximity and expressions only go off for a single frame, so you might notice a slight lag spike if itās a weak device, but otherwise it should be alright
3 Likes
The second level looks cool, but is there a way it can be optimized for there to be multiple secret areas in a level?
1 Like
If the areas arenāt close to each other, you can use In-View. If theyāre both on screen at once, you can raycast and send messages. Then just repeat that in a chain (and ofc donāt activate the ones already hit)
1 Like
Yes! For sure you can also use Player XY globals, but I kept this example as simple as possible for newbie users - so its easy to copy and paste
But its pretty versatile and adaptable as codealpaca suggested.
As always thereās many ways to do the same thing. here are a few ways you could do that:
-
Use and extract Object names to determine which area they belong to: If the name is ā2ā they only trigger if another ā2ā object has been triggered.
-
Use another object that stays on top of secret areas nominated of something like āSecret Area 1ā, on game start they check proximity just once to confirm which area they belong to. And assign that number to their logic, probably using a Filter.
-
In-View behavior can also make this work, but it could also become weird if the secret area is not always on screen.
-
CodeAlpaca suggested raycasts, but that sounds like a lot of work and not performance-friendly
You could also go even further and just straight up not use any proximities, and use the Distance Bundle and Lists for the āSecret Area 1,2,3ā¦ā XY instead.
1 Like
Ray casts would probably be better than proximity set to 600 or at least about the same, I just thought naming everything ā1ā or ā2ā would be more tedious lol. Just 4 (or 1, just change rotation) very small RayCast(s) are needed. I guess it would be slightly harder for a new user (Than the current proximity), but newer users should learn how Raycasts work anyways.
Creating a secondary object as well seemed unneeded to me, might as well just create a 2nd invisible wall object
2 Likes
Ah true true @Kasamir The easiest way is to just have different object for different secret areas per level.
You could have 5 objects all with their Parent set to the original āHidden Areaā object.
They could probably send a message to self to set the Filter, to only activate on that area.
And you could use those 5 objects across all your levels too.
Thatās for sure the easiest less work way, and is still super performance friendly 
2 Likes
This is great! Iām using it in my new game, and it works so well!
Do you want me to add you to the credits, @Samuel_Tome?
1 Like
Well the only thing about indie thatās bad is lack of mobile options and that whenever I get it I always feel unmotivated and Iām less creative and I stuff my game with objects because I donāt have a limit.
That looks great!!! Awesome
@JUSTPLAINOP
Iām glad the example is being put to good use.
I really like the gameās overall vibe too, you go!
1 Like
Oh I never thought that you had other textures I might use them in a small project.