Thread: Tutorials
View Single Post
 
Reply
Posted 2002-08-02, 03:39 PM in reply to "CRØNîC-KîLLå"'s post "Tutorials"
This is a tutorial on 8-way movement, which means your character can step in 8 directions: UP,DOWN,LEFT,RIGHT,UP-RIGHT,UP-LEFT,DOWN-RIGHT,and DOWN-LEFT. You should know how to use the enter password and change variable commands to use this.

Create an event on your map and make 6 pages. Set all of the pages to parallel process and below hero and make sure all of the graphics are set to the transparent color of the chipset. Now that we got the pages set up lets start coding.

Page 1
Have an enter password command to a variable, Im using one called Key Input 1. Input passable keys should be 1,2,3,4. Don put a check in 5,6,wait for key. Code: Enter Password: [0001:Key Input 1]

Page 2
Set the event condition for this page for Key Input 1 at 1. In the Events commands box have another enter password the same way as the one on page 1 except to a different variable named Key Input 2. Make a fork checking to see if Key Input 2 is equal to 2. In the fork have a move event that will move the hero to Left-Down. After that fork, create a new fork checking to see if Key Input 2 is equal to 3. In the fork have a move event that will move the hero to Right-Down. After that fork, have another enter password for Key Input 1(same checks in boxes). Make a new fork checking to see if Key Input 1 equals 1 and have the fork with an else case, in the else case set Key Input 1 and 2 to 0.

Code:
Enter Password: [0002:Key Input 2]
FORK Optn:Varbl[0002:Key Input 2]-2
Move Event...: Hero ,Left-Down
:END Case
FORK Optn:Varbl[0002:Key Input 2]-3
Move Event...: Hero ,Right-Down
:END Case
Enter Password: [0001:Key Input 1]
FORK Optn: Varbl[0001:Key Input 1]-1
:ELSE Case
Variable Ch:[0001:Key Input 1]Set,0
Variable Ch:[0002:Key Input 2]Set,0
:END Case

Page 3
Set event conditions to Key Input 1 at 2. In the Events commands box have and Enter password just like the one from the last page. Have a fork checking if Key Input 2 is equal to 1. In the fork have a move event making the hero step Left-Down. After that fork, have another fork checking if Key Input 2 is equal to 4. In the fork have a move event making the hero step Left-Up. After the fork, have an enter password for Key Input 1. Have a fork check if Key Input 1 is equal to 2, with an else case. In the else case set Key Input 1 and 2 to 0.

Code:
Enter Password: [0002:Key Input 2]
FORK Optn:Varbl[0002:Key Input 2]-1
Move Event...: Hero ,Left-Down
:END Case
FORK Optn:Varbl[0002:Key Input 2]-4
Move Event...: Hero ,Left-Up
:END Case
Enter Password: [0001:Key Input 1]
FORK Optn: Varbl[0001:Key Input 1]-2
:ELSE Case
Variable Ch:[0001:Key Input 1]Set,0
Variable Ch:[0002:Key Input 2]Set,0
:END Case

Page 4
In the event conditions set it to Key Input 1 at 3. In the events commands box have another enter password for key input 2(same checks in boxes). Have a fork checking if Key Input 2 is equal to 1. In the fork move the hero Right-Down. After the fork, create another fork checking to see if Key Input 2 is equal to 4. In the fork move the hero Right-Up. After the fork have an enter password for key input 1. Have a fork checking if key input 1 is equal to 3 and make sure it has an else case. In the else case set key input 1 and 2 to 0.

Code:
Enter Password: [0002:Key Input 2]
FORK Optn:Varbl[0002:Key Input 2]-1
Move Event...: Hero ,Right-Down
:END Case
FORK Optn:Varbl[0002:Key Input 2]-4
Move Event...: Hero ,Right-Up
:END Case
Enter Password: [0001:Key Input 1]
FORK Optn: Varbl[0001:Key Input 1]-3
:ELSE Case
Variable Ch:[0001:Key Input 1]Set,0
Variable Ch:[0002:Key Input 2]Set,0
:END Case

Page 5
In the event conditions set it to Key Input 1 at 4. In the events commands box have another enter password for key input 2(same checks in boxes). Have a fork checking if Key Input 2 is equal to 2. In the fork move the hero Left-Up. After the fork, create another fork checking to see if Key Input 2 is equal to 3. In the fork move the hero Right-Up. After the fork have an enter password for key input 1. Have a fork checking if key input 1 is equal to 4 and make sure it has an else case. In the else case set Key Input 1 and 2 to 0.

Code:
Enter Password: [0002:Key Input 2]
FORK Optn:Varbl[0002:Key Input 2]-2
Move Event...: Hero ,Left-Up
:END Case
FORK Optn:Varbl[0002:Key Input 2]-3
Move Event...: Hero ,Right-Up
:END Case
Enter Password: [0001:Key Input 1]
FORK Optn: Varbl[0001:Key Input 1]-4
:ELSE Case
Variable Ch:[0001:Key Input 1]Set,0
Variable Ch:[0002:Key Input 2]Set,0
:END Case

Page 6
Leave this page blank. End Stuff Thats it, now just copy this event and put it on every map in your game and you will have 8-way movement in your entire game.
Old
Profile PM WWW Search
NonGayMan enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHzNonGayMan enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHz
 
 
NonGayMan