LOL, it really is funny that I am having this much trouble.
I read the page that you linked to and it makes sense. The GoHome script is so small yet I’m completely stumped.
This is what I’ve done so far in the flowchart:
-
Created the Functions
a. Main
b. Start
c. PrintWelcomeMessage
d. Update
e. PrintUpdateAndContinue
-
Declared and assigned numberOfSteps = 1 (int)
-
Declared and assigned homeLocation = 1.0 (real)
-
Declared and assigned gameOver (bool)
--------Called the Function Start which has the Function PrintWelcomeMessage ----------
-
Output “Are you feeling lost?”
-
“The objective of the game is to find your way home. Go on, you can do it!”
------- End of Function PrintWelcomeMessage --------------
------- Called the Function PrintUpdateAndContinue --------
This is where items break down.
-
I’m trying to use the distance.magnitude == 0 (that doesn’t work)
-
Therefore, the output when false does not solve because it tries to print distance.magnitude
----------- End of Function PrintUpdateAndContinue --------
-
Output “Distance”
-
Output + distance
-
location > homeLocation
False outputs "Go forward to get home!"
True outputs “Go back to get home!”
-
location == homeLocation
True outputs “I am at home!”
**Note: No 7 and 8 is also wrong because I used an If statment to solve, and it will not proceed to “I am at home!” unless it prints one of the other two mentioned above.
---------- Called the Function Update -------------
I’m doing this entire update wrong because it just returns to the beginning and does not listen for all the keys.
-
Declared w a s d (string)
-
Input w a s d
-
w == "w"
True "I am the UP key"
False Update Function Called
-
a == "a"
True "I am the LEFT key"
False Update Function Called
-
s == "s"
True "I am the DOWN key"
False Update Function Called
-
d == "d"
True "I am the RIGHT key"
False Update Function Called
----------- End of Function Update -------------
I don’t have everything in there and still trying to figure out how to do the Vector2.
I’m glad that I’m doing this because it has helped me to see that I don’t understand things too well.