c# - Display Text Constantly -
I am very new to C # programming, and my main goal is to create simple text-based games. I am currently my first problem, which is the performance of the player's health and attack and the values of monster health and attack.
I want to display the value at the top of the console and every time the health of the player or the monster is increased or reduced. The problem I have is that I am currently limiting this exhibition from the rest to a different function, and when I run the function, I can only show it.
Like I said, I am very new, so my code is probably more amateur.
while (monster health> 0 & amp; amp; amp; amp; amp; player; health upgrade & gt; 0) {DisplayStats (); Console.light line ("You can either 'attack' or 'protect yourself from the monster.'); Console. LightLine (" Invasion "+ + PlayerAttack Upgrade + reduces the health of the monster and reduces the health of yourself The value of the monster attack will be cut in half by saving the monster.); String input = console Readline (); Input == "rescue" || Input == "invasion" || Input == "stampak") {switch (input) {case "attack": console.challer (); Displaystats (); Monster Health - = PlayerTeet Upgrade; Console. The light line ("You increase your" + Vipin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + demonic health of the monster "+ monstrous health of monster;); Player Demos + = Monsters:;
Then explicitly "if" and "while" are closed at the end of the statement function.
Now, what I want to display continuously at the top of the console is "DisplayStats" of the console, which looks like this:
Public static zero displays ) {Console.WriteLine ("player health:" + player official + "Monster Health:" + monsterHealth); Console.lightline ("Player attack:" + player attack upgrade + "Monster Attack:" + Monster Fault); Console "Line" (""); }
Any help would be greatly appreciated thanks,
-Liam
You can not make lines backwards, however, you can use the console to clear the console. So maybe you can prepare everything in your game loop, like other types of games
Comments
Post a Comment