Merge pull request #786 from craftersshaft/stable

adds Acceleration, Drag and Velocity to X and Y for Actors in Modcharts
This commit is contained in:
Kade M 2021-06-10 12:57:17 -07:00 committed by GitHub
commit 7de0dc050e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 77 additions and 3 deletions

View File

@ -41,8 +41,8 @@ If you're looking for documentation, changelogs, or guides, you can find those o
- An improved input system, similar to Quaver or Etterna, with less delays, less dropped inputs and other improvements.
- **More information during gameplay**
- While you're playing, we show you information about how you're doing, such as your accuracy, combo break count, notes per second, and your grade/rating.
- **Better key layouts**
- Instead of being forced to use WASD and the arrow keys, now you can play with DFJK!
- **Customizable keybinds**
- Instead of being forced to use WASD and the arrow keys, you can customize the keybinds to any keys you want!
- **Replays** (in beta)
- Have you ever gotten a crazy score but didn't record? The replay system solves that: it automatically saves a "replay" of your gameplay every time you complete a song, which you can play back inside of the game.
- Replays just store information about what you're doing, they don't actually record the screen -- so they take up way less space on your disk than videos.

View File

@ -1,4 +1,6 @@
# Changelogs
- [Latest](latest) (Contains changes that are not in a release yet)
- [1.5.1](1.5.1)
- [1.5.0](1.5.0)
- [1.4.2 and before](changelog-pre)

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;
});