Skip to content
Olle Kaiser edited this page May 16, 2018 · 4 revisions

Welcome to the Mini-Rumble Docs!

Here, all the library has to offer will documented so that anyone can create their own Mini-Rumble game! To start of, this is how the structure for a mini game looks. It should be located in the folder /minigames in a file with the same name as the mini-game variable. Check out the minigames folder to see a bunch of examples! Remember to link the script file in index.html

var nameOfMinigame = {
  varName: "nameOfMinigame", /* The exact name of the variable. */
  displayName: "Test mini-game", /* The display name of the mini-game; Shown in the menu when togglening mini-games. */
  timed: true, /* If the mini-game should have a 5-second time restriction. */
  timedWin: false, /* Weather or not the mini-game should be won when the time runs out. */
  /* Weather or not the mini-game is timebased or not. If this is false, the timer will be disabled. */
  introText: "Something!", 
  /* This is the text that will displayed during the game intro, this should be a short explaination of what the objective in the mini-game is.*/
  textures: [
    "filename.png"
  ],
    /* If your mini-game contains textures, enter them in here. default path is /textures. */
  sounds: [
    "filename.mp3"
  ],
  /* If your mini-game contains sound effects, enter them in here. default path is /sounds. */
  init: function(difficulty){
    this.example = "example"; // This is how you would initiate a variable.

    /* This function runs when the mini-game starts, variables that needs to be reset should be initiatied here. Difficulty is the increasing difficulty (starts at 0). The difficulty variable should be used to set the difficulty of the mini-game*/
},
  paint: function(){
    /* Render function, is called every frame.*/
  },
  loop: function(){
    /* Loop function, called every frame before paint() */
  },
  logic: function(key){
    /* Logic is called on a keypress, you can use this for key initiated actions. */
  }
}

miniGames.push(nameOfMinigame); /* Push to the global mini-games variable */
Clone this wiki locally