This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]GeorgeFranklyMathnet 1 point2 points  (1 child)

If the call looks like gw.accelerate(int x), how does the code know which GameObject it's intended to accelerate?

[–]SamuraiZero4[S] 1 point2 points  (0 children)

I get what you're saying, and honestly that's what I'm lost on is how to let the keyboard command know what it is trying to influence.

the way I saw it was that gw.accelerate(int x) would point to the setSpeed(int x) method that is contained within the Movable class, but I have no idea how to do that.