Ok so i've got a game, with class Player, and a few extensions of Player
i've greatly over simplified my code for ease of my typing.
then in my game class i'm trying to define an array of players that is a mix of players, smartplayers and humanplayers.Code:class Player public PlayerStuff; class SmartPlayer extends Player public SmartStuff; class HumanPlayer extends Player; Public HumanStuff;
and the problem arises that i cant access the methods in SmartPlayer even if instances of the array is pointed at a SmartPlayer... any ideas?Code:Player[NUM_OF_PLAYERS] PlayersInGame; PlayersInGame[1] = new Player; PlayersInGame[2] = new SmartPlayer;




Reply With Quote