Values of a float not updating in classes besides the one it is defined in :(

Static is not a bad idea. You should really study more about Java before attempting a game.

I had 150hours of programming in school before we even touched graphical/visual programming.
And that doesnt include all the homework we had…

And Im still lost :stuck_out_tongue:

Would you recommend diverging else over static?

What?
What does else have to do with static?

Would you recommend anything* else over static, sorry auto correct changed it

Well you could make lots of classes and work around that.

Shouldn’t use static just because “normal” variables aren’t working for you. levelX and levelY sound like iffy variables to make static, unless you only are ever going to have one level total (also, shouldn’t you have a level class? and a player class?)
Referring to the original question, are you somehow calling onCreate() excessively? By the method name I wouldn’t think so but I’m only familiar with desktop libgdx. When is the getter called in relation to the setter?

The other class doesnt store it. He uses main.getLevelX() as “values” for the conditions of an if-statement.
If I remember correctly…

Dear God, it sounds to me like you need to completely redesign and restructure your entire code.

@vbrain is my coding really that bad? :frowning:

@Jimmt the levelX and levelY are always to have one value across the entire game, so I think static will be good for it, and Im not sure why I haven’t created a level or player class, I should do that

what does levelX and levelY hold? My assumption was the X and Y position within the level. is it the height and width?

I think i have figured out how to fix this (more classes, some static variables where necessary and arguments), but yes it does hold on level X and Y position