Hello, i have a game that moves 15x'balk' in vertical way. I have all the code for the game and it all works. So if you press mouse on a balk, the balk stops moving, and if you pres it near the middle of the y-axis, it automaticly sets location to exact the middle of the y-axis.
My goal is to have all the 'balk' in the middle of the y-axis, so if you have accomplished this the game should show a message like: You won.
this is the code I have in the Balk (actor class):
if (Greenfoot. mouseClicked(this))
{
if (getY()== getWorld().getHeight()/2)
{
}
}