#๐Ÿ”’ how do make it so the fight sequence ends when the monster dies?

44 messages ยท Page 1 of 1 (latest)

flint thistleBOT
#

@dreamy breach

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

#

failmail :ok_hand: applied timeout to @dreamy breach until <t:1716832916:f> (10 minutes) (reason: newlines spam - sent 24 consecutive newlines).

The <@&831776746206265384> have been alerted for review.

thorn quartz
#

!Unmute 1055669336926322768

flint thistleBOT
#

failmail :ok_hand: pardoned infraction timeout for @dreamy breach.

dreamy breach
#

why'd that happen?

thorn quartz
#

Please use our pastebin

#

!pastebin

flint thistleBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

granite rapids
#

you tripped our spam filter

dreamy breach
#

mb

granite rapids
#

for long text, use the pastebin like vivek mentioned

dreamy breach
#

ok, mb

granite rapids
#

is okay :3

dreamy breach
#

here

silver swift
dreamy breach
#

yeah

silver swift
#

you can say if monster health =< 0:
break

dreamy breach
#

but i still want the game to continue

silver swift
#

one minute

#

well what do you want to do afterwards

silver swift
dreamy breach
silver swift
#

there pretty mouch only the fight scene as of right now, to proceed in the game youll have to add more content

dreamy breach
#

ik

#

but idk how i would get to that content once the fight is over

silver swift
# dreamy breach ik

you can end the while true loop and enter another one with the other content once the monster is defeated

dreamy breach
#

oh ok

silver swift
dreamy breach
jovial birch
#

You could have a main game loop and then do that battle in a function.

#

Then inside your main loop just call the battle function.

dreamy breach
#

ok

jovial birch
#

Maybe return true or false or whatever if you win the battle?

dreamy breach
#

sure

jovial birch
#

In computer science, the event loop (also known as message dispatcher, message loop, message pump, or run loop) is a programming construct or design pattern that waits for and dispatches events or messages in a program. The event loop works by making a request to some internal or external "event provider" (that generally blocks the request until...

#

Games have an event loop

dreamy breach
#

also i'm very rusty with code, just sayin

jovial birch
#

A lot of programs do

#

!res There are some good resources here to refresh your memory.

flint thistleBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

dreamy breach
#

alright, thanks

flint thistleBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.