プレイ日記
klonoa hellkolbod
so um how do you add a combat system in a text adventure game
1そうだね
プレイ済み
返信[1]
親投稿
Autz sonic-HD8765
Something similar to turn-based RPG combat.Just a loop where you choose options until the enemy has died or when player has died.
0そうだね
プレイ済み
返信[2]
親投稿
klonoa hellkolbod
whats the line(s) of code
0そうだね
プレイ済み
返信[3]
親投稿
Autz sonic-HD8765
It depends on how complicated you want it to be. Since your game is text-based, i think is better just to post a hardcoded result instead of relying on the player's choiced in-battle. Something like: "You fighted that ugly spider, and you won!" But if you want it to be variable, then this algorithm can help you:
0そうだね
プレイ済み
返信[4]
親投稿
Autz sonic-HD8765
1.- Select a choice to attack (Punch or Kick for example). 2.- Substract the enemy life for the damage received. 3.- Enemy attack you. 4.- Substract your life by the damage received. 5.- Go to first step. And so on.
0そうだね
プレイ済み
返信[5]
親投稿
Autz sonic-HD8765
Also, no code here because understanding your tools and the logic is part of the task. Every App/Game is a task with unique challenges, so is up to you to find a solution for those problems instead of relying on copy-paste.
0そうだね
プレイ済み