Code Monkey home page Code Monkey logo

cd_keymaster's Introduction

Keymaster - a minigame by Codesign

Codesign keymaster minigame

Description

Keymaster is a simple skill-based minigame that draws inspiration from rhythm games and that GTA SA Mission - "Lowrider Challenge".

Players need to press the correct key once it enters the target field. If they are successful they gain points based on their accuracy and lose points if they miss.

The goal of the game is to acquire a set number of points within the given time frame and with a minimal amount of missed keys.

Keymaster has several configurable options ( per game ):

  • Score
  • Allowed misses
  • Time frame
  • Key sequence
  • Speed increment ( after a successful hit )

This allows server managers and devs to adjust the difficulty based on the task players need to complete.

Devs can call the minigame by sending difficulty ( config ) parameters. They will receive a callback once the game is finished ( success or fail ). This allows you to use it anywhere you wish!

Give your players a real challenge with Keymaster and replace those boring progress bars that require nothing but waiting!

Instructions

HERES AN EXAMPLE HOW TO START THE MINI GAME:

YOU CAN CUSTOMISE THE SETTINGS BY SENDING THIS TABLE IN THE EXPORT :

local CustomSettings = {
    settings = {
        handleEnd = true;  --Send a result message if true and callback when message closed or callback immediately without showing the message
        speed = 10; --pixels / second
        scoreWin = 1000; --Score to win
        scoreLose = -150; --Lose if this score is reached
        maxTime = 60000; --sec
        maxMistake = 5; --How many missed keys can there be before losing
        speedIncrement = 1; --How much should the speed increase when a key hit was successful
    },
    keys = {"a", "w", "d", "s", "g"}; --You can hash this out if you want to use default keys in the java side.
}

OR YOU CAN LEAVE IT EMPTY AND THE SCRIPT WILL USE THE DEFAULT VALUES IN THE TABLE IN THE CLIENT.LUA (line 4).

WHEN THE MINI GAME UI HAS CLOSED, THE EXPORT WILL RETURN TRUE OR FALSE BASED ON YOUR RESULT.

Example 1

local example = exports['cd_keymaster']:StartKeyMaster(CustomSettings)
if example then
    print('im a winner)
else
    print('i suck so bad)
end

Example 2

local example = exports['cd_keymaster']:StartKeyMaster()
if example then
    print('im a winner)
else
    print('i suck so bad)
end

cd_keymaster's People

Contributors

dsheedes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.