i am looking to make it so that when you click an object in game it spawns a new object directly on top of the object you click, therefore erasing the previous object with the new one.
The code that is needed should (to my understanding) be put in ActionHandler.java under the title
Code:
case ####; // where #### = object id
the code I have tried adding to do this is
Code:
case ####:
Server.objectHandler.addObject(new Objects(ObjectId, objectX, objectY, 0, -1, 10, ObjectId, 0));
break;
I keep getting one error from this code saying
Code:
src\server\model\players\ActionHandler.java:52: error: cannot find symbol
Server.objectHandler.addObject(new Objects(117, c.objectX, c.objectY, 0, -1, 10,
117, 0));
^
symbol: class Objects
location: class ActionHandler
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Press any key to continue . . .
if anybody can tell me what's either wrong with the code or if the code itself won't do what I want it to, I'd be very grateful.
if you say that the code is wrong, please give me hints or tell me on how i can redo it so that it does do what i would like.