playMaker

Author Topic: Help me streamlining this rather simple gameplay mechanic  (Read 1396 times)

va2k0r

  • Playmaker Newbie
  • *
  • Posts: 2
Help me streamlining this rather simple gameplay mechanic
« on: March 04, 2016, 09:51:15 AM »
Hello, first post here, great software and so on and so on ...
so, I've munched through some tutorials and I'm trying to prototype this rather simple gameplay idea and I'd like your help about it if you like.

FPSController in a room, a bunch of invisible objects (let's say cubes) around him except one.
As soon as the cube exits the player's cone of vision (game object is visible=false) it needs to "move" closer to the player, jumping to another cube position.
It needs to check the closest cube to himself that stands between him and the player and jump to its position: you could set a new position for the cube or make the old cube invisible and the new cube visible, for example.
Then it waits for a certain amount of time and if it's still outside the player cone of view it does it again, it jumps to the closest cube between him and the player.
If it enters again the player's cone of vision it stays still.
That's it, a rather simple mechanic but I'd like to hear your feedback about the most streamlined, logical way to do it.
Build all the cubes and make them appear and disappear? Set the position of the cubes? Anything else?

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Help me streamlining this rather simple gameplay mechanic
« Reply #1 on: March 04, 2016, 09:57:31 AM »
Add them all to an array list and use the get closest game object action to select the one closest to the player-
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

va2k0r

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Help me streamlining this rather simple gameplay mechanic
« Reply #2 on: March 04, 2016, 10:08:00 AM »
... not the one closest to the player but the one closest to itself AND outside the player's cone of view. It needs to inch its way toward the player not jump to it. But yeah, the Find closest is a good starting point.