我刚刚开始了一个小游戏项目,我试图让它在每次发射子弹时发出声音,但我一直得到同样的错误:
pygame.error:混音器系统未初始化
我不知道我做错了什么,这是我的代码:
pygame.error: mixer system not initialized
Run Code Online (Sandbox Code Playgroud)
....
import pygame, sys
from pygame.locals import *
theClock = pygame.time.Clock()
sound = pygame.mixer.Sound("bullet.mp3")
Run Code Online (Sandbox Code Playgroud) # include <stdio.h>
double simpleInterest (double Princ, double Rate, int Time)
{
double value;
value = Princ*Rate*Time;
retrun value;
}
int main (int argc, char * argv [])
{
printf ("value is £%5.2\n", simpleInterest(100,0.05,1);
printf ("value is £%5.2\n", simpleInterest(1,0.01,10);
}
Run Code Online (Sandbox Code Playgroud)
我得到一个错误说预期';' 之前')'令牌,但我不明白我已经放了一个; 在每一行之后.我应该把别人放在其他地方吗?