Welcome to the wiki! - CrackThrough/ADOFAI-WebModule GitHub Wiki

Welcome to the wiki!

Index

Getting started

Setting up environment

SKIP THIS if you know how to host an HTML file and test things there on your own.

The first thing you should do is importing the class, so you can interact with them. To actually use this Module, you need to create a js file importing the module.

To import the module, you must test and develop things you want to do on the host environment. Let's begin with that. (Here I will use node.js, but if you don't want to use it, you can choose other platforms as well.)

  1. Download node.js (globally, of course.) if you don't have it.
  2. Update node.js and npm and npx to the latest version.
  3. If you don't have http-server installed, install http-server by doing npm i -g http-server
  4. Open a command prompt or powershell and go to the directory you want.
  5. Run npx http-server -c-1 on a shell or prompt.
  6. Open a web browser and go to localhost:8080. Done! Now you can apply your changes by refreshing in there.

Using the module

SKIP THIS if you know how to use this module.

First of all, you should create your own javascript file for your website and import it. You can do it by copy pasting the code below.

<head>
  <script src="yourfile.js" type="module"></script>
</head>
...

Here you see type="module", this is required to use the module I made.

Now your javascript code (I will be using jQuery, but this is not needed):

import ADOFAI from "./any/path/ADOFAI-WebModule.js";

$(function () {
  var map = new ADOFAI(); // create a default level

  map.pathData.forEach((path, floor) => {
    // for each path
    floor++; // we add 1 here because we don't want to add a event at floor 0
    var setSpeedAction = new ADOFAI.Action(floor, "SetSpeed"); // create a SetSpeed action
    setSpeedAction.eventValue.isSpeedTypeBPM = false; // set speed type to multiplier
    setSpeedAction.eventValue.BPM_Multiplier = 1.15; // set bpm multiplier to 1.15

    map.actions.push(setSpeedAction); // push the action into map's action list
  });

  console.log(map.actions); // output the value
});

After the document is ready, you can create a level and modify it by creating an instance of the module directly, just like above.

And that is how you use this module.

Documentation

You can read the doc here.

This module can be used very easily on Visual Studio Code. There are a lot of comments, the autocompletion should work well.

⚠️ **GitHub.com Fallback** ⚠️