I vaguely understand that to use a class in another class, I have to write it in front of the method I want to use. Right now I'm Trying to get the rotation of a class, Turtle3, so I can orient the rotation of the bullets he shoots, which I have set up in the constructor class of class "bullets".
So again, I vaguely understand that I need to call or initialize the turtle class in the bullet class in order to use it's rotation. But randomly throwing together class names that look like they should work hasn't done any good.
Could someone more knowledgeable with this tell me the reason I need to call a class in the first place? I think I'd be better prepared for this in the future if someone could also explain good habits to have, in terms of writing the lines for calling classes, and where to locate the lines.
Hope someone can help, thanks in advance :)
1 2 3 4 5 6 | public bullets() { Turtle3 turtle = Turtle3(); setRotation(turtle.getRotation()); move( 7 ); } |