Choosing which sound to play in Pygame [closed] - python

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
In Pygame how would I define which sound I want to play in certain "if" events? I've been able to load them both in I just hit the issue of not playing either on demand. Thanks for helping me in advance.

You need to use a sound object to play sounds.
if condition_one_true:
sound_one = Sound('sound1.mp3')
sound_one.play()
if condition_two_true:
sound_two= Sound('sound2.mp3')
sound_two.play()

Related

How do i code an anti-wizz / anti-nuke bot using python code [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 days ago.
Improve this question
I'm trying to code a fully customizable anti nuke bot but i'm not sure how. If anyone can help me with this, i'll be so grateful. Please n thanks.
To be clear, i want this anti-nuke / anti-wizz bot to have a whitelist command as well as a turn on and turn off command for the anti-nuke setup. please n thanks!

Problem wih virtual keyboard not write in correct please [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 days ago.
Improve this question
I tryvto make virtual keyboard
It work But the problem is when I try to write with it
It's right hereenter image description here
What I actually want is to wrte In real desktop program like word ,note and so on
Please tell me if you want the code
Oh how can I fix it

How to run a function after another function is done in python [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I just learned python the other day, I was wondering how I can make the function vc_s2() wait for function vc_s1() to be done before running, and the same for vc_s3() with vc_s2()?
Thank you so much in advance!
from funtions import vc_s1, vc_s2, vc_s3
vc_s1()
vc_s2()
vc_s3()
Python runs chronologically, so it goes from top to bottom, as long as you have the 3 functions in order you should be fine.

How to call a local file/online file if you are using repl.it? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I would let my discord bot(python) into the voice channel and play an audio, but I'm Using repl.it, how should I do?
Sorry about my English :(
You can simply upload it to your working directory

battleship game in python needs database or not [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm going to design simple battleship game with Python and Pygame.
but I don't know whether I need database for this purpose or not , or generally which games need databases to be designed.
I'll be thankful for any kind of help!
You don't have to use a db to have a simple game if you're just storing everything when the program is run. If you want to save the progress after starting and stopping your game then perhaps a database would be required

Categories

Resources