0
I’m trying to create a game using java without using other libraries. I was able to do everything I needed so far but I’m not able to use the getx() function in Imageview controlled by the player in this section:
ImageView player = (ImageView)findViewById(R.id.player);
if(player.getX() == 80){
Toast toast = Toast.makeText(getApplicationContext(), ";)", Toast.LENGTH_SHORT);
toast.show();
}else{
Toast toast = Toast.makeText(getApplicationContext(), ";(", Toast.LENGTH_SHORT);
toast.show();
}
What’s wrong with it?
It is very vague. What do you want to do? What function
getX()
should do? What’s the answer you’re waiting for?– regmoraes
I want a certain function to be executed only when the x position of Imageview is 80, but I could not get results.
– Bandicoot_
The point is that even though Imageview is at position 80, the function is not executed.
– Bandicoot_