Skip to content

Commit

Permalink
Add README and other supporting files
Browse files Browse the repository at this point in the history
  • Loading branch information
nickavv committed Apr 25, 2022
1 parent 739930b commit 6c92714
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore .yy files for language statistics
.yy linguist-generated=true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cadence/options/
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
55 changes: 54 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,55 @@
# gm-cadence
Cadence is a simple GameMaker library to allow scheduling code to run at certain times and for certain durations
![banner graphic](banner.png)

Cadence is a library for modern GameMaker projects for scheduling execution of code. It presents a simple API that lets you run any function with a given frame delay and repeat duration.

#### Table of Contents
* [Setup](#setup)
* [Usage](#usage)
* [Licensing](#licensing)
* [Attribution](#attribution)

## Setup

Integrating Cadence into your project is simple: just [download the latest release](https://github.com/daikon-games/cadence/releases), and then in GameMaker click on the **Tools** menu and select **Import Local Package**. Choose the `.yymps` file you downloaded, and import all assets.

Alternatively you can install Cadence from the [Game Maker Marketplace]().

Absolutely no further configuration is required! Just start calling `run_in_frames`

## Usage

Cadence exposes the following function:

```
run_in_frames(routine, executionDelay, [steps])
```

Note that `run_in_frames` is not a method of an object but rather provided globally by the script file `scr_cadence`.

Simply call it with any function you wish to execute in the `routine` parameter. The other two parameters control the timing of the function execution.

`executionDelay` is the number of frames that Cadence will wait before executing `routine`.
```
run_in_frames(function() {
show_debug_message("hello!")
}, 15);
```
The above code example will wait for 15 frames from the time of its execution, and then print `Hello` to the output console.

The other parameter, `steps`, is optional. If not provided it defaults to `1`.
```
run_in_frames(function() {
show_debug_message("hello!")
}, 15, 10);
```
The above code example will wait for 15 frames from the time of its execution, and then print `Hello` once per frame for an additional 10 frames.

## Licensing

Polyglot is licensed under Creative Commons BY 4.0. Essentially, you may use it, change it, ship it, and share it, with attribution.
Just make sure to somewhere mention the use of **Cadence by Daikon Games**!

## Attribution
### Fonts
Demo font, [Peaberry](https://emhuo.itch.io/peaberry-pixel-font) by emhuo
Binary file added banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6c92714

Please # to comment.