private void colorLogic() {
        if (timer.getTimeInSeconds() >= coreTime){
            
            colorInt++;
            coreTime = timer.getTimeInSeconds() + 20;
        

            switch (colorInt){
                case 1:
                    obstacleColors.clear();
                    solidBox = false;
                    obstacleColors.add(ColorRGBA.Green);
                    renderer.setBackgroundColor(ColorRGBA.Black);
                    playerMaterial.setColor("Color", ColorRGBA.White);
            floorMaterial.setColor("Color", ColorRGBA.Black);
                    break;
                case 2:
                    obstacleColors.set(0, ColorRGBA.Black);
                    solidBox = true;
                    renderer.setBackgroundColor(ColorRGBA.White);
                    playerMaterial.setColor("Color", ColorRGBA.Gray);
                        floorMaterial.setColor("Color", ColorRGBA.LightGray);
                    break;
                case 3:
                    obstacleColors.set(0, ColorRGBA.Pink);
                    break;
                case 4:
                    obstacleColors.set(0, ColorRGBA.Cyan);
                    obstacleColors.add(ColorRGBA.Magenta);
                    renderer.setBackgroundColor(ColorRGBA.Gray);
                        floorMaterial.setColor("Color", ColorRGBA.Gray);
                    playerMaterial.setColor("Color", ColorRGBA.White);
                    break;
                case 5:
                    obstacleColors.remove(0);
                    renderer.setBackgroundColor(ColorRGBA.Pink);
                    solidBox = false;
                    playerMaterial.setColor("Color", ColorRGBA.White);
                    break;
                case 6:
                    obstacleColors.set(0, ColorRGBA.White);
                    solidBox = true;
                    renderer.setBackgroundColor(ColorRGBA.Black);
                    playerMaterial.setColor("Color", ColorRGBA.Gray);
                        floorMaterial.setColor("Color", ColorRGBA.LightGray);
                    break;
                case 7:
                    obstacleColors.set(0, ColorRGBA.Green);
                    renderer.setBackgroundColor(ColorRGBA.Gray);
                    playerMaterial.setColor("Color", ColorRGBA.Black);
                        floorMaterial.setColor("Color", ColorRGBA.Orange);
                    break;
                case 8:
                    obstacleColors.set(0, ColorRGBA.Red);
                        floorMaterial.setColor("Color", ColorRGBA.Pink);
                    break;
                case 9:
                    obstacleColors.set(0, ColorRGBA.Orange);
                    obstacleColors.add(ColorRGBA.Red);
                    obstacleColors.add(ColorRGBA.Yellow);
                    renderer.setBackgroundColor(ColorRGBA.White);
                    playerMaterial.setColor("Color", ColorRGBA.Red);
                    floorMaterial.setColor("Color", ColorRGBA.Gray);
                    colorInt=0;
                    break;
                default:
                    break;
            }
        }
    }
Determines the colors of the player, floor, obstacle and background
jme3-examples/src/main/java/jme3test/games/CubeField.java