Problem is in my class that renders the level that needs some value to render the side scrolling and this value im getting inside the player class.. And when i make something like:
//Inside the render class
//This is global variable
Player player = new Player;
//This is inside some method that renders.
public void rendering method()
{
int i = player.myInt;
}
Int i is always zero.. Even i update myInt inside the player class every time the right button is pressed.
I also tried making a method that returns the value i need:
//Inside the player class
public int testing()
{
return myValue;
}
This is also not working correctly..
Inside my Player class i have the variable inside the constructor like:
public Player()
{
myValue = 0;
}
And then inside a update method inside the player class that gets called to look for keypresses i have:
public void Update()
{
if(key left was pressed)
myValue--;
}
Make sure you are using the correct format.
For example:
If that does not resolve your problem then we will need more info.
It would be best if you could put up the two classes affected.
Updated to set Player location using constructor.
Updated based on updated content in original question. What is the object hierarchy? Will the Player be creating the Render class?