for a race game I make I want the car to slow down if itsn't touching the track to slow down the car this is the code in car :
but if the car touthes the alpha data part of the picture ( see true) the still returns true i didn't expect that
is there an easy way to fix this (i don't want to create a track piece by piece without alphadata or hard code to co-oords of the tack) ?
public void act()
{
Greenfoot.setSpeed(40);
if(Greenfoot.isKeyDown("up")) {
if(isTouching(RaceTrack.class)) {
move(5);
}
else move(1);
}
if(Greenfoot.isKeyDown("left")) turn(-10);
if(Greenfoot.isKeyDown("right")) turn(10);
}
public boolean debug() {
return isTouching(RaceTrack.class);
}if(isTouching(RaceTrack.class))

