Hey guys,
I'm currently wokring on a small game, for which i decided to create a tool.
The game is a 2D role playing game and uses a map.
The tool is supposed to make creating another map level easier.
In this project I have the following packages : MainPackage, Monster, TNPC, MapFields and MapObjects.
Monster contains some monster who all extends monster.class , which extends NPC
TNPC contains some talking npcs who all extends TNPC.class , which extends NPC
My problem :
I can't cast a monster or a TNPC into a NPC
eg :
if (data.equals("Phoenix"))
npcs[j] = new Phoenix(x, y, j);
does not work in the tool code
But :
1) In the game code, it works , altough I use the same code
2) I extend the map objects the same way (some mapObject extends MapObject.class extends MapField.class , but
if (data[i].equals("LadderUp"))
Fields[x][y] = new LadderUp(x, y);
works
So :
does anyone have a solution (or idea) for me?
THX