Search Unity

Need Help With Turned Based Battle

Discussion in 'Editor & General Support' started by btmodz1, Jun 16, 2019.

  1. btmodz1

    btmodz1

    Joined:
    Jun 12, 2019
    Posts:
    1
    Essentially, I'm making a 2D turn-based battle system similar to the the first two Paper Mario games.
    Here's the actions I want to preform.

    My Wish List:
    -You select an enemy on screen
    -Player walks up to the enemy
    -Player jumps on its head (in a parabolic arc)
    -Lands back on ground and walks back to starting point

    What I Have So Far:
    -Player can walk up to an enemy
    -Player jump in a parabolic arc (using a bezier curve)
    -Play lands and goes back to its starting point

    Problems:
    -The points to determine the bezier curve are hard wired into the code/inspector for each enemy. This makes it super hard to add a new enemy.
    -I don't know how to make the player script to know what enemy was selected to be attacked
    (Because of that I have no way of telling it what attack path to use)

    More Specific Wish List:
    -A way for the player (script) to know which enemy it's attacking
    -A procedural generated jump path (where the height of the enemy determines the vertex of the arc and how far the player jumps from the enemy) (It doesn't even have to be procedural. The ability to access custom child transform game objects on the enemy for the three points on the curve would be good too!).
    -Player walks to the generated jumping point, follows the arch until the impact point, reverses direct to jump point, and walks back.

    NOTE: I'm not asking for all the code for this (although that would be nice). I just need some hints on how this could possibly be done.

    Thanks a ton!
    -Btmodz