-4

I try to make a game Flappy Bird and want to test my result on DesktopLauncher, but something is happening that makes two errors. I can't find any F on the list.

package com.mygdx.flappy;

import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;


public class DesktopLauncher {
    public static void main (String[] arg) {
        Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();

        config.width = 480; //this is the error part
        config.heigth = 800; //this is the error part

        new Lwjgl3Application(new MainFlappyBird(), config);
    }
}

here's the picture

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
DAXX KT
  • 1
  • 1
  • 2
    Please include your error or exception as text in the answer, not in an image. The error occurred because `Lwjgl3ApplicationConfiguration` has no field `width` or `height.` Check the `Lwjgl3ApplicationConfiguration` for these variables; maybe they are private, and you must use setters instead of directly assigning value to them. – Soroush Shemshadi Jun 25 '22 at 06:56
  • this one ? D:\mainflappybirds\desktop\src\com\mygdx\flappy\DesktopLauncher.java:11: error: cannot find symbol config.width = 480; ^ symbol: variable width location: variable config of type Lwjgl3ApplicationConfiguration – DAXX KT Jun 25 '22 at 06:57
  • 1
    What does "missing F" have to do with your actual problem? Are you trying to be smart and use the letter "F" as a shorthand for the word "field", if so, don't do that. – Mark Rotteveel Jun 25 '22 at 07:11
  • [`Lwjgl3WindowConfiguration#setWindowedMode(int width, int height)`](https://www.mvndoc.com/c/com.badlogicgames.gdx/gdx-backend-lwjgl3/com/badlogic/gdx/backends/lwjgl3/Lwjgl3WindowConfiguration.html#setWindowedMode-int-int-) – QBrute Jun 25 '22 at 12:33

1 Answers1

0

Config is an object of type „Lwjgl3ApplicationConfiguration“ And this type does not have properties „width“ and „height“. That‘s why you can‘t assign values to this property, because it does not exist.

GabeRAMturn
  • 350
  • 1
  • 5
  • 10
  • do you have advice what should i do? – DAXX KT Jun 25 '22 at 07:02
  • I don‘t know what this application is. Is it a backend? A frontend? Is it Android? Spring? What is width and heigth and what are these values supposed to do? – GabeRAMturn Jun 25 '22 at 07:05
  • i use intellij idea and it's for deskop. Width and height for game screen resolution – DAXX KT Jun 25 '22 at 07:06
  • 2
    @DAXXKT *"do you have advice"* Maybe read some documentation? – Olivier Jun 25 '22 at 07:08
  • The IDE should not have an impact. And you didn‘t answer any of my questions… please update your question with the answers to my question so that other people also know what exactly you‘re doing. – GabeRAMturn Jun 25 '22 at 07:08