我正在制作一款 Android 游戏(只是为了学习一些东西)。您收集对象并为此获得积分。例如,当玩家达到 200 分时,物体开始移动得更快,背景发生变化等......就像是下一个级别。但是当你达到那 200 分时,我想在屏幕上显示图像或文本(类似于“2 级”)大约 2 秒,但我不知道如何显示。
我尝试使用计时器,但失败了。
我有一个“如果”的陈述
if (score >= 200) {
frameLayout.setBackgroundResource(R.drawable.lvl2); // background change
// Make objects go faster
collect_obj1 = Math.round(screenWidth / 57F);
collect_obj2 = Math.round(screenWidth / 33F);
critical_obj = Math.round(screenWidth / 42F); // If you hit this one = Game Over
characterLvl1.setImageResource(R.drawable.characterLvl2); // character change
}
慕婉清6462132
相关分类