gpt4 book ai didi

java - Gdx.audio错误

转载 作者:行者123 更新时间:2023-12-03 02:09:55 26 4
gpt4 key购买 nike

因此,我正在libgdx Wiki中进行简单的游戏操作,并且完成了这些操作,但出现了这些错误。

首先是:
dropSound = new Gdx.audio.newSound(Gdx.files.internal("drop.wav"));rainMusic = new Gdx.audio.newMusic(Gdx.files.internal("rain.mp3"));
我在Gdx.audio中收到错误

第二个是

Iterator<Rectangle> iter = raindrops.iterator();

错误在迭代器中

这就是我在控制台中看到的
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.Error: Unresolved compilation problems: 
Gdx.audio cannot be resolved to a type
Gdx.audio cannot be resolved to a type

at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:120)
Caused by: java.lang.Error: Unresolved compilation problems:
Gdx.audio cannot be resolved to a type
Gdx.audio cannot be resolved to a type

at com.JohnAilamakis.Drop.Drop.create(Drop.java:55)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:136)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)

请您告诉我问题出在哪里。

最佳答案

要解决此错误,请在无法解析ApplicationListener的项目中引用gdx.jar。有时Eclipse也是一个问题,删除并重新导入项目可以帮助解决错误。

关于java - Gdx.audio错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25003304/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com