Sequence of Swipes

Hello,

I’m trying to create a sequence of swipes that the player would have to preform in order to proceed ahead with the game, for example:

  • Sequence gets triggered
  • Game generates a sequence, for this example will say Down, Up, DownLeft

And so, if the player successfully enters the swipes in this order the game will continue on and if the player does an incorrect swipe then the game will end. I currently already have all swipe directions functional (Up, Down, Right, Left, Down Right, Up Right, Down Left, Up Left). I was wondering if there’s a way to implement this so that I can give the player a random sequence, have the game detect for the correct swipe and proceed to the next swipe until the sequence has been done correctly. I’ve been trying to wrap my head around it for quite some time now, but no luck.

Thanks!

Do you have a way to know what swipe was just performed? If yes, it is quit easy. You could assign an int to each sequence (Up -0, Down - 1, Left - 2…), than you use Random.Range to generate random numbers, which represent a swipe, and populate a List with those values. Then when the user executes a swipe, you convert that swipe in your codification, and check if it coincide with the first element in your List, if it dose, you remove the first element in the list, else the user failed to swap correctly

Thank you for your answer!

I recently bought Easy Touch 4, just so it could help me implement these sequence functions. All i have so far is a debug.log within each individual swipe.

I’ll try and do as you recommended and go from there.