These are the steps.
1. Right click Actor and select Actor Control
2. Click Events: Add then Key Down
3. Type in right(using arrow keys)
4. Click Add Action then Script Editor
5. Type
- Code: Select all
x+=5;
6. Click Add, then Immediate action
7. Close
2. Click Events: Add then Key Down
3. Type in left(using arrow keys)
4. Click Add Action then Script Editor
5. Type
- Code: Select all
x-=5;
6. Click Add, then Immediate action
7. Close
2. Click Events: Add then Key Down
3. Type in up(using arrow keys)
4. Click Add Action then Script Editor
5. Type
- Code: Select all
y-=5;
6. Click Add, then Immediate action
7. Close
2. Click Events: Add then Key Down
3. Type in down(using arrow keys)
4. Click Add Action then Script Editor
5. Type
- Code: Select all
y+=5;
6. Click Add, then Immediate action
7. Close
Another way, ignore this if it is too complicated... I prefer this method as I prefer doing most of my code in the script editor, but it requires a small amount of coding knowledge...
1. Right click Actor and select Actor Control
2. Click Events: Add then Draw Actor
3. Click Add Action then Script Editor
5. Type
- Code: Select all
char *key=GetKeyState();
if (key[KEY_RIGHT]==1)
{
x+=5;
}
if (key[KEY_LEFT]==1)
{
x-=5;
}
if (key[KEY_DOWN]==1)
{
y+=5;
}
if (key[KEY_UP]==1)
{
y-=5;
}
6. Click Add, then Immediate action
7. Close