Hello there, I'm trying to think of ways to do right-click movement with the mouse. The game is a top-down shooter so you don't have to select/deselect units like an RTS, but you do have to move from A to B using the right mouse button. The player also rotates based on where the mouse is, and shooting is done via left click to keep controls unified to the mouse.
So far, I've been googling and searching ways to do this but I haven't found any good examples to learn off of yet, or I get examples for things that aren't quite the same as the movement system I have in my head. I'm extremely new to Greenfoot with only past experience at high school with Python & TrueBasic, but neither of those courses involved programming anything too interactive, or game-like.
Any tips, examples, suggestions, tutorials are greatly appreciated! The more streamlined/easier to follow the better.
The following is a suggestion given to me by my lecturer (It was on paper and wasn't written in the software), if it would provide any context and help with this;
PART ONE:
Distance = SquareRoot of XSqaured + YSquared = FramesRequired
FramesRequired = Distance/PlayerSpeed
PART TWO:
IF (FramesRequired > 0) {
IF (PlayerSpeed > Distance) {
Move (Distance)
Distance = 0;
}
ELSE {
Move (PlayerSpeed);
Distance = Distance - PlayerSpeed;
}
FramesRequired - -;
}

