This site requires JavaScript, please enable it in your browser!
Greenfoot back
Gaming_Cherries
Gaming_Cherries wrote ...

2014/3/26

Wall issue

Gaming_Cherries Gaming_Cherries

2014/3/26

#
So, I'm making CTF (capture the flag) game, and I ran into an issue. I made these walls, and I have it so that if a player touches it, they can't get through. The issue is, I can't figure out to make this work two ways. Here's the code so far
public void hitWall()
{
    if(isTouching(wall.class))
    {
        move(-10); //The base move is 5
     }
}
I need to find a way to make an 'and' in the if statement saying that if the player is already moving at a negative value, the move becomes 10 in the else statement. Thank you for your help!
Gaming_Cherries Gaming_Cherries

2014/3/26

#
I fixed the issue
You need to login to post a reply.