-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit 5512246
Showing
173 changed files
with
4,336 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// @description Destroy Components | ||
|
||
component_remove(id, all); | ||
|
||
asset_clear_tags(id, asset_object); |
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,3 @@ | ||
/// @description Init | ||
|
||
__components = {}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/// @description Init Game | ||
global.pause = false; | ||
instance_create_layer(0, 0, "Controllers", InputManager); | ||
instance_create_layer(0, 0, "Controllers", world_gameplay); | ||
|
||
room_goto(rm_playroom); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/// @description Init Inputs | ||
|
||
#macro INPUT_RIGHT ord("D") | ||
#macro INPUT_LEFT ord("A") | ||
#macro INPUT_UP ord("W") | ||
#macro INPUT_DOWN ord("S") | ||
|
||
get_x = function() { | ||
return keyboard_check(INPUT_RIGHT) - keyboard_check(INPUT_LEFT); | ||
} | ||
|
||
get_y = function() { | ||
return keyboard_check(INPUT_DOWN) - keyboard_check(INPUT_UP); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/// @description Destroy Systems | ||
|
||
system_destroy(all); | ||
unsubscribe(); |
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,55 @@ | ||
#macro CH_ENTITY_ADD "Add_Entity" | ||
#macro CH_ENTITY_REMOVE "Remove_Entity" | ||
|
||
/// @description Init | ||
system_updater_receiver = new Receiver([CH_ENTITY_ADD, CH_ENTITY_REMOVE]); | ||
systems = []; | ||
|
||
/// @param system[s] | ||
function system_add(system) { | ||
if (is_array(system)) { | ||
for (var i = 0; i < array_length(system); i++) { | ||
array_push(systems, system[i]); | ||
if (system[i].create != undefined) { | ||
system[i].create(); | ||
} | ||
} | ||
} else { | ||
array_push(systems, system); | ||
if (system.create != undefined) { | ||
system.create(); | ||
} | ||
} | ||
} | ||
|
||
/// @param system[s]/all | ||
function system_destroy(system) { | ||
if (system == all) { | ||
for (var i = 0; i < array_length(systems); i++) { | ||
if (systems[i].destroy != undefined) { | ||
systems[i].destroy(); | ||
} | ||
delete begin_step_systems[i]; | ||
} | ||
array_resize(systems, 0); | ||
} else if (is_array(system)) { | ||
for (var i = 0; i < array_length(system); i++) { | ||
__system_destroy_find(system[i]); | ||
} | ||
} else { | ||
__system_destroy_find(system); | ||
} | ||
} | ||
|
||
__system_destroy_find = function(system) { | ||
// SEARCH BEGIN STEP SYSTEMS | ||
for (var i = array_length(systems) - 1; i >= 0; i--) { | ||
if (systems[i].name == system) { | ||
if (systems[i].destroy != undefined) { | ||
systems[i].destroy(); | ||
} | ||
delete systems[i]; | ||
array_delete(systems, i, 1); | ||
} | ||
} | ||
} |
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,8 @@ | ||
for (var i = 0; i < array_length(systems); i++) { | ||
var _system = systems[i]; | ||
if (global.pause and _system.is_pausable()) { continue; } | ||
|
||
if (_system.draw != undefined) { | ||
_system.draw(); | ||
} | ||
} |
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,8 @@ | ||
for (var i = 0; i < array_length(systems); i++) { | ||
var _system = systems[i]; | ||
if (global.pause and _system.is_pausable()) { continue; } | ||
|
||
if (_system.drawGUI != undefined) { | ||
_system.drawGUI(); | ||
} | ||
} |
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,8 @@ | ||
for (var i = 0; i < array_length(systems); i++) { | ||
var _system = systems[i]; | ||
if (global.pause and _system.is_pausable()) { continue; } | ||
|
||
if (_system.drawBegin != undefined) { | ||
_system.drawBegin(); | ||
} | ||
} |
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,8 @@ | ||
for (var i = 0; i < array_length(systems); i++) { | ||
var _system = systems[i]; | ||
if (global.pause and _system.is_pausable()) { continue; } | ||
|
||
if (_system.drawEnd != undefined) { | ||
_system.drawEnd(); | ||
} | ||
} |
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,5 @@ | ||
for (var i = 0; i < array_length(systems); i++) { | ||
if (systems[i].roomStart != undefined) { | ||
systems[i].roomStart(); | ||
} | ||
} |
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,5 @@ | ||
for (var i = 0; i < array_length(systems); i++) { | ||
if (systems[i].roomEnd != undefined) { | ||
systems[i].roomEnd(); | ||
} | ||
} |
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,8 @@ | ||
for (var i = 0; i < array_length(systems); i++) { | ||
var _system = systems[i]; | ||
if (global.pause and _system.is_pausable()) { continue; } | ||
|
||
if (_system.step != undefined) { | ||
_system.step(); | ||
} | ||
} |
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,8 @@ | ||
for (var i = 0; i < array_length(systems); i++) { | ||
var _system = systems[i]; | ||
if (global.pause and _system.is_pausable()) { continue; } | ||
|
||
if (_system.beginStep != undefined) { | ||
_system.beginStep(); | ||
} | ||
} |
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,8 @@ | ||
for (var i = 0; i < array_length(systems); i++) { | ||
var _system = systems[i]; | ||
if (global.pause and _system.is_pausable()) { continue; } | ||
|
||
if (_system.endStep != undefined) { | ||
_system.endStep(); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/// @description Player State Definitions | ||
|
||
// Inherit the parent event | ||
event_inherited(); | ||
|
||
var _fsm = new StateMachineComponent(); | ||
|
||
_fsm.createState("Idle") | ||
.addComponent(SpriteComponent).withSingleton(new SpriteComponent(spr_player_idle)).endComponent() | ||
.createTransition("Move") | ||
.addConsideration(new MoveInputConsideration()) | ||
.endTransition() | ||
|
||
_fsm.createState("Move") | ||
.addComponent(SpriteComponent).withSingleton(new SpriteComponent(spr_player_move)).endComponent() | ||
.addComponent(VelocityComponent).withData(new VelocityComponent(4)).endComponent() | ||
.addComponent(PlayerMoveTag).endComponent() | ||
.createTransition("Idle") | ||
.addConsideration(new NoMoveInputConsideration()) | ||
.endTransition() | ||
|
||
_fsm.setInitialState("Idle"); | ||
|
||
component_add(id, [ | ||
_fsm, | ||
new CameraFollowComponent(), | ||
new MoveComponent() | ||
]); |
Oops, something went wrong.