Using lua script to control sprite movement

Show us your completed creations made in Construct 2

Post » Mon Jan 27, 2014 9:14 am

Using lua script to control sprite movement
- Write lua script in the text area, then press "Run" button.
- Press "Reset" button to reset the text area to initial script
- Press "Menu" button to turn on/off text area

[code]Commands
SetXY(x,y) -- set position to (x,y)
F(x) -- move forward x pixel
B(x) -- move back x pixel
R(x) -- turn right x degree
L(x) -- turn left x degree[/code]

The lua vm was reference from lua.vm.js
Since javascript did not support coroutine, I used lua script in C2. It could call c2 function in lus script in my lua vm plugin.rexrainbow2014-01-27 09:44:17
B
110
S
28
G
280
Posts: 4,488
Reputation: 156,568

Post » Mon Jan 27, 2014 12:11 pm

very cool; can be very useful if used with AJAX, to script cutscenes
B
12
S
5
G
2
Posts: 132
Reputation: 2,637


Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 1 guest