Hello!
I need some help with the addObject method. I'm trying to make it so that when the user-controlled player1 touches the endLevel1 actor(a yellow dot), the level ends with the Win actor being added onto the screen which will say "Level 1 Completed". I'd appreciate any help. Here's the code.
/**
* Write a description of class endLevel1 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class endLevel1 extends Actor
{
/**
* Act - do whatever the endLevel1 wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
checkForIsTouchingPlayer1();
}
public void checkForIsTouchingPlayer1()
{
if (isTouching(player1.class))
{
addObject(new Win(), 100, 100);
}
}
}

