Moving the Cursor

24 days ago
1

Now I have to program this to add the selected characters to a string.
Then make that string appear on the screen.
This code's design is simple.
1 - Set the input for the direction buttons
2 - Make a variable of type integer and give it a value from 0 to 3 representing each direction
3 - When a direction button is pressed (up, down, left, right) the corresponding value is sent to another script
4 - This other script then takes the value comparing to its conditions
If the value is 0 then up has been pressed
5 - The instructions for each value set a value to the int variable _row
as well as the int variable _indexPosition
6 - The indexPosition is used to find the index position in an array of positions
7 - That array of positions is then referenced to make the position of the cursorBox = to the coordinates on the x,y,z axes that is saved at the chosen index.
In other words, pressing an arrow key either subtracts or adds to the value of the index.
And the cursor's position is = to the list of positions at that index.
If you had a list of positions, and every time I pressed a button it would change the number referring to the number in your list, and I would tell you to move to that position in your list according to the number we have... that's how that would work.

Loading comments...