This commit is contained in:
craftersshaft 2021-06-07 21:14:13 -04:00
parent 06c3adba92
commit 93fc1ab70a
2 changed files with 73 additions and 1 deletions

View File

@ -109,6 +109,30 @@ for i = 4, 7 do -- go to the center
end
```
Jumping Arrows Example
```lua
function stepHit (step)
if step == 1 then
setActorAccelerationY(100, 4)
end
if step == 3 then
setActorAccelerationY(100, 5)
end
if step == 5 then
setActorAccelerationY(100, 6)
end
if step == 7 then
setActorAccelerationY(100, 7)
end
for i=4,7 do
if getActorY(i) >= 100 then
setActorY(100, i)
setActorVelocityY(-100, i)
end
end
end
```
### Available Hooks
@ -376,10 +400,34 @@ Returns the angle for the sprite id
Set's the x position for the sprite id
##### setActorAccelerationX(int x, string/int id)
Sets the x acceleration for the sprite id
##### setActorDragX(int x, string/int id)
Sets the x drag for the sprite id
##### setActorVelocityX(int x, string/int id)
Sets the x velocity for the sprite id
##### setActorY(int y, string/int id)
Set's the y position for the sprite id
##### setActorAccelerationY(int y, string/int id)
Sets the y acceleration for the sprite id
##### setActorDragY(int y, string/int id)
Sets the y drag for the sprite id
##### setActorVelocityY(int y, string/int id)
Sets the y velocity for the sprite id
##### setActorAlpha(float alpha, string/int id)
Set's the alpha for the sprite id

View File

@ -564,6 +564,18 @@ class ModchartState
getActorByName(id).x = x;
});
Lua_helper.add_callback(lua,"setActorAccelerationX", function(x:Int,id:String) {
getActorByName(id).acceleration.x = x;
});
Lua_helper.add_callback(lua,"setActorDragX", function(x:Int,id:String) {
getActorByName(id).drag.x = x;
});
Lua_helper.add_callback(lua,"setActorVelocityX", function(x:Int,id:String) {
getActorByName(id).velocity.x = x;
});
Lua_helper.add_callback(lua,"playActorAnimation", function(id:String,anim:String,force:Bool = false,reverse:Bool = false) {
getActorByName(id).playAnim(anim, force, reverse);
});
@ -575,7 +587,19 @@ class ModchartState
Lua_helper.add_callback(lua,"setActorY", function(y:Int,id:String) {
getActorByName(id).y = y;
});
Lua_helper.add_callback(lua,"setActorAccelerationY", function(y:Int,id:String) {
getActorByName(id).acceleration.y = y;
});
Lua_helper.add_callback(lua,"setActorDragY", function(y:Int,id:String) {
getActorByName(id).drag.y = y;
});
Lua_helper.add_callback(lua,"setActorVelocityY", function(y:Int,id:String) {
getActorByName(id).velocity.y = y;
});
Lua_helper.add_callback(lua,"setActorAngle", function(angle:Int,id:String) {
getActorByName(id).angle = angle;
});