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_Tomé_PixelPizza?
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.