-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
282 additions
and
6 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
docs/6.1/Functions-(Creating-Combos).md → docs/6.1/Functions-(Combo-Creation).md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Functions (Creating Combos) | ||
# Functions (Combo Parameters) | ||
|
||
| ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
# Functions (Combo Getters) | ||
|
||
| ||
|
||
## …combo_get_phase_count | ||
|
||
`input_combo_get_phase_count(comboName)` | ||
|
||
<!-- tabs:start --> | ||
|
||
#### **Description** | ||
|
||
**Returns:** Integer, the number of phases in the combo definition | ||
|
||
|Name |Datatype|Purpose | | ||
|-----------|--------|---------------------------| | ||
|`comboName`|string |Name of the combo to target| | ||
|
||
#### **Example** | ||
|
||
```gml | ||
//Form a string to show what phase the "fireball" combo is in | ||
//This'll help the player learn the combo step by step | ||
|
||
var _string = "Phase " | ||
+ string(input_combo_get_phase("fireball")) | ||
+ " of " | ||
+ string(input_combo_get_phase_count("fireball")); | ||
|
||
draw_text(10, 10, _string); | ||
``` | ||
<!-- tabs:end --> | ||
| ||
## …combo_get_phase | ||
`input_combo_get_phase(comboName, [playerIndex=0])` | ||
<!-- tabs:start --> | ||
#### **Description** | ||
**Returns:** Integer, which phase the player is currently waiting to complete | ||
|Name |Datatype|Purpose | | ||
|---------------|--------|----------------------------------------------------| | ||
|`comboName` |string |Name of the combo to target | | ||
|`[playerIndex]`|integer |Player to target. If not specified, player 0 is used| | ||
#### **Example** | ||
```gml | ||
var _phase = input_combo_get_phase("yanling"); | ||
if (_phase >= 3) | ||
{ | ||
//Calculate the number of particles we should create | ||
//As the "yanling" combo proceeds we'll create more particles | ||
var _density = (_phase - 2)*3; | ||
pfx_fire_generate(x, y, _density); | ||
} | ||
``` | ||
|
||
<!-- tabs:end --> | ||
|
||
| ||
|
||
## …combo_get_new_phase | ||
|
||
`input_combo_get_new_phase(comboName, [playerIndex=0])` | ||
|
||
<!-- tabs:start --> | ||
|
||
#### **Description** | ||
|
||
**Returns:** Boolean, whether a new phase was entered this step | ||
|
||
|Name |Datatype|Purpose | | ||
|---------------|--------|----------------------------------------------------| | ||
|`comboName` |string |Name of the combo to target | | ||
|`[playerIndex]`|integer |Player to target. If not specified, player 0 is used| | ||
|
||
#### **Example** | ||
|
||
```gml | ||
if (input_combo_get_new_phase("hi jump kick")) | ||
{ | ||
if (input_combo_get_phase("hi jump kick") == 3) | ||
{ | ||
//If we've triggered a jump then swap over to a special sprite | ||
sprite_index = spr_combo_hjk_special_jump; | ||
} | ||
} | ||
``` | ||
|
||
<!-- tabs:end --> | ||
|
||
| ||
|
||
## …combo_get_charge | ||
|
||
`input_combo_get_charge(comboName, [playerIndex=0])` | ||
|
||
<!-- tabs:start --> | ||
|
||
#### **Description** | ||
|
||
**Returns:** Number, the charge time for the most recently encountered charge phase | ||
|
||
|Name |Datatype|Purpose | | ||
|---------------|--------|----------------------------------------------------| | ||
|`comboName` |string |Name of the combo to target | | ||
|`[playerIndex]`|integer |Player to target. If not specified, player 0 is used| | ||
|
||
#### **Example** | ||
|
||
```gml | ||
if (input_check_pressed("shockwave aoe")) | ||
{ | ||
var _inst = instance_create_layer(x, y, layer, obj_shockwave); | ||
|
||
if (input_combo_get_charge("shockwave aoe") > 25) | ||
{ | ||
//If the combo was charged longer than 25 frames, use the bigger collision sprite | ||
_inst.sprite_index = spr_shockwave_aoe_big; | ||
} | ||
} | ||
``` | ||
|
||
<!-- tabs:end --> | ||
|
||
| ||
|
||
## …combo_get_direction | ||
|
||
`input_combo_get_direction(comboName, [playerIndex=0])` | ||
|
||
<!-- tabs:start --> | ||
|
||
#### **Description** | ||
|
||
**Returns:** Number or `undefined`, the determined direction for the combo's execution | ||
|
||
|Name |Datatype|Purpose | | ||
|---------------|--------|----------------------------------------------------| | ||
|`comboName` |string |Name of the combo to target | | ||
|`[playerIndex]`|integer |Player to target. If not specified, player 0 is used| | ||
|
||
#### **Example** | ||
|
||
```gml | ||
if (input_check_pressed("fireball")) | ||
{ | ||
var _inst = instance_create_layer(x, y, layer, obj_fireball); | ||
_inst.direction = input_combo_get_direction("fireball"); | ||
} | ||
``` | ||
|
||
<!-- tabs:end --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
# Functions (Combo Parameters) | ||
|
||
| ||
|
||
In Input, a "combo" is a sequence of inputs that need to be executed in a timely fashion to trigger some sort of player action. These are ubiquitous (and perhaps synonymous) with fighting games that regularly use a long chains of button inputs to skilltest the most powerful attacks. Less stringent combos are also found in other games that have some sort of skill mastery and combat component. Finally, combos are occasionally useful for triggering cheat codes. | ||
|
||
Input offers a compact but powerful API to manage combos, including charge moves and directionality. This page will describe how to set up the combo system. Getter functions specifically associated with combos can be found [here](Functions-(Combo-Getters)). | ||
|
||
| ||
|
||
## …combo_params_set_side_on | ||
|
||
`input_combo_params_set_side_on(forwardVerb, backwardVerb, referenceDirection)` | ||
|
||
<!-- tabs:start --> | ||
|
||
#### **Description** | ||
|
||
**Returns:** N/A (`undefined`) | ||
|
||
|Name |Datatype|Purpose | | ||
|--------------------|--------|-------------------------------------------------| | ||
|`forwardVerb` |verb |Verb to use to indicate the forward direction | | ||
|`backwardVerb` |verb |Verb to use to indicate the backward direction | | ||
|`referenceDirection`|number |Game world angle to use for the forward direction| | ||
|
||
#### **Example** | ||
|
||
```gml | ||
//Set up combos such that "left" is considered the "forward" direction | ||
//To correctly line up results from input_combo_get_direction() with the game world, use 180 as the reference direction | ||
input_combo_params_set_side_on("left", "right", 180); | ||
``` | ||
<!-- tabs:end --> | ||
| ||
## …combo_params_set_top_down | ||
`input_combo_params_set_top_down(forwardVerb, counterclockwiseVerb, backwardVerb, clockwiseVerb, referenceDirection)` | ||
<!-- tabs:start --> | ||
#### **Description** | ||
**Returns:** N/A (`undefined`) | ||
|Name |Datatype|Purpose | | ||
|----------------------|--------|--------------------------------------------------------| | ||
|`forwardVerb` |verb |Verb to use to indicate the forward direction | | ||
|`counterclockwiseVerb`|verb |Verb to use to indicate the counter-clockwise direction | | ||
|`backwardVerb` |verb |Verb to use to indicate the backward direction | | ||
|`clockwiseVerb` |verb |Verb to use to indicate the clockwise direction | | ||
|`referenceDirection` |number |Game world angle to use for the forward direction | | ||
?> | ||
#### **Example** | ||
```gml | ||
//Set up combos to interpret the right-hand direction as "forwards" | ||
input_combo_params_set_top_down("right", "up", "left", "down", 0); | ||
``` | ||
|
||
<!-- tabs:end --> | ||
|
||
| ||
|
||
## …combo_params_get | ||
|
||
`input_combo_params_get()` | ||
|
||
<!-- tabs:start --> | ||
|
||
#### **Description** | ||
|
||
**Returns:** Struct, see below | ||
|
||
|Name|Datatype|Purpose| | ||
|----|--------|-------| | ||
|None| | | | ||
|
||
Returns the current combo parameters as a struct. The struct contains the following member variables: | ||
|
||
|Variable |Datatype|Purpose | | ||
|-----------------------|--------|-------------------------------------------------------------------------| | ||
|`reset` |boolean |Whether the combo parameters have been reset i.e. blank/invalid | | ||
|`side_on` |boolean |Whether the side-on mode (`true`) or top-down mode (`false`) has been set| | ||
|`forward_verb` |verb |Name of the verb for the forward direction | | ||
|`counterclockwise_verb`|verb |Name of the verb for the counter-clockwise direction, if applicable | | ||
|`backward_verb` |verb |Name of the verb for the forward direction | | ||
|`clockwise_verb` |verb |Name of the verb for the clockwise direction, if applicable | | ||
|`reference_direction` |number |Reference angle for the forward direction | | ||
|
||
<!-- tabs:end --> | ||
|
||
| ||
|
||
## …combo_params_reset | ||
|
||
`input_combo_params_reset()` | ||
|
||
<!-- tabs:start --> | ||
|
||
#### **Description** | ||
|
||
**Returns:** N/A (`undefined`) | ||
|
||
|Name|Datatype|Purpose| | ||
|----|--------|-------| | ||
|None| | | | ||
|
||
Resets combo parameters entirely. This will force all combos defined as "directional" to be evaluated non-directional until `input_combo_params_set_side_on()` or `input_combo_params_set_top_down()` are called. | ||
|
||
Honestly, I'm not sure what the use case is for this function is but it exists if you need it. | ||
|
||
<!-- tabs:end --> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters