0

Examples: https://www.youtube.com/watch?v=C2cOiFntLY4 https://www.youtube.com/watch?v=iHl1YFkeR78

I am making a small little RPG based on a text-adventure game that I made. This RPG involves a battle system similar to the SNES Final Fantasy games. I am currently limited to the player character and a single enemy, since those are the only actors that were ever present in the text-adventure game.

My battle system involves selecting your choice (attack or run away) and, upon attacking, the damage is calculated, battle text is displayed showing the damage, and then there is a short delay before the enemy attacks in return. This is all fine and good, but I don't want static images of my player and the enemy.

In the first example above, you can see the enemies jump onto the player for their attacks and you can see that the player runs to the enemy and then swings his sword. In the second example, you can see that the players will run forward a short distance and then either cast a spell or swing their weapon. What I'm looking for is something somewhere in the middle -- I want my player sprite to run/jump over to a position directly in front of the enemy, perform an attack animation in that position, and then run/jump back to their starting position.

I don't have my code in front of me, but I do know that I am currently drawing the sprites in specific locations, basically using standard pygame.draw functionality.

So: Any chance someone could walk me through this? I know how to move my player around when outside of the battle system, but I don't know how to properly do the same thing when the player is not in control... and adding the Y-axis to the equation (for the jump) just stumps me in this situation. I have (extremely basic) knowledge of tweening/easing functions, which I suspect will be relevant here, but I've only ever used them along one axis to make an item bounce up and down in place, so I'm not sure how to apply them to a sprite moving in two different axes.

Any help would be appreciated, especially code examples. Thanks!

Loris Securo
  • 7,538
  • 2
  • 17
  • 28
  • 1
    This is a question should about [GameDevelopment](https://gamedev.stackexchange.com/). See [GameDevelopment - What topics can I ask about here?](https://gamedev.stackexchange.com/help/on-topic) – Rabbid76 Sep 15 '20 at 19:43
  • So to summarise: You want to move an animated sprite through a fixed path? – Kingsley Sep 15 '20 at 22:00
  • That would serve my purpose, yes. Ideally, I would also like to be able to have my player run/jump towards enemies located in slightly different positions, but I won't be using that in this particular game, so a fixed path is perfectly fine. Also, to reiterate, the motion I'm looking for is for my player to jump up in an arc, landing in front of the enemy. – Lucid003 Sep 15 '20 at 23:01

0 Answers0