I am trying to change the value of the text only if a specific string is shown and the enter key is pressed. This is what I have so far in my world class:
This is what I've attempted from my text class act method:
Where am I going wrong with it?
//variable in world class public Text inGameText; //inside constructor inGameText = new Text(""); // method in world class public Text getText() { return inGameText; } // initial text added to world addObject(inGameText, 147, 289); inGameText.setText(inGameText.palletTown_Sign1);
CreateMap C = (CreateMap)getWorld(); Text inGameText = C.getText(); if (Greenfoot.isKeyDown("enter") && C.getText() == palletTown_Sign1) { }