need help creating visuals (such as a starting screen) for my RPG battle system prototype
I've tried using several different things such as Tinker, objectLIB, and turtle, but none have them worked please help.
I've tried using several different things such as Tinker, objectLIB, and turtle, but none have them worked please help.
I use python BTW
Are you using microstudios? Because the microstudio API should have everything you need.
yes
you can refer to this example, though it is not in python.
:: https://microstudio.dev/i/gurg0/sse/ ::
something in python might look like this:
def init():
global playing
playing = False # usually you would use a string value to define playing like playing = "game" for more specific modes.
def update():
global playing
if mouse.press:
playing = not playing # flips current value of playing
def draw():
screen.clear()
if playing:
draw_game() # draws the game if playing is true
else:
draw_start() # draws the start screen if playing is false
def draw_start():
screen.drawText("Start", 0, 0, 25, "#fff")
screen.drawText("Click to play", 0, -15, 10, "#fff")
def draw_game():
screen.drawText("Game", 0, 0, 25, "green")
screen.drawText("Click to go back", 0, -15, 10, "green")
this should be good, unless of course this isn't what you needed.
this might actually work. thank you:)
here on another account. need some help on a syntax error here is the code
def cap(value, minimum=0, maximum=50): return max(minimum, min(value, maximum))
def multiplayer_mode(): player1_name = input("What will player 1 be called? ").strip() player2_name = input("What will player 2 be called? ").strip()
health1, health2 = 100, 100
tp1, tp2 = 50, 50
score1, score2 = 0, 0
while True:
# Player 1s turn - loop until a valid move is chosen
while True:
option1 = input(f"What would {player1_name} like to do? (attack/magic/rest) ").strip().lower()
if option1 == "attack":
health2 = max(health2 - 23, 0)
break
elif option1 == "magic":
if tp1 >= 32:
health2 = max(health2 - 43, 0)
tp1 -= 32
break
else:
print("Not enough TP for magic!")
elif option1 == "rest":
tp1 = cap(tp1 + 10)
break
else:
print(f"Invalid option for {player1_name}! Please choose again.")
print(f"{player1_name}: TP={tp1}, Health={health1}")
print(f"{player2_name}: TP={tp2}, Health={health2}")
if health2 <= 0:
print(f"{player1_name} wins!")
score1 += 1
break
# Player 2s turn - same validation loop
while True:
option2 = input(f"What would {player2_name} like to do? (attack/magic/rest) ").strip().lower()
if option2 == "attack":
health1 = max(health1 - 23, 0)
break
elif option2 == "magic":
if tp2 >= 32:
health1 = max(health1 - 43, 0)
tp2 -= 32
break
else:
print("Not enough TP for magic!")
elif option2 == "rest":
tp2 = cap(tp2 + 10)
break
else:
print(f"Invalid option for {player2_name}! Please choose again.")
print(f"{player1_name}: TP={tp1}, Health={health1}")
print(f"{player2_name}: TP={tp2}, Health={health2}")
if health1 <= 0:
print(f"{player2_name} wins!")
score2 += 1
break
print(f"Score:\n{player1_name}: {score1}\n{player2_name}: {score2}")