I am trying to make a very basic top down game, with a main character and enemies, and I want to be able to have an "attack" button that will make a subclass (The actual attack, in the case it's a ball of fire) appear either to the top, bottom, left or right of my character for the duration of the key being pressed.
So I tried getting my main class' coordinates inside of my "attack" class, but I can't seem to do it. Are there any alternatives if what I'm asking is impossible?