#๐ how do make it so the fight sequence ends when the monster dies?
44 messages ยท Page 1 of 1 (latest)
@dreamy breach
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.
: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.
!Unmute 1055669336926322768
:ok_hand: pardoned infraction timeout for @dreamy breach.
why'd that happen?
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.
you tripped our spam filter
mb
for long text, use the pastebin like vivek mentioned
ok, mb
is okay :3
the monster has some type of health right?
yeah
you can say if monster health =< 0:
break
but i still want the game to continue
?
have the player continue the game
there pretty mouch only the fight scene as of right now, to proceed in the game youll have to add more content
you can end the while true loop and enter another one with the other content once the monster is defeated
oh ok
lmk if you have other problems
just wondering but how do i go from while loop to while loop?
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.
ok
Maybe return true or false or whatever if you win the battle?
sure
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
also i'm very rusty with code, just sayin
A lot of programs do
!res There are some good resources here to refresh your memory.
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
alright, thanks
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.