3
u/umangjain25 Oct 18 '20
This is great! So the only 'ghosts' that follow you are the ones in the behind forming a certain triangle right?
2
u/020406code Oct 18 '20
Basically, yeah. If the follower is facing in a similar direction to the “leader,” then it’s allowed to follow.
1
11
u/theTRUEmiffqueen Oct 18 '20
this would be incredible in a 3D horror game. replace the triangles with some spooky statues or whatnot and you have a seemingly still crowd that is looking directly at you when you turn around
3
5
u/Horde77 Oct 18 '20
That's really cool - thanks for sharing. It's like a top down view of the stone statues in that Dr Who episode 'Blink'
1
Oct 18 '20
I wonder how you figured out the collision management. It's amazing.
2
u/020406code Oct 18 '20
The “separation” code is mostly from Dan Shiffman: https://m.youtube.com/watch?v=mhjuuHl6qHM
He has great videos on Processing.
3
3
2
1
1
1
1
1
1
18
u/020406code Oct 18 '20
Code: https://020406.org/processing/pde/WalkerAndStalkers.pde
I had the idea that the dynamic of the "followers" would be kind of like that of the ghosts in the old Super Mario games: they follow the "stalked" triangle with their "gaze" by pointing at it but don't start moving until it is facing away from them.
Lots of variables in the code you could mess with to create different dynamics.