function onGameInit() {
// something here
}
function onGameStart(longNotes=boolean) {
// something here
}
function beatHit() {
// something here
}
function stepHit() {
// something here
}
function onNotesHit(longNotes=boolean) {
// something here
}
function onMiss(longNotes=boolean) {
// something here
}
function onNotesOpponentHit() {
// something here
}
function onOpponentMiss() {
// something here
}
function onEvents(data=[array]) {
// something here
}
can be use like this :
function onEvents(data) {
console.log("the events '"+data[0]+"' with in '"+data[1]+"' and '"+data[2]+"' have been played :D !")
}
// if your event is ["my events","test content1","test content2"]
// output: "the events 'my events' with in 'test content1' and 'test content2' have been played :D !"
FMS_playAnim() can be used for play custom characters (dad, gf, bf) anim
FMS_playAnim(characterName="string",animName="string",isLooping="boolean");
exemple :
// play *player* *cheer* animation without looping it
FMS_playAnim("bf","cheer",false);
avansed exemple :
// play in loop *opponent* *sad* animation every time the player do a good notes hit
function onNotesHit(longNotes) {
FMS_playAnim("dad","sad",true);
}
-- in jlua
function onNotesHit(longNotes)
FMS_playAnim("dad","sad",true);
end
FMS_makeElement() can be used for make elements like a boxe, square, circle... for a UI !
FMS_makeElement(id="element",x = 1,y = 1,z = 1,w = 100,h = 100,putIn = "default/GAME/GUI etc..")
exemple :
FMS_makeElement("aBoxe",10,100,1,200,200,"GAME")
avansed exemple :
let boxe = FMS_makeElement("aBoxe",10,100,1,200,200,"GAME");
boxe.style.opacity = 0.5;
boxe.onclick = function () {
boxe.remove();
}
local boxe = FMS_makeElement("aBoxe",10,100,1,200,200,"GAME")
boxe.style.opacity = 0.5
boxe.onclick = function ()
boxe.remove()
end
FMS_makeText() can be used for make a simple Text !
FMS_makeText(id = "element",text = "Hello word !",x = 1,y = 1,z = 1,scale = 1,putIn = "default")
exemple :
FMS_makeText("myText","Hello word !",1,1,2,1,"GUI")
avansed exemple :
var text = FMS_makeText("myText","Hello word !",1,1,2,1,"GUI");
var x = 1;
setInterval((/* move the text at the right */) => {
x++; // add +1 every loop
text.style.left = x+"px";
},10) // 0.1 sec
local text = FMS_makeText("myText","Hello word !",1,1,2,1,"GUI");
local x = 1;
loop(function (--[[ move the text at the right ]])
x++; --add +1 every loop
text.style.left = x+"px";
end,10) --0.1 sec
FMS_makeImage() can be used for put image !
FMS_makeText(id = "element",scr = "path/to/my/images",x = 1,y = 1,z = 1,scale = 1,putIn = "default")
exemple :
FMS_makeImage("myImages",game.imagesFolder+"/myImages.png",1,1,2,1,"GUI")
avansed exemple :
var images = FMS_makeText("myText",game.imagesFolder+"/myImages.png",1,1,2,1,"GUI");
// show the image every time the opponent note press
function onNotesOpponentHit() {
images.style.visibility = "visible";
setTimeOut((/* wait 1 sec*/) => {
images.style.visibility = "hidden";
},1000) // 1 sec
}
local images = FMS_makeText("myText",game.imagesFolder+"/myImages.png",1,1,2,1,"GUI")
-- show the image every time the opponent note press
function onNotesOpponentHit()
images.style.visibility = "visible";
setTimeOut(function (--[[ wait 1 sec ]])
images.style.visibility = "hidden"
end,1000) -- 1 sec
end
FMS_makeFolder() can be used for put any element in or derivate for turn it into a UI !
FMS_makeFolder(id = "element",putIn = "default")
exemple :
FMS_makeFolder("myFolder","GUI")
avansed exemple :
var folder = FMS_makeFolder("myFolder","GUI");
folder.appendChild(game.gui); // put all the gui in the folder xd
// or
folder.style.backgroundColor = "blue"; // make all the background blue
folder.style.width = "100px";
folder.style.height = "100px";
local folder = FMS_makeFolder("myFolder","GUI");
folder.appendChild(game.gui) -- put all the gui in the folder xd
-- or
folder.style.backgroundColor = "blue" -- make all the background blue
folder.style.width = "100px"
folder.style.height = "100px"
FMS_saveFile() can be used for save any element in file !
FMS_saveFile(filename = "myText.txt",data = "hello words !",as = "text/plain")
exemple :
FMS_saveFile("myList.txt","idk why there nothing.",as = "text/plain");
avansed exemple :
function onGameStart() {
FMS_saveFile("stealedEvent.txt",game.events); // save all events.FM
}
function onGameStart()
FMS_saveFile("stealedEvent.txt",game.events) -- save all events.FM
end
for making custom anim in start with this simple scripts :] : work same with lua
makeLocalAnim("mySprite",game.modsFolder +"/images/myAnimation,10,0,0,1,"GAME",100,true,0,0, false, false)
working like that :
makeLocalAnim(id, src, length, x, y, scale, putIn, speed, isloop, xdelay, ydelay, flip, paddingLength, otherCss)
putIn : <div id="hi"></div>
paddingLength : true your anim work like : myAnim0000.png > myAnim0018.png false your anim work like myAnim0.png > myAnim18.pngotherCss : background-Color: red; transfrom: rotate(20deg);
// you can use this for that ex: "ease"
// rotate the game
var myEase = "ease-in";
var myAnimation = FMS_makeCSSanim("GAME",1,myEase,"1",[
{ transform: 'rotate(95deg)' }
])
myAnimation.play();
myAnimation.onfinish = function(){}
linear :
ease :
ease-in-out
cubic-bezier(0.25, 0.1, 0.25, 1)
step :
step-end
steps(4, end)
more value here !