Hi,
Im having a problem on the second level of my game. If a 'motorbike' can see a disk (coin) then the level should add one point to that bike's specific counter.
There are two counters.
There are two bikes, one red, one blue.
Trying to get the counter to work on my second level has proven difficult, here is the code on level one;
The code above is solely to increase the score of the red bike's counter by 1 each time it can see a counter.
This code worked fine before i tried to add more code for the second level (ArenaTwo) which stopped any score on the red bike from being added at all, in both level one and two.
Here is the code I am trying to get the counter to work with on level two;
The two sections of code are both in my actor called 'redbike'
In the other bike, the other player, Ihave the exact same code but just with 'Counter', instead of 'Counter2' to differentiate the two.
if (getWorld() instanceof Arena)
{
if(disk!=null)
{
Arena arena = (Arena)getWorld();
arena.removeObject(disk);
Counter2 counter = arena.getCounter(); <----- () Has the error "incompatible types: Counter cannot be converted to Counter2
counter.bumpCount(1);
}
} if (getWorld() instanceof ArenaTwo)
{
if(disk!=null)
{
ArenaTwo arenatwo = (ArenaTwo)getWorld();
arenatwo.removeObject(disk);
Counter2 counter = arenatwo.getCounter(); <------ Exact same error in with () as there was in my previous code
counter.bumpCount(1);
}
}
