From 55122461d89d593689e99a980ebe95f9c99a5825 Mon Sep 17 00:00:00 2001 From: FaultyFunctions Date: Sat, 26 Jun 2021 12:35:11 -0500 Subject: [PATCH] Initial commit --- FaultyECS.yyp | 160 ++++++++ objects/Entity/CleanUp_0.gml | 5 + objects/Entity/Create_0.gml | 3 + objects/Entity/Entity.yy | 34 ++ objects/GameManager/Create_0.gml | 6 + objects/GameManager/GameManager.yy | 33 ++ objects/InputManager/Create_0.gml | 14 + objects/InputManager/InputManager.yy | 33 ++ objects/SystemManager/CleanUp_0.gml | 4 + objects/SystemManager/Create_0.gml | 55 +++ objects/SystemManager/Draw_0.gml | 8 + objects/SystemManager/Draw_64.gml | 8 + objects/SystemManager/Draw_72.gml | 8 + objects/SystemManager/Draw_73.gml | 8 + objects/SystemManager/Other_4.gml | 5 + objects/SystemManager/Other_5.gml | 5 + objects/SystemManager/Step_0.gml | 8 + objects/SystemManager/Step_1.gml | 8 + objects/SystemManager/Step_2.gml | 8 + objects/SystemManager/SystemManager.yy | 43 ++ objects/obj_player/Create_0.gml | 28 ++ objects/obj_player/obj_player.yy | 39 ++ objects/obj_wall/Create_0.gml | 6 + objects/obj_wall/obj_wall.yy | 39 ++ objects/sys_animation/Create_0.gml | 9 + objects/sys_animation/sys_animation.yy | 36 ++ objects/sys_camera/Create_0.gml | 9 + objects/sys_camera/sys_camera.yy | 36 ++ objects/sys_movement/Create_0.gml | 6 + objects/sys_movement/sys_movement.yy | 36 ++ objects/sys_player_controller/Create_0.gml | 8 + .../sys_player_controller.yy | 36 ++ objects/sys_shadows/Create_0.gml | 8 + objects/sys_shadows/sys_shadows.yy | 36 ++ objects/sys_state_machine/Create_0.gml | 6 + .../sys_state_machine/sys_state_machine.yy | 36 ++ objects/sys_stats/Create_0.gml | 8 + objects/sys_stats/sys_stats.yy | 36 ++ objects/sys_utilities/Create_0.gml | 6 + objects/sys_utilities/sys_utilities.yy | 36 ++ objects/world_gameplay/Create_0.gml | 11 + objects/world_gameplay/world_gameplay.yy | 33 ++ options/linux/options_linux.yy | 25 ++ options/mac/options_mac.yy | 33 ++ options/main/options_main.yy | 17 + options/windows/options_windows.yy | 36 ++ rooms/rm_init/rm_init.yy | 55 +++ rooms/rm_playroom/rm_playroom.yy | 74 ++++ .../ActiveTimerConsideration.gml | 18 + .../ActiveTimerConsideration.yy | 12 + .../TimerConsideration.yy | 12 + .../AnimationEndConsideration.gml | 16 + .../AnimationEndConsideration.yy | 12 + .../AnimationEndConsideration.yy | 12 + .../AnimationEndMomentConsideration.gml | 17 + .../AnimationEndMomentConsideration.yy | 12 + .../AnimationFrameBetweenConsideration.gml | 12 + .../AnimationFrameBetweenConsideration.yy | 12 + .../AnimationFrameConsideration.gml | 26 ++ .../AnimationFrameConsideration.yy | 12 + .../AnimationPauseSystem.gml | 40 ++ .../AnimationPauseSystem.yy | 12 + scripts/AnimationSystem/AnimationSystem.gml | 61 +++ scripts/AnimationSystem/AnimationSystem.yy | 12 + scripts/ArrayHelpers/ArrayHelpers.gml | 27 ++ scripts/ArrayHelpers/ArrayHelpers.yy | 12 + .../CameraFollowComponent.gml | 7 + .../CameraFollowComponent.yy | 12 + .../CameraFollowComponent.yy | 12 + .../CameraShakeComponent.gml | 6 + .../CameraShakeComponent.yy | 12 + .../CameraShakeSystem/CameraShakeSystem.gml | 33 ++ .../CameraShakeSystem/CameraShakeSystem.yy | 12 + scripts/CameraShakeSystem/CameraSystem.yy | 12 + scripts/CameraSystem/CameraSystem.gml | 60 +++ scripts/CameraSystem/CameraSystem.yy | 12 + scripts/CounterComponent/CounterComponent.gml | 3 + scripts/CounterComponent/CounterComponent.yy | 12 + scripts/CounterSystem/CounterSystem.gml | 15 + scripts/CounterSystem/CounterSystem.yy | 12 + .../FacingDirectionComponent.gml | 3 + .../FacingDirectionComponent.yy | 12 + .../FrictionComponent/FrictionComponent.gml | 3 + .../FrictionComponent/FrictionComponent.yy | 12 + .../HasComponentConsideration.gml | 7 + .../HasComponentConsideration.yy | 12 + .../HasNotComponentConsideration.gml | 7 + .../HasNotComponentConsideration.yy | 12 + .../HealthBelowConsideration.gml | 9 + .../HealthBelowConsideration.yy | 12 + .../StaminaDepletedConsideration.yy | 12 + scripts/HealthComponent/HealthComponent.gml | 11 + scripts/HealthComponent/HealthComponent.yy | 12 + .../HealthConsumeComponent.gml | 4 + .../HealthConsumeComponent.yy | 12 + .../StaminaConsumeComponent.yy | 12 + .../HealthBelowConsideration.yy | 12 + .../HealthDepletedConsideration.gml | 8 + .../HealthDepletedConsideration.yy | 12 + .../StaminaDepletedConsideration.yy | 12 + .../HealthDrainComponent.gml | 7 + .../HealthDrainComponent.yy | 12 + scripts/HealthSystem/HealthSystem.gml | 38 ++ scripts/HealthSystem/HealthSystem.yy | 12 + .../ConstandSpeedComponent.yy | 12 + scripts/ImpulseComponent/ImpulseComponent.gml | 6 + scripts/ImpulseComponent/ImpulseComponent.yy | 12 + scripts/ImpulseComponent/VelocityComponent.yy | 12 + .../ImpulseFacingComponent.gml | 3 + .../ImpulseFacingComponent.yy | 12 + scripts/MoveComponent/MoveComponent.gml | 38 ++ scripts/MoveComponent/MoveComponent.yy | 12 + .../MoveInputConsideration.gml | 5 + .../MoveInputConsideration.yy | 12 + scripts/MovementSystem/MovementSystem.gml | 114 ++++++ scripts/MovementSystem/MovementSystem.yy | 12 + .../NoMoveInputConsideration.gml | 5 + .../NoMoveInputConsideration.yy | 12 + scripts/PlayerMoveSystem/PlayerMoveSystem.gml | 13 + scripts/PlayerMoveSystem/PlayerMoveSystem.yy | 12 + scripts/PlayerStateTags/PlayerStateTags.gml | 1 + scripts/PlayerStateTags/PlayerStateTags.yy | 12 + .../PreviousStateConsideration.gml | 14 + .../PreviousStateConsideration.yy | 12 + .../RandomTimerConsideration.gml | 19 + .../RandomTimerConsideration.yy | 12 + scripts/ShadowComponent/ShadowComponent.gml | 7 + scripts/ShadowComponent/ShadowComponent.yy | 12 + scripts/ShadowSystem/ShadowSystem.gml | 32 ++ scripts/ShadowSystem/ShadowSystem.yy | 12 + scripts/SolidTag/SolidTag.gml | 3 + scripts/SolidTag/SolidTag.yy | 12 + scripts/SpriteComponent/SpriteComponent.gml | 14 + scripts/SpriteComponent/SpriteComponent.yy | 12 + scripts/StateComponent/StateComponent.gml | 185 +++++++++ scripts/StateComponent/StateComponent.yy | 12 + .../StateMachineComponent.gml | 29 ++ .../StateMachineComponent.yy | 12 + .../StateMachineSystem/StateMachineSystem.gml | 141 +++++++ .../StateMachineSystem/StateMachineSystem.yy | 12 + .../TimerConsideration/TimerConsideration.gml | 18 + .../TimerConsideration/TimerConsideration.yy | 12 + scripts/UnpausableTag/UnpausableTag.gml | 3 + scripts/UnpausableTag/UnpausableTag.yy | 12 + scripts/Vector2/Vector2.gml | 247 ++++++++++++ scripts/Vector2/Vector2.yy | 12 + .../VelocityComponent/VelocityComponent.gml | 5 + .../VelocityComponent/VelocityComponent.yy | 12 + .../WallCollideConsideration.gml | 8 + .../WallCollideConsideration.yy | 12 + .../__ComponentFunctions.gml | 68 ++++ .../__ComponentFunctions.yy | 12 + .../__EntityFunctions/__EntityFunctions.gml | 3 + .../__EntityFunctions/__EntityFunctions.yy | 12 + .../__NotificationSystem.gml | 379 ++++++++++++++++++ .../__NotificationSystem.yy | 12 + .../__SystemFunctions/__SystemFunctions.gml | 106 +++++ .../__SystemFunctions/__SystemFunctions.yy | 12 + scripts/snap_deep_copy/snap_deep_copy.gml | 105 +++++ scripts/snap_deep_copy/snap_deep_copy.yy | 12 + .../78284bff-2ffb-47cc-b83f-a91486be9135.png | Bin 0 -> 229 bytes .../ed1c8057-d138-491e-bbbe-637c6a9586ee.png | Bin 0 -> 229 bytes sprites/spr_checkboard/spr_checkboard.yy | 79 ++++ .../ea48d3dd-25f2-429a-b853-7e4db4c54b91.png | Bin 0 -> 209 bytes .../10652100-57ca-474a-a52a-9b4b7316dbdd.png | Bin 0 -> 209 bytes sprites/spr_player_idle/spr_player_idle.yy | 79 ++++ .../ea48d3dd-25f2-429a-b853-7e4db4c54b91.png | Bin 0 -> 209 bytes .../10652100-57ca-474a-a52a-9b4b7316dbdd.png | Bin 0 -> 209 bytes sprites/spr_player_move/spr_player_idle.yy | 79 ++++ sprites/spr_player_move/spr_player_move.yy | 79 ++++ .../e4e6fbb0-1e04-4079-a3b2-0312b563ba47.png | Bin 0 -> 210 bytes .../f5f1c9a5-150a-4183-99b0-e00e04178a98.png | Bin 0 -> 210 bytes sprites/spr_wall/spr_wall.yy | 79 ++++ 173 files changed, 4336 insertions(+) create mode 100644 FaultyECS.yyp create mode 100644 objects/Entity/CleanUp_0.gml create mode 100644 objects/Entity/Create_0.gml create mode 100644 objects/Entity/Entity.yy create mode 100644 objects/GameManager/Create_0.gml create mode 100644 objects/GameManager/GameManager.yy create mode 100644 objects/InputManager/Create_0.gml create mode 100644 objects/InputManager/InputManager.yy create mode 100644 objects/SystemManager/CleanUp_0.gml create mode 100644 objects/SystemManager/Create_0.gml create mode 100644 objects/SystemManager/Draw_0.gml create mode 100644 objects/SystemManager/Draw_64.gml create mode 100644 objects/SystemManager/Draw_72.gml create mode 100644 objects/SystemManager/Draw_73.gml create mode 100644 objects/SystemManager/Other_4.gml create mode 100644 objects/SystemManager/Other_5.gml create mode 100644 objects/SystemManager/Step_0.gml create mode 100644 objects/SystemManager/Step_1.gml create mode 100644 objects/SystemManager/Step_2.gml create mode 100644 objects/SystemManager/SystemManager.yy create mode 100644 objects/obj_player/Create_0.gml create mode 100644 objects/obj_player/obj_player.yy create mode 100644 objects/obj_wall/Create_0.gml create mode 100644 objects/obj_wall/obj_wall.yy create mode 100644 objects/sys_animation/Create_0.gml create mode 100644 objects/sys_animation/sys_animation.yy create mode 100644 objects/sys_camera/Create_0.gml create mode 100644 objects/sys_camera/sys_camera.yy create mode 100644 objects/sys_movement/Create_0.gml create mode 100644 objects/sys_movement/sys_movement.yy create mode 100644 objects/sys_player_controller/Create_0.gml create mode 100644 objects/sys_player_controller/sys_player_controller.yy create mode 100644 objects/sys_shadows/Create_0.gml create mode 100644 objects/sys_shadows/sys_shadows.yy create mode 100644 objects/sys_state_machine/Create_0.gml create mode 100644 objects/sys_state_machine/sys_state_machine.yy create mode 100644 objects/sys_stats/Create_0.gml create mode 100644 objects/sys_stats/sys_stats.yy create mode 100644 objects/sys_utilities/Create_0.gml create mode 100644 objects/sys_utilities/sys_utilities.yy create mode 100644 objects/world_gameplay/Create_0.gml create mode 100644 objects/world_gameplay/world_gameplay.yy create mode 100644 options/linux/options_linux.yy create mode 100644 options/mac/options_mac.yy create mode 100644 options/main/options_main.yy create mode 100644 options/windows/options_windows.yy create mode 100644 rooms/rm_init/rm_init.yy create mode 100644 rooms/rm_playroom/rm_playroom.yy create mode 100644 scripts/ActiveTimerConsideration/ActiveTimerConsideration.gml create mode 100644 scripts/ActiveTimerConsideration/ActiveTimerConsideration.yy create mode 100644 scripts/ActiveTimerConsideration/TimerConsideration.yy create mode 100644 scripts/AnimationEndConsideration/AnimationEndConsideration.gml create mode 100644 scripts/AnimationEndConsideration/AnimationEndConsideration.yy create mode 100644 scripts/AnimationEndMomentConsideration/AnimationEndConsideration.yy create mode 100644 scripts/AnimationEndMomentConsideration/AnimationEndMomentConsideration.gml create mode 100644 scripts/AnimationEndMomentConsideration/AnimationEndMomentConsideration.yy create mode 100644 scripts/AnimationFrameBetweenConsideration/AnimationFrameBetweenConsideration.gml create mode 100644 scripts/AnimationFrameBetweenConsideration/AnimationFrameBetweenConsideration.yy create mode 100644 scripts/AnimationFrameConsideration/AnimationFrameConsideration.gml create mode 100644 scripts/AnimationFrameConsideration/AnimationFrameConsideration.yy create mode 100644 scripts/AnimationPauseSystem/AnimationPauseSystem.gml create mode 100644 scripts/AnimationPauseSystem/AnimationPauseSystem.yy create mode 100644 scripts/AnimationSystem/AnimationSystem.gml create mode 100644 scripts/AnimationSystem/AnimationSystem.yy create mode 100644 scripts/ArrayHelpers/ArrayHelpers.gml create mode 100644 scripts/ArrayHelpers/ArrayHelpers.yy create mode 100644 scripts/CameraFollowComponent/CameraFollowComponent.gml create mode 100644 scripts/CameraFollowComponent/CameraFollowComponent.yy create mode 100644 scripts/CameraShakeComponent/CameraFollowComponent.yy create mode 100644 scripts/CameraShakeComponent/CameraShakeComponent.gml create mode 100644 scripts/CameraShakeComponent/CameraShakeComponent.yy create mode 100644 scripts/CameraShakeSystem/CameraShakeSystem.gml create mode 100644 scripts/CameraShakeSystem/CameraShakeSystem.yy create mode 100644 scripts/CameraShakeSystem/CameraSystem.yy create mode 100644 scripts/CameraSystem/CameraSystem.gml create mode 100644 scripts/CameraSystem/CameraSystem.yy create mode 100644 scripts/CounterComponent/CounterComponent.gml create mode 100644 scripts/CounterComponent/CounterComponent.yy create mode 100644 scripts/CounterSystem/CounterSystem.gml create mode 100644 scripts/CounterSystem/CounterSystem.yy create mode 100644 scripts/FacingDirectionComponent/FacingDirectionComponent.gml create mode 100644 scripts/FacingDirectionComponent/FacingDirectionComponent.yy create mode 100644 scripts/FrictionComponent/FrictionComponent.gml create mode 100644 scripts/FrictionComponent/FrictionComponent.yy create mode 100644 scripts/HasComponentConsideration/HasComponentConsideration.gml create mode 100644 scripts/HasComponentConsideration/HasComponentConsideration.yy create mode 100644 scripts/HasNotComponentConsideration/HasNotComponentConsideration.gml create mode 100644 scripts/HasNotComponentConsideration/HasNotComponentConsideration.yy create mode 100644 scripts/HealthBelowConsideration/HealthBelowConsideration.gml create mode 100644 scripts/HealthBelowConsideration/HealthBelowConsideration.yy create mode 100644 scripts/HealthBelowConsideration/StaminaDepletedConsideration.yy create mode 100644 scripts/HealthComponent/HealthComponent.gml create mode 100644 scripts/HealthComponent/HealthComponent.yy create mode 100644 scripts/HealthConsumeComponent/HealthConsumeComponent.gml create mode 100644 scripts/HealthConsumeComponent/HealthConsumeComponent.yy create mode 100644 scripts/HealthConsumeComponent/StaminaConsumeComponent.yy create mode 100644 scripts/HealthDepletedConsideration/HealthBelowConsideration.yy create mode 100644 scripts/HealthDepletedConsideration/HealthDepletedConsideration.gml create mode 100644 scripts/HealthDepletedConsideration/HealthDepletedConsideration.yy create mode 100644 scripts/HealthDepletedConsideration/StaminaDepletedConsideration.yy create mode 100644 scripts/HealthDrainComponent/HealthDrainComponent.gml create mode 100644 scripts/HealthDrainComponent/HealthDrainComponent.yy create mode 100644 scripts/HealthSystem/HealthSystem.gml create mode 100644 scripts/HealthSystem/HealthSystem.yy create mode 100644 scripts/ImpulseComponent/ConstandSpeedComponent.yy create mode 100644 scripts/ImpulseComponent/ImpulseComponent.gml create mode 100644 scripts/ImpulseComponent/ImpulseComponent.yy create mode 100644 scripts/ImpulseComponent/VelocityComponent.yy create mode 100644 scripts/ImpulseFacingComponent/ImpulseFacingComponent.gml create mode 100644 scripts/ImpulseFacingComponent/ImpulseFacingComponent.yy create mode 100644 scripts/MoveComponent/MoveComponent.gml create mode 100644 scripts/MoveComponent/MoveComponent.yy create mode 100644 scripts/MoveInputConsideration/MoveInputConsideration.gml create mode 100644 scripts/MoveInputConsideration/MoveInputConsideration.yy create mode 100644 scripts/MovementSystem/MovementSystem.gml create mode 100644 scripts/MovementSystem/MovementSystem.yy create mode 100644 scripts/NoMoveInputConsideration/NoMoveInputConsideration.gml create mode 100644 scripts/NoMoveInputConsideration/NoMoveInputConsideration.yy create mode 100644 scripts/PlayerMoveSystem/PlayerMoveSystem.gml create mode 100644 scripts/PlayerMoveSystem/PlayerMoveSystem.yy create mode 100644 scripts/PlayerStateTags/PlayerStateTags.gml create mode 100644 scripts/PlayerStateTags/PlayerStateTags.yy create mode 100644 scripts/PreviousStateConsideration/PreviousStateConsideration.gml create mode 100644 scripts/PreviousStateConsideration/PreviousStateConsideration.yy create mode 100644 scripts/RandomTimerConsideration/RandomTimerConsideration.gml create mode 100644 scripts/RandomTimerConsideration/RandomTimerConsideration.yy create mode 100644 scripts/ShadowComponent/ShadowComponent.gml create mode 100644 scripts/ShadowComponent/ShadowComponent.yy create mode 100644 scripts/ShadowSystem/ShadowSystem.gml create mode 100644 scripts/ShadowSystem/ShadowSystem.yy create mode 100644 scripts/SolidTag/SolidTag.gml create mode 100644 scripts/SolidTag/SolidTag.yy create mode 100644 scripts/SpriteComponent/SpriteComponent.gml create mode 100644 scripts/SpriteComponent/SpriteComponent.yy create mode 100644 scripts/StateComponent/StateComponent.gml create mode 100644 scripts/StateComponent/StateComponent.yy create mode 100644 scripts/StateMachineComponent/StateMachineComponent.gml create mode 100644 scripts/StateMachineComponent/StateMachineComponent.yy create mode 100644 scripts/StateMachineSystem/StateMachineSystem.gml create mode 100644 scripts/StateMachineSystem/StateMachineSystem.yy create mode 100644 scripts/TimerConsideration/TimerConsideration.gml create mode 100644 scripts/TimerConsideration/TimerConsideration.yy create mode 100644 scripts/UnpausableTag/UnpausableTag.gml create mode 100644 scripts/UnpausableTag/UnpausableTag.yy create mode 100644 scripts/Vector2/Vector2.gml create mode 100644 scripts/Vector2/Vector2.yy create mode 100644 scripts/VelocityComponent/VelocityComponent.gml create mode 100644 scripts/VelocityComponent/VelocityComponent.yy create mode 100644 scripts/WallCollideConsideration/WallCollideConsideration.gml create mode 100644 scripts/WallCollideConsideration/WallCollideConsideration.yy create mode 100644 scripts/__ComponentFunctions/__ComponentFunctions.gml create mode 100644 scripts/__ComponentFunctions/__ComponentFunctions.yy create mode 100644 scripts/__EntityFunctions/__EntityFunctions.gml create mode 100644 scripts/__EntityFunctions/__EntityFunctions.yy create mode 100644 scripts/__NotificationSystem/__NotificationSystem.gml create mode 100644 scripts/__NotificationSystem/__NotificationSystem.yy create mode 100644 scripts/__SystemFunctions/__SystemFunctions.gml create mode 100644 scripts/__SystemFunctions/__SystemFunctions.yy create mode 100644 scripts/snap_deep_copy/snap_deep_copy.gml create mode 100644 scripts/snap_deep_copy/snap_deep_copy.yy create mode 100644 sprites/spr_checkboard/78284bff-2ffb-47cc-b83f-a91486be9135.png create mode 100644 sprites/spr_checkboard/layers/78284bff-2ffb-47cc-b83f-a91486be9135/ed1c8057-d138-491e-bbbe-637c6a9586ee.png create mode 100644 sprites/spr_checkboard/spr_checkboard.yy create mode 100644 sprites/spr_player_idle/ea48d3dd-25f2-429a-b853-7e4db4c54b91.png create mode 100644 sprites/spr_player_idle/layers/ea48d3dd-25f2-429a-b853-7e4db4c54b91/10652100-57ca-474a-a52a-9b4b7316dbdd.png create mode 100644 sprites/spr_player_idle/spr_player_idle.yy create mode 100644 sprites/spr_player_move/ea48d3dd-25f2-429a-b853-7e4db4c54b91.png create mode 100644 sprites/spr_player_move/layers/ea48d3dd-25f2-429a-b853-7e4db4c54b91/10652100-57ca-474a-a52a-9b4b7316dbdd.png create mode 100644 sprites/spr_player_move/spr_player_idle.yy create mode 100644 sprites/spr_player_move/spr_player_move.yy create mode 100644 sprites/spr_wall/e4e6fbb0-1e04-4079-a3b2-0312b563ba47.png create mode 100644 sprites/spr_wall/layers/e4e6fbb0-1e04-4079-a3b2-0312b563ba47/f5f1c9a5-150a-4183-99b0-e00e04178a98.png create mode 100644 sprites/spr_wall/spr_wall.yy diff --git a/FaultyECS.yyp b/FaultyECS.yyp new file mode 100644 index 0000000..6803b72 --- /dev/null +++ b/FaultyECS.yyp @@ -0,0 +1,160 @@ +{ + "resources": [ + {"id":{"name":"spr_checkboard","path":"sprites/spr_checkboard/spr_checkboard.yy",},"order":2,}, + {"id":{"name":"HealthComponent","path":"scripts/HealthComponent/HealthComponent.yy",},"order":0,}, + {"id":{"name":"StateComponent","path":"scripts/StateComponent/StateComponent.yy",},"order":0,}, + {"id":{"name":"PreviousStateConsideration","path":"scripts/PreviousStateConsideration/PreviousStateConsideration.yy",},"order":0,}, + {"id":{"name":"ActiveTimerConsideration","path":"scripts/ActiveTimerConsideration/ActiveTimerConsideration.yy",},"order":0,}, + {"id":{"name":"sys_player_controller","path":"objects/sys_player_controller/sys_player_controller.yy",},"order":12,}, + {"id":{"name":"obj_wall","path":"objects/obj_wall/obj_wall.yy",},"order":1,}, + {"id":{"name":"AnimationEndMomentConsideration","path":"scripts/AnimationEndMomentConsideration/AnimationEndMomentConsideration.yy",},"order":1,}, + {"id":{"name":"CounterSystem","path":"scripts/CounterSystem/CounterSystem.yy",},"order":0,}, + {"id":{"name":"CameraShakeSystem","path":"scripts/CameraShakeSystem/CameraShakeSystem.yy",},"order":0,}, + {"id":{"name":"rm_playroom","path":"rooms/rm_playroom/rm_playroom.yy",},"order":2,}, + {"id":{"name":"sys_state_machine","path":"objects/sys_state_machine/sys_state_machine.yy",},"order":1,}, + {"id":{"name":"SolidTag","path":"scripts/SolidTag/SolidTag.yy",},"order":0,}, + {"id":{"name":"spr_player_idle","path":"sprites/spr_player_idle/spr_player_idle.yy",},"order":0,}, + {"id":{"name":"SystemManager","path":"objects/SystemManager/SystemManager.yy",},"order":1,}, + {"id":{"name":"WallCollideConsideration","path":"scripts/WallCollideConsideration/WallCollideConsideration.yy",},"order":0,}, + {"id":{"name":"Vector2","path":"scripts/Vector2/Vector2.yy",},"order":2,}, + {"id":{"name":"SpriteComponent","path":"scripts/SpriteComponent/SpriteComponent.yy",},"order":1,}, + {"id":{"name":"AnimationPauseSystem","path":"scripts/AnimationPauseSystem/AnimationPauseSystem.yy",},"order":0,}, + {"id":{"name":"HealthDrainComponent","path":"scripts/HealthDrainComponent/HealthDrainComponent.yy",},"order":2,}, + {"id":{"name":"ShadowComponent","path":"scripts/ShadowComponent/ShadowComponent.yy",},"order":0,}, + {"id":{"name":"AnimationSystem","path":"scripts/AnimationSystem/AnimationSystem.yy",},"order":1,}, + {"id":{"name":"MoveComponent","path":"scripts/MoveComponent/MoveComponent.yy",},"order":3,}, + {"id":{"name":"__EntityFunctions","path":"scripts/__EntityFunctions/__EntityFunctions.yy",},"order":0,}, + {"id":{"name":"sys_animation","path":"objects/sys_animation/sys_animation.yy",},"order":2,}, + {"id":{"name":"MoveInputConsideration","path":"scripts/MoveInputConsideration/MoveInputConsideration.yy",},"order":2,}, + {"id":{"name":"__NotificationSystem","path":"scripts/__NotificationSystem/__NotificationSystem.yy",},"order":0,}, + {"id":{"name":"RandomTimerConsideration","path":"scripts/RandomTimerConsideration/RandomTimerConsideration.yy",},"order":1,}, + {"id":{"name":"VelocityComponent","path":"scripts/VelocityComponent/VelocityComponent.yy",},"order":5,}, + {"id":{"name":"PlayerMoveSystem","path":"scripts/PlayerMoveSystem/PlayerMoveSystem.yy",},"order":7,}, + {"id":{"name":"Entity","path":"objects/Entity/Entity.yy",},"order":1,}, + {"id":{"name":"StateMachineSystem","path":"scripts/StateMachineSystem/StateMachineSystem.yy",},"order":0,}, + {"id":{"name":"spr_wall","path":"sprites/spr_wall/spr_wall.yy",},"order":3,}, + {"id":{"name":"world_gameplay","path":"objects/world_gameplay/world_gameplay.yy",},"order":0,}, + {"id":{"name":"ImpulseFacingComponent","path":"scripts/ImpulseFacingComponent/ImpulseFacingComponent.yy",},"order":2,}, + {"id":{"name":"HealthConsumeComponent","path":"scripts/HealthConsumeComponent/HealthConsumeComponent.yy",},"order":1,}, + {"id":{"name":"__SystemFunctions","path":"scripts/__SystemFunctions/__SystemFunctions.yy",},"order":0,}, + {"id":{"name":"FacingDirectionComponent","path":"scripts/FacingDirectionComponent/FacingDirectionComponent.yy",},"order":0,}, + {"id":{"name":"sys_shadows","path":"objects/sys_shadows/sys_shadows.yy",},"order":3,}, + {"id":{"name":"InputManager","path":"objects/InputManager/InputManager.yy",},"order":1,}, + {"id":{"name":"HasComponentConsideration","path":"scripts/HasComponentConsideration/HasComponentConsideration.yy",},"order":0,}, + {"id":{"name":"HasNotComponentConsideration","path":"scripts/HasNotComponentConsideration/HasNotComponentConsideration.yy",},"order":1,}, + {"id":{"name":"HealthDepletedConsideration","path":"scripts/HealthDepletedConsideration/HealthDepletedConsideration.yy",},"order":1,}, + {"id":{"name":"AnimationFrameConsideration","path":"scripts/AnimationFrameConsideration/AnimationFrameConsideration.yy",},"order":3,}, + {"id":{"name":"CameraShakeComponent","path":"scripts/CameraShakeComponent/CameraShakeComponent.yy",},"order":1,}, + {"id":{"name":"AnimationFrameBetweenConsideration","path":"scripts/AnimationFrameBetweenConsideration/AnimationFrameBetweenConsideration.yy",},"order":2,}, + {"id":{"name":"FrictionComponent","path":"scripts/FrictionComponent/FrictionComponent.yy",},"order":0,}, + {"id":{"name":"NoMoveInputConsideration","path":"scripts/NoMoveInputConsideration/NoMoveInputConsideration.yy",},"order":3,}, + {"id":{"name":"CounterComponent","path":"scripts/CounterComponent/CounterComponent.yy",},"order":0,}, + {"id":{"name":"__ComponentFunctions","path":"scripts/__ComponentFunctions/__ComponentFunctions.yy",},"order":0,}, + {"id":{"name":"sys_utilities","path":"objects/sys_utilities/sys_utilities.yy",},"order":1,}, + {"id":{"name":"HealthBelowConsideration","path":"scripts/HealthBelowConsideration/HealthBelowConsideration.yy",},"order":0,}, + {"id":{"name":"TimerConsideration","path":"scripts/TimerConsideration/TimerConsideration.yy",},"order":2,}, + {"id":{"name":"PlayerStateTags","path":"scripts/PlayerStateTags/PlayerStateTags.yy",},"order":1,}, + {"id":{"name":"ShadowSystem","path":"scripts/ShadowSystem/ShadowSystem.yy",},"order":0,}, + {"id":{"name":"CameraFollowComponent","path":"scripts/CameraFollowComponent/CameraFollowComponent.yy",},"order":0,}, + {"id":{"name":"HealthSystem","path":"scripts/HealthSystem/HealthSystem.yy",},"order":0,}, + {"id":{"name":"GameManager","path":"objects/GameManager/GameManager.yy",},"order":0,}, + {"id":{"name":"UnpausableTag","path":"scripts/UnpausableTag/UnpausableTag.yy",},"order":0,}, + {"id":{"name":"ImpulseComponent","path":"scripts/ImpulseComponent/ImpulseComponent.yy",},"order":1,}, + {"id":{"name":"obj_player","path":"objects/obj_player/obj_player.yy",},"order":0,}, + {"id":{"name":"MovementSystem","path":"scripts/MovementSystem/MovementSystem.yy",},"order":0,}, + {"id":{"name":"CameraSystem","path":"scripts/CameraSystem/CameraSystem.yy",},"order":1,}, + {"id":{"name":"ArrayHelpers","path":"scripts/ArrayHelpers/ArrayHelpers.yy",},"order":0,}, + {"id":{"name":"AnimationEndConsideration","path":"scripts/AnimationEndConsideration/AnimationEndConsideration.yy",},"order":0,}, + {"id":{"name":"sys_movement","path":"objects/sys_movement/sys_movement.yy",},"order":1,}, + {"id":{"name":"sys_stats","path":"objects/sys_stats/sys_stats.yy",},"order":3,}, + {"id":{"name":"StateMachineComponent","path":"scripts/StateMachineComponent/StateMachineComponent.yy",},"order":1,}, + {"id":{"name":"spr_player_move","path":"sprites/spr_player_move/spr_player_move.yy",},"order":1,}, + {"id":{"name":"snap_deep_copy","path":"scripts/snap_deep_copy/snap_deep_copy.yy",},"order":1,}, + {"id":{"name":"sys_camera","path":"objects/sys_camera/sys_camera.yy",},"order":2,}, + {"id":{"name":"rm_init","path":"rooms/rm_init/rm_init.yy",},"order":0,}, + ], + "Options": [ + {"name":"Linux","path":"options/linux/options_linux.yy",}, + {"name":"macOS","path":"options/mac/options_mac.yy",}, + {"name":"Main","path":"options/main/options_main.yy",}, + {"name":"Windows","path":"options/windows/options_windows.yy",}, + ], + "isDnDProject": false, + "isEcma": false, + "tutorialPath": "", + "configs": { + "name": "Default", + "children": [], + }, + "RoomOrderNodes": [ + {"roomId":{"name":"rm_init","path":"rooms/rm_init/rm_init.yy",},}, + {"roomId":{"name":"rm_playroom","path":"rooms/rm_playroom/rm_playroom.yy",},}, + ], + "Folders": [ + {"folderPath":"folders/Sprites.yy","order":1,"resourceVersion":"1.0","name":"Sprites","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/Controllers.yy","order":9,"resourceVersion":"1.0","name":"Controllers","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/Rooms.yy","order":10,"resourceVersion":"1.0","name":"Rooms","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS.yy","order":15,"resourceVersion":"1.0","name":"ECS","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/_Internal.yy","order":1,"resourceVersion":"1.0","name":"_Internal","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/_Internal/Component.yy","order":1,"resourceVersion":"1.0","name":"Component","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/_Internal/Entity.yy","order":2,"resourceVersion":"1.0","name":"Entity","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/_Internal/System.yy","order":3,"resourceVersion":"1.0","name":"System","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/_Worlds.yy","order":2,"resourceVersion":"1.0","name":"_Worlds","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Movement.yy","order":6,"resourceVersion":"1.0","name":"Movement","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Movement/Components.yy","order":1,"resourceVersion":"1.0","name":"Components","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Movement/Systems.yy","order":2,"resourceVersion":"1.0","name":"Systems","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Player.yy","order":7,"resourceVersion":"1.0","name":"Player","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Player/Systems.yy","order":1,"resourceVersion":"1.0","name":"Systems","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Player/Tags.yy","order":2,"resourceVersion":"1.0","name":"Tags","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Rendering.yy","order":8,"resourceVersion":"1.0","name":"Rendering","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Rendering/Animation.yy","order":1,"resourceVersion":"1.0","name":"Animation","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Rendering/Animation/Components.yy","order":1,"resourceVersion":"1.0","name":"Components","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Rendering/Animation/Systems.yy","order":2,"resourceVersion":"1.0","name":"Systems","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Rendering/Animation/Tags.yy","order":3,"resourceVersion":"1.0","name":"Tags","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Rendering/Camera.yy","order":2,"resourceVersion":"1.0","name":"Camera","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Rendering/Camera/Components.yy","order":1,"resourceVersion":"1.0","name":"Components","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Rendering/Camera/Systems.yy","order":3,"resourceVersion":"1.0","name":"Systems","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Rendering/Shadows.yy","order":6,"resourceVersion":"1.0","name":"Shadows","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Rendering/Shadows/Components.yy","order":1,"resourceVersion":"1.0","name":"Components","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Rendering/Shadows/Systems.yy","order":2,"resourceVersion":"1.0","name":"Systems","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/State Machine.yy","order":9,"resourceVersion":"1.0","name":"State Machine","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/State Machine/Components.yy","order":1,"resourceVersion":"1.0","name":"Components","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/State Machine/Considerations.yy","order":2,"resourceVersion":"1.0","name":"Considerations","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/State Machine/Considerations/Animation.yy","order":2,"resourceVersion":"1.0","name":"Animation","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/State Machine/Considerations/ECS.yy","order":4,"resourceVersion":"1.0","name":"ECS","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/State Machine/Considerations/Movement.yy","order":6,"resourceVersion":"1.0","name":"Movement","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/State Machine/Considerations/Player.yy","order":7,"resourceVersion":"1.0","name":"Player","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/State Machine/Considerations/State Machine.yy","order":8,"resourceVersion":"1.0","name":"State Machine","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/State Machine/Considerations/Stats.yy","order":9,"resourceVersion":"1.0","name":"Stats","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/State Machine/Considerations/Stats/Health.yy","order":1,"resourceVersion":"1.0","name":"Health","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/State Machine/Considerations/Time.yy","order":10,"resourceVersion":"1.0","name":"Time","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/State Machine/Systems.yy","order":3,"resourceVersion":"1.0","name":"Systems","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Stats.yy","order":10,"resourceVersion":"1.0","name":"Stats","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Stats/Health.yy","order":1,"resourceVersion":"1.0","name":"Health","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Stats/Health/Components.yy","order":1,"resourceVersion":"1.0","name":"Components","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Stats/Health/Systems.yy","order":2,"resourceVersion":"1.0","name":"Systems","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Utilities.yy","order":11,"resourceVersion":"1.0","name":"Utilities","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Utilities/Counter.yy","order":1,"resourceVersion":"1.0","name":"Counter","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Utilities/Counter/Components.yy","order":1,"resourceVersion":"1.0","name":"Components","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Utilities/Counter/Systems.yy","order":2,"resourceVersion":"1.0","name":"Systems","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/THIRD PARTY HELPERS/NotificationSystem.yy","order":0,"resourceVersion":"1.0","name":"NotificationSystem","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/Entities.yy","order":16,"resourceVersion":"1.0","name":"Entities","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/_Internal/Helper Functions.yy","order":5,"resourceVersion":"1.0","name":"Helper Functions","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/ECS/Movement/Tags.yy","order":3,"resourceVersion":"1.0","name":"Tags","tags":[],"resourceType":"GMFolder",}, + {"folderPath":"folders/THIRD PARTY HELPERS.yy","order":17,"resourceVersion":"1.0","name":"THIRD PARTY HELPERS","tags":[],"resourceType":"GMFolder",}, + ], + "AudioGroups": [ + {"targets":-1,"resourceVersion":"1.3","name":"audiogroup_default","resourceType":"GMAudioGroup",}, + ], + "TextureGroups": [ + {"isScaled":true,"autocrop":true,"border":2,"mipsToGenerate":0,"groupParent":null,"targets":-1,"resourceVersion":"1.3","name":"Default","resourceType":"GMTextureGroup",}, + ], + "IncludedFiles": [], + "MetaData": { + "IDEVersion": "23.1.1.306", + }, + "resourceVersion": "1.4", + "name": "FaultyECS", + "tags": [], + "resourceType": "GMProject", +} \ No newline at end of file diff --git a/objects/Entity/CleanUp_0.gml b/objects/Entity/CleanUp_0.gml new file mode 100644 index 0000000..88e2c6d --- /dev/null +++ b/objects/Entity/CleanUp_0.gml @@ -0,0 +1,5 @@ +/// @description Destroy Components + +component_remove(id, all); + +asset_clear_tags(id, asset_object); \ No newline at end of file diff --git a/objects/Entity/Create_0.gml b/objects/Entity/Create_0.gml new file mode 100644 index 0000000..067afa6 --- /dev/null +++ b/objects/Entity/Create_0.gml @@ -0,0 +1,3 @@ +/// @description Init + +__components = {}; \ No newline at end of file diff --git a/objects/Entity/Entity.yy b/objects/Entity/Entity.yy new file mode 100644 index 0000000..237ec87 --- /dev/null +++ b/objects/Entity/Entity.yy @@ -0,0 +1,34 @@ +{ + "spriteId": null, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": false, + "parentObjectId": null, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":12,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "Entity", + "path": "folders/ECS/_Internal/Entity.yy", + }, + "resourceVersion": "1.0", + "name": "Entity", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/objects/GameManager/Create_0.gml b/objects/GameManager/Create_0.gml new file mode 100644 index 0000000..4bcf08d --- /dev/null +++ b/objects/GameManager/Create_0.gml @@ -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); \ No newline at end of file diff --git a/objects/GameManager/GameManager.yy b/objects/GameManager/GameManager.yy new file mode 100644 index 0000000..db58276 --- /dev/null +++ b/objects/GameManager/GameManager.yy @@ -0,0 +1,33 @@ +{ + "spriteId": null, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": true, + "parentObjectId": null, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "Controllers", + "path": "folders/Controllers.yy", + }, + "resourceVersion": "1.0", + "name": "GameManager", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/objects/InputManager/Create_0.gml b/objects/InputManager/Create_0.gml new file mode 100644 index 0000000..f5f6aff --- /dev/null +++ b/objects/InputManager/Create_0.gml @@ -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); +} \ No newline at end of file diff --git a/objects/InputManager/InputManager.yy b/objects/InputManager/InputManager.yy new file mode 100644 index 0000000..1e82f02 --- /dev/null +++ b/objects/InputManager/InputManager.yy @@ -0,0 +1,33 @@ +{ + "spriteId": null, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": true, + "parentObjectId": null, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "Controllers", + "path": "folders/Controllers.yy", + }, + "resourceVersion": "1.0", + "name": "InputManager", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/objects/SystemManager/CleanUp_0.gml b/objects/SystemManager/CleanUp_0.gml new file mode 100644 index 0000000..28149c3 --- /dev/null +++ b/objects/SystemManager/CleanUp_0.gml @@ -0,0 +1,4 @@ +/// @description Destroy Systems + +system_destroy(all); +unsubscribe(); \ No newline at end of file diff --git a/objects/SystemManager/Create_0.gml b/objects/SystemManager/Create_0.gml new file mode 100644 index 0000000..64d353b --- /dev/null +++ b/objects/SystemManager/Create_0.gml @@ -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); + } + } +} \ No newline at end of file diff --git a/objects/SystemManager/Draw_0.gml b/objects/SystemManager/Draw_0.gml new file mode 100644 index 0000000..5240769 --- /dev/null +++ b/objects/SystemManager/Draw_0.gml @@ -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(); + } +} \ No newline at end of file diff --git a/objects/SystemManager/Draw_64.gml b/objects/SystemManager/Draw_64.gml new file mode 100644 index 0000000..b107965 --- /dev/null +++ b/objects/SystemManager/Draw_64.gml @@ -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(); + } +} \ No newline at end of file diff --git a/objects/SystemManager/Draw_72.gml b/objects/SystemManager/Draw_72.gml new file mode 100644 index 0000000..dd0bb27 --- /dev/null +++ b/objects/SystemManager/Draw_72.gml @@ -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(); + } +} \ No newline at end of file diff --git a/objects/SystemManager/Draw_73.gml b/objects/SystemManager/Draw_73.gml new file mode 100644 index 0000000..fa27992 --- /dev/null +++ b/objects/SystemManager/Draw_73.gml @@ -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(); + } +} \ No newline at end of file diff --git a/objects/SystemManager/Other_4.gml b/objects/SystemManager/Other_4.gml new file mode 100644 index 0000000..d5573b4 --- /dev/null +++ b/objects/SystemManager/Other_4.gml @@ -0,0 +1,5 @@ +for (var i = 0; i < array_length(systems); i++) { + if (systems[i].roomStart != undefined) { + systems[i].roomStart(); + } +} \ No newline at end of file diff --git a/objects/SystemManager/Other_5.gml b/objects/SystemManager/Other_5.gml new file mode 100644 index 0000000..7500403 --- /dev/null +++ b/objects/SystemManager/Other_5.gml @@ -0,0 +1,5 @@ +for (var i = 0; i < array_length(systems); i++) { + if (systems[i].roomEnd != undefined) { + systems[i].roomEnd(); + } +} \ No newline at end of file diff --git a/objects/SystemManager/Step_0.gml b/objects/SystemManager/Step_0.gml new file mode 100644 index 0000000..3739f6c --- /dev/null +++ b/objects/SystemManager/Step_0.gml @@ -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(); + } +} \ No newline at end of file diff --git a/objects/SystemManager/Step_1.gml b/objects/SystemManager/Step_1.gml new file mode 100644 index 0000000..7f840be --- /dev/null +++ b/objects/SystemManager/Step_1.gml @@ -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(); + } +} \ No newline at end of file diff --git a/objects/SystemManager/Step_2.gml b/objects/SystemManager/Step_2.gml new file mode 100644 index 0000000..fecedf3 --- /dev/null +++ b/objects/SystemManager/Step_2.gml @@ -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(); + } +} \ No newline at end of file diff --git a/objects/SystemManager/SystemManager.yy b/objects/SystemManager/SystemManager.yy new file mode 100644 index 0000000..ebf671d --- /dev/null +++ b/objects/SystemManager/SystemManager.yy @@ -0,0 +1,43 @@ +{ + "spriteId": null, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": true, + "parentObjectId": null, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":1,"eventType":3,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":2,"eventType":3,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":0,"eventType":12,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":0,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":64,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":4,"eventType":7,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":5,"eventType":7,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":72,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":73,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "System", + "path": "folders/ECS/_Internal/System.yy", + }, + "resourceVersion": "1.0", + "name": "SystemManager", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/objects/obj_player/Create_0.gml b/objects/obj_player/Create_0.gml new file mode 100644 index 0000000..c90af59 --- /dev/null +++ b/objects/obj_player/Create_0.gml @@ -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() +]); \ No newline at end of file diff --git a/objects/obj_player/obj_player.yy b/objects/obj_player/obj_player.yy new file mode 100644 index 0000000..66f33d3 --- /dev/null +++ b/objects/obj_player/obj_player.yy @@ -0,0 +1,39 @@ +{ + "spriteId": { + "name": "spr_player_idle", + "path": "sprites/spr_player_idle/spr_player_idle.yy", + }, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": false, + "parentObjectId": { + "name": "Entity", + "path": "objects/Entity/Entity.yy", + }, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "Entities", + "path": "folders/Entities.yy", + }, + "resourceVersion": "1.0", + "name": "obj_player", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/objects/obj_wall/Create_0.gml b/objects/obj_wall/Create_0.gml new file mode 100644 index 0000000..96e3bf1 --- /dev/null +++ b/objects/obj_wall/Create_0.gml @@ -0,0 +1,6 @@ +/// @description Init + +// Inherit the parent event +event_inherited(); + +component_add(id, new SolidTag()); \ No newline at end of file diff --git a/objects/obj_wall/obj_wall.yy b/objects/obj_wall/obj_wall.yy new file mode 100644 index 0000000..ddbff01 --- /dev/null +++ b/objects/obj_wall/obj_wall.yy @@ -0,0 +1,39 @@ +{ + "spriteId": { + "name": "spr_wall", + "path": "sprites/spr_wall/spr_wall.yy", + }, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": false, + "parentObjectId": { + "name": "Entity", + "path": "objects/Entity/Entity.yy", + }, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "Entities", + "path": "folders/Entities.yy", + }, + "resourceVersion": "1.0", + "name": "obj_wall", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/objects/sys_animation/Create_0.gml b/objects/sys_animation/Create_0.gml new file mode 100644 index 0000000..949d705 --- /dev/null +++ b/objects/sys_animation/Create_0.gml @@ -0,0 +1,9 @@ +/// @description Init + +// Inherit the parent event +event_inherited(); + +system_add([ + new AnimationPauseSystem(), + new AnimationSystem(SpriteComponent) +]); \ No newline at end of file diff --git a/objects/sys_animation/sys_animation.yy b/objects/sys_animation/sys_animation.yy new file mode 100644 index 0000000..8e5df26 --- /dev/null +++ b/objects/sys_animation/sys_animation.yy @@ -0,0 +1,36 @@ +{ + "spriteId": null, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": true, + "parentObjectId": { + "name": "SystemManager", + "path": "objects/SystemManager/SystemManager.yy", + }, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "Systems", + "path": "folders/ECS/Rendering/Animation/Systems.yy", + }, + "resourceVersion": "1.0", + "name": "sys_animation", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/objects/sys_camera/Create_0.gml b/objects/sys_camera/Create_0.gml new file mode 100644 index 0000000..b2285a0 --- /dev/null +++ b/objects/sys_camera/Create_0.gml @@ -0,0 +1,9 @@ +/// @description Init + +// Inherit the parent event +event_inherited(); + +system_add([ + new CameraSystem([CameraFollowComponent]), + new CameraShakeSystem([CameraShakeComponent]) +]) \ No newline at end of file diff --git a/objects/sys_camera/sys_camera.yy b/objects/sys_camera/sys_camera.yy new file mode 100644 index 0000000..08cd6e3 --- /dev/null +++ b/objects/sys_camera/sys_camera.yy @@ -0,0 +1,36 @@ +{ + "spriteId": null, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": true, + "parentObjectId": { + "name": "SystemManager", + "path": "objects/SystemManager/SystemManager.yy", + }, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "Systems", + "path": "folders/ECS/Rendering/Camera/Systems.yy", + }, + "resourceVersion": "1.0", + "name": "sys_camera", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/objects/sys_movement/Create_0.gml b/objects/sys_movement/Create_0.gml new file mode 100644 index 0000000..729fc4a --- /dev/null +++ b/objects/sys_movement/Create_0.gml @@ -0,0 +1,6 @@ +// Inherit the parent event +event_inherited(); + +system_add([ + new MovementSystem([MoveComponent]), +]); \ No newline at end of file diff --git a/objects/sys_movement/sys_movement.yy b/objects/sys_movement/sys_movement.yy new file mode 100644 index 0000000..089d727 --- /dev/null +++ b/objects/sys_movement/sys_movement.yy @@ -0,0 +1,36 @@ +{ + "spriteId": null, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": true, + "parentObjectId": { + "name": "SystemManager", + "path": "objects/SystemManager/SystemManager.yy", + }, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "Systems", + "path": "folders/ECS/Movement/Systems.yy", + }, + "resourceVersion": "1.0", + "name": "sys_movement", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/objects/sys_player_controller/Create_0.gml b/objects/sys_player_controller/Create_0.gml new file mode 100644 index 0000000..534554f --- /dev/null +++ b/objects/sys_player_controller/Create_0.gml @@ -0,0 +1,8 @@ +/// @description Init + +// Inherit the parent event +event_inherited(); + +system_add([ + new PlayerMoveSystem([PlayerMoveTag, VelocityComponent]), +]); \ No newline at end of file diff --git a/objects/sys_player_controller/sys_player_controller.yy b/objects/sys_player_controller/sys_player_controller.yy new file mode 100644 index 0000000..c14a821 --- /dev/null +++ b/objects/sys_player_controller/sys_player_controller.yy @@ -0,0 +1,36 @@ +{ + "spriteId": null, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": true, + "parentObjectId": { + "name": "SystemManager", + "path": "objects/SystemManager/SystemManager.yy", + }, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "Systems", + "path": "folders/ECS/Player/Systems.yy", + }, + "resourceVersion": "1.0", + "name": "sys_player_controller", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/objects/sys_shadows/Create_0.gml b/objects/sys_shadows/Create_0.gml new file mode 100644 index 0000000..ccf9975 --- /dev/null +++ b/objects/sys_shadows/Create_0.gml @@ -0,0 +1,8 @@ +// Inherit the parent event +event_inherited(); + +depth = 0; + +system_add([ + new ShadowSystem([ShadowComponent]) +]); \ No newline at end of file diff --git a/objects/sys_shadows/sys_shadows.yy b/objects/sys_shadows/sys_shadows.yy new file mode 100644 index 0000000..6ef78e2 --- /dev/null +++ b/objects/sys_shadows/sys_shadows.yy @@ -0,0 +1,36 @@ +{ + "spriteId": null, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": true, + "parentObjectId": { + "name": "SystemManager", + "path": "objects/SystemManager/SystemManager.yy", + }, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "Shadows", + "path": "folders/ECS/Rendering/Shadows.yy", + }, + "resourceVersion": "1.0", + "name": "sys_shadows", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/objects/sys_state_machine/Create_0.gml b/objects/sys_state_machine/Create_0.gml new file mode 100644 index 0000000..45ac454 --- /dev/null +++ b/objects/sys_state_machine/Create_0.gml @@ -0,0 +1,6 @@ +/// @description Init + +// Inherit the parent event +event_inherited(); + +system_add(new StateMachineSystem(StateMachineComponent)); \ No newline at end of file diff --git a/objects/sys_state_machine/sys_state_machine.yy b/objects/sys_state_machine/sys_state_machine.yy new file mode 100644 index 0000000..0a67a90 --- /dev/null +++ b/objects/sys_state_machine/sys_state_machine.yy @@ -0,0 +1,36 @@ +{ + "spriteId": null, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": true, + "parentObjectId": { + "name": "SystemManager", + "path": "objects/SystemManager/SystemManager.yy", + }, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "Systems", + "path": "folders/ECS/State Machine/Systems.yy", + }, + "resourceVersion": "1.0", + "name": "sys_state_machine", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/objects/sys_stats/Create_0.gml b/objects/sys_stats/Create_0.gml new file mode 100644 index 0000000..667d52a --- /dev/null +++ b/objects/sys_stats/Create_0.gml @@ -0,0 +1,8 @@ +/// @description Init + +// Inherit the parent event +event_inherited(); + +system_add([ + new HealthSystem([HealthComponent]) +]); \ No newline at end of file diff --git a/objects/sys_stats/sys_stats.yy b/objects/sys_stats/sys_stats.yy new file mode 100644 index 0000000..6842083 --- /dev/null +++ b/objects/sys_stats/sys_stats.yy @@ -0,0 +1,36 @@ +{ + "spriteId": null, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": true, + "parentObjectId": { + "name": "SystemManager", + "path": "objects/SystemManager/SystemManager.yy", + }, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "Stats", + "path": "folders/ECS/Stats.yy", + }, + "resourceVersion": "1.0", + "name": "sys_stats", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/objects/sys_utilities/Create_0.gml b/objects/sys_utilities/Create_0.gml new file mode 100644 index 0000000..23a1b26 --- /dev/null +++ b/objects/sys_utilities/Create_0.gml @@ -0,0 +1,6 @@ +/// @description Init + +// Inherit the parent event +event_inherited(); + +system_add(new CounterSystem([CounterComponent])); \ No newline at end of file diff --git a/objects/sys_utilities/sys_utilities.yy b/objects/sys_utilities/sys_utilities.yy new file mode 100644 index 0000000..f26d757 --- /dev/null +++ b/objects/sys_utilities/sys_utilities.yy @@ -0,0 +1,36 @@ +{ + "spriteId": null, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": true, + "parentObjectId": { + "name": "SystemManager", + "path": "objects/SystemManager/SystemManager.yy", + }, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "Systems", + "path": "folders/ECS/Utilities/Counter/Systems.yy", + }, + "resourceVersion": "1.0", + "name": "sys_utilities", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/objects/world_gameplay/Create_0.gml b/objects/world_gameplay/Create_0.gml new file mode 100644 index 0000000..9ddbb9c --- /dev/null +++ b/objects/world_gameplay/Create_0.gml @@ -0,0 +1,11 @@ +/// @description Init World +/// This world is used for general gameplay +layer_create(-16000, "Systems"); +instance_create_layer(0, 0, "Systems", sys_state_machine); +instance_create_layer(0, 0, "Systems", sys_animation); +instance_create_layer(0, 0, "Systems", sys_player_controller); +instance_create_layer(0, 0, "Systems", sys_stats); +instance_create_layer(0, 0, "Systems", sys_utilities); +instance_create_layer(0, 0, "Systems", sys_camera); +instance_create_layer(0, 0, "Systems", sys_shadows); +instance_create_layer(0, 0, "Systems", sys_movement); \ No newline at end of file diff --git a/objects/world_gameplay/world_gameplay.yy b/objects/world_gameplay/world_gameplay.yy new file mode 100644 index 0000000..e20db71 --- /dev/null +++ b/objects/world_gameplay/world_gameplay.yy @@ -0,0 +1,33 @@ +{ + "spriteId": null, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": true, + "parentObjectId": null, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "_Worlds", + "path": "folders/ECS/_Worlds.yy", + }, + "resourceVersion": "1.0", + "name": "world_gameplay", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/options/linux/options_linux.yy b/options/linux/options_linux.yy new file mode 100644 index 0000000..4978896 --- /dev/null +++ b/options/linux/options_linux.yy @@ -0,0 +1,25 @@ +{ + "option_linux_display_name": "Created with GameMaker Studio 2", + "option_linux_version": "1.0.0.0", + "option_linux_maintainer_email": "", + "option_linux_homepage": "http://www.yoyogames.com", + "option_linux_short_desc": "", + "option_linux_long_desc": "", + "option_linux_splash_screen": "${base_options_dir}/linux/splash/splash.png", + "option_linux_display_splash": false, + "option_linux_icon": "${base_options_dir}/linux/icons/64.png", + "option_linux_start_fullscreen": false, + "option_linux_allow_fullscreen": false, + "option_linux_interpolate_pixels": true, + "option_linux_display_cursor": true, + "option_linux_sync": false, + "option_linux_resize_window": false, + "option_linux_scale": 0, + "option_linux_texture_page": "2048x2048", + "option_linux_enable_steam": false, + "option_linux_disable_sandbox": false, + "resourceVersion": "1.0", + "name": "Linux", + "tags": [], + "resourceType": "GMLinuxOptions", +} \ No newline at end of file diff --git a/options/mac/options_mac.yy b/options/mac/options_mac.yy new file mode 100644 index 0000000..73e249f --- /dev/null +++ b/options/mac/options_mac.yy @@ -0,0 +1,33 @@ +{ + "option_mac_display_name": "Created with GameMaker Studio 2", + "option_mac_app_id": "com.company.game", + "option_mac_version": "1.0.0.0", + "option_mac_output_dir": "~/gamemakerstudio2", + "option_mac_team_id": "", + "option_mac_signing_identity": "Developer ID Application:", + "option_mac_copyright": "", + "option_mac_splash_png": "${base_options_dir}/mac/splash/splash.png", + "option_mac_icon_png": "${base_options_dir}/mac/icons/1024.png", + "option_mac_installer_background_png": "${base_options_dir}/mac/splash/installer_background.png", + "option_mac_menu_dock": false, + "option_mac_display_cursor": true, + "option_mac_start_fullscreen": false, + "option_mac_allow_fullscreen": false, + "option_mac_interpolate_pixels": true, + "option_mac_vsync": false, + "option_mac_resize_window": false, + "option_mac_enable_retina": false, + "option_mac_scale": 0, + "option_mac_texture_page": "2048x2048", + "option_mac_build_app_store": false, + "option_mac_allow_incoming_network": false, + "option_mac_allow_outgoing_network": false, + "option_mac_app_category": "Games", + "option_mac_enable_steam": false, + "option_mac_disable_sandbox": false, + "option_mac_apple_sign_in": false, + "resourceVersion": "1.0", + "name": "macOS", + "tags": [], + "resourceType": "GMMacOptions", +} \ No newline at end of file diff --git a/options/main/options_main.yy b/options/main/options_main.yy new file mode 100644 index 0000000..1c822a8 --- /dev/null +++ b/options/main/options_main.yy @@ -0,0 +1,17 @@ +{ + "option_gameguid": "c3c0b3c3-e52b-4a04-8d69-dc0e722d5949", + "option_gameid": "0", + "option_game_speed": 60, + "option_mips_for_3d_textures": false, + "option_draw_colour": 4294967295, + "option_window_colour": 255, + "option_steam_app_id": "0", + "option_sci_usesci": false, + "option_author": "", + "option_lastchanged": "", + "option_spine_licence": false, + "resourceVersion": "1.2", + "name": "Main", + "tags": [], + "resourceType": "GMMainOptions", +} \ No newline at end of file diff --git a/options/windows/options_windows.yy b/options/windows/options_windows.yy new file mode 100644 index 0000000..44cc31c --- /dev/null +++ b/options/windows/options_windows.yy @@ -0,0 +1,36 @@ +{ + "option_windows_display_name": "Created with GameMaker Studio 2", + "option_windows_executable_name": "${project_name}.exe", + "option_windows_version": "1.0.0.0", + "option_windows_company_info": "YoYo Games Ltd", + "option_windows_product_info": "Created with GameMaker Studio 2", + "option_windows_copyright_info": "", + "option_windows_description_info": "A GameMaker Studio 2 Game", + "option_windows_display_cursor": true, + "option_windows_icon": "${base_options_dir}/windows/icons/icon.ico", + "option_windows_save_location": 0, + "option_windows_splash_screen": "${base_options_dir}/windows/splash/splash.png", + "option_windows_use_splash": false, + "option_windows_start_fullscreen": false, + "option_windows_allow_fullscreen_switching": false, + "option_windows_interpolate_pixels": false, + "option_windows_vsync": false, + "option_windows_resize_window": false, + "option_windows_borderless": false, + "option_windows_scale": 0, + "option_windows_copy_exe_to_dest": false, + "option_windows_sleep_margin": 10, + "option_windows_texture_page": "2048x2048", + "option_windows_installer_finished": "${base_options_dir}/windows/installer/finished.bmp", + "option_windows_installer_header": "${base_options_dir}/windows/installer/header.bmp", + "option_windows_license": "${base_options_dir}/windows/installer/license.txt", + "option_windows_nsis_file": "${base_options_dir}/windows/installer/nsis_script.nsi", + "option_windows_enable_steam": false, + "option_windows_disable_sandbox": false, + "option_windows_steam_use_alternative_launcher": false, + "option_windows_use_x64": false, + "resourceVersion": "1.1", + "name": "Windows", + "tags": [], + "resourceType": "GMWindowsOptions", +} \ No newline at end of file diff --git a/rooms/rm_init/rm_init.yy b/rooms/rm_init/rm_init.yy new file mode 100644 index 0000000..f2cdf78 --- /dev/null +++ b/rooms/rm_init/rm_init.yy @@ -0,0 +1,55 @@ +{ + "isDnd": false, + "volume": 1.0, + "parentRoom": null, + "views": [ + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + ], + "layers": [ + {"instances":[ + {"properties":[],"isDnd":false,"objectId":{"name":"GameManager","path":"objects/GameManager/GameManager.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":0.0,"y":0.0,"resourceVersion":"1.0","name":"inst_4D637A37","tags":[],"resourceType":"GMRInstance",}, + ],"visible":true,"depth":0,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":16,"gridY":16,"layers":[],"hierarchyFrozen":false,"resourceVersion":"1.0","name":"Controllers","tags":[],"resourceType":"GMRInstanceLayer",}, + ], + "inheritLayers": false, + "creationCodeFile": "", + "inheritCode": false, + "instanceCreationOrder": [ + {"name":"inst_4D637A37","path":"rooms/rm_init/rm_init.yy",}, + ], + "inheritCreationOrder": false, + "sequenceId": null, + "roomSettings": { + "inheritRoomSettings": false, + "Width": 1280, + "Height": 720, + "persistent": false, + }, + "viewSettings": { + "inheritViewSettings": false, + "enableViews": false, + "clearViewBackground": false, + "clearDisplayBuffer": true, + }, + "physicsSettings": { + "inheritPhysicsSettings": false, + "PhysicsWorld": false, + "PhysicsWorldGravityX": 0.0, + "PhysicsWorldGravityY": 10.0, + "PhysicsWorldPixToMetres": 0.1, + }, + "parent": { + "name": "Rooms", + "path": "folders/Rooms.yy", + }, + "resourceVersion": "1.0", + "name": "rm_init", + "tags": [], + "resourceType": "GMRoom", +} \ No newline at end of file diff --git a/rooms/rm_playroom/rm_playroom.yy b/rooms/rm_playroom/rm_playroom.yy new file mode 100644 index 0000000..9bebc9e --- /dev/null +++ b/rooms/rm_playroom/rm_playroom.yy @@ -0,0 +1,74 @@ +{ + "isDnd": false, + "volume": 1.0, + "parentRoom": null, + "views": [ + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + ], + "layers": [ + {"instances":[ + {"properties":[],"isDnd":false,"objectId":{"name":"obj_player","path":"objects/obj_player/obj_player.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":208.0,"y":352.0,"resourceVersion":"1.0","name":"inst_19FF0C38","tags":[],"resourceType":"GMRInstance",}, + {"properties":[],"isDnd":false,"objectId":{"name":"obj_wall","path":"objects/obj_wall/obj_wall.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":11.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":0.0,"y":64.0,"resourceVersion":"1.0","name":"inst_45F8DF6A","tags":[],"resourceType":"GMRInstance",}, + {"properties":[],"isDnd":false,"objectId":{"name":"obj_wall","path":"objects/obj_wall/obj_wall.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":19.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":64.0,"y":704.0,"resourceVersion":"1.0","name":"inst_25CAB898","tags":[],"resourceType":"GMRInstance",}, + {"properties":[],"isDnd":false,"objectId":{"name":"obj_wall","path":"objects/obj_wall/obj_wall.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":11.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1216.0,"y":0.0,"resourceVersion":"1.0","name":"inst_4C389764","tags":[],"resourceType":"GMRInstance",}, + {"properties":[],"isDnd":false,"objectId":{"name":"obj_wall","path":"objects/obj_wall/obj_wall.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":19.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":0.0,"y":0.0,"resourceVersion":"1.0","name":"inst_3B8A34B1","tags":[],"resourceType":"GMRInstance",}, + {"properties":[],"isDnd":false,"objectId":{"name":"obj_wall","path":"objects/obj_wall/obj_wall.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":3.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":304.0,"y":384.0,"resourceVersion":"1.0","name":"inst_70A2CDA7","tags":[],"resourceType":"GMRInstance",}, + {"properties":[],"isDnd":false,"objectId":{"name":"obj_wall","path":"objects/obj_wall/obj_wall.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":4.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":560.0,"y":64.0,"resourceVersion":"1.0","name":"inst_1F8E8637","tags":[],"resourceType":"GMRInstance",}, + {"properties":[],"isDnd":false,"objectId":{"name":"obj_wall","path":"objects/obj_wall/obj_wall.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":4.5,"scaleY":4.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":928.0,"y":448.0,"resourceVersion":"1.0","name":"inst_7FDB47C0","tags":[],"resourceType":"GMRInstance",}, + {"properties":[],"isDnd":false,"objectId":{"name":"obj_wall","path":"objects/obj_wall/obj_wall.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.75,"scaleY":2.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1104.0,"y":320.0,"resourceVersion":"1.0","name":"inst_483235E5","tags":[],"resourceType":"GMRInstance",}, + {"properties":[],"isDnd":false,"objectId":{"name":"obj_wall","path":"objects/obj_wall/obj_wall.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":2.5,"scaleY":2.5,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":64.0,"y":64.0,"resourceVersion":"1.0","name":"inst_5DCA27CA","tags":[],"resourceType":"GMRInstance",}, + ],"visible":true,"depth":0,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":16,"gridY":16,"layers":[],"hierarchyFrozen":false,"resourceVersion":"1.0","name":"Instances","tags":[],"resourceType":"GMRInstanceLayer",}, + {"spriteId":{"name":"spr_checkboard","path":"sprites/spr_checkboard/spr_checkboard.yy",},"colour":4294967295,"x":0,"y":0,"htiled":true,"vtiled":true,"hspeed":0.0,"vspeed":0.0,"stretch":false,"animationFPS":30.0,"animationSpeedType":0,"userdefinedAnimFPS":false,"visible":true,"depth":100,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":16,"gridY":16,"layers":[],"hierarchyFrozen":false,"resourceVersion":"1.0","name":"Background","tags":[],"resourceType":"GMRBackgroundLayer",}, + ], + "inheritLayers": false, + "creationCodeFile": "", + "inheritCode": false, + "instanceCreationOrder": [ + {"name":"inst_19FF0C38","path":"rooms/rm_playroom/rm_playroom.yy",}, + {"name":"inst_45F8DF6A","path":"rooms/rm_playroom/rm_playroom.yy",}, + {"name":"inst_25CAB898","path":"rooms/rm_playroom/rm_playroom.yy",}, + {"name":"inst_4C389764","path":"rooms/rm_playroom/rm_playroom.yy",}, + {"name":"inst_3B8A34B1","path":"rooms/rm_playroom/rm_playroom.yy",}, + {"name":"inst_70A2CDA7","path":"rooms/rm_playroom/rm_playroom.yy",}, + {"name":"inst_1F8E8637","path":"rooms/rm_playroom/rm_playroom.yy",}, + {"name":"inst_7FDB47C0","path":"rooms/rm_playroom/rm_playroom.yy",}, + {"name":"inst_483235E5","path":"rooms/rm_playroom/rm_playroom.yy",}, + {"name":"inst_5DCA27CA","path":"rooms/rm_playroom/rm_playroom.yy",}, + ], + "inheritCreationOrder": false, + "sequenceId": null, + "roomSettings": { + "inheritRoomSettings": false, + "Width": 1280, + "Height": 768, + "persistent": false, + }, + "viewSettings": { + "inheritViewSettings": false, + "enableViews": false, + "clearViewBackground": false, + "clearDisplayBuffer": true, + }, + "physicsSettings": { + "inheritPhysicsSettings": false, + "PhysicsWorld": false, + "PhysicsWorldGravityX": 0.0, + "PhysicsWorldGravityY": 10.0, + "PhysicsWorldPixToMetres": 0.1, + }, + "parent": { + "name": "Rooms", + "path": "folders/Rooms.yy", + }, + "resourceVersion": "1.0", + "name": "rm_playroom", + "tags": [], + "resourceType": "GMRoom", +} \ No newline at end of file diff --git a/scripts/ActiveTimerConsideration/ActiveTimerConsideration.gml b/scripts/ActiveTimerConsideration/ActiveTimerConsideration.gml new file mode 100644 index 0000000..5998a83 --- /dev/null +++ b/scripts/ActiveTimerConsideration/ActiveTimerConsideration.gml @@ -0,0 +1,18 @@ +/// @func ActiveTimerConsideration(time, [in_frames]); +function ActiveTimerConsideration(time, in_frames) : IConsideration() constructor { + self.set_time = (is_undefined(in_frames) or in_frames == false) ? time * game_get_speed(gamespeed_fps) : time; + self.time = set_time; + + static evaluate = function() { + if (time <= 0) { + return false; + } else { + --time; + return true; + } + } + + static reset = function() { + time = set_time; + } +} \ No newline at end of file diff --git a/scripts/ActiveTimerConsideration/ActiveTimerConsideration.yy b/scripts/ActiveTimerConsideration/ActiveTimerConsideration.yy new file mode 100644 index 0000000..f3a9e93 --- /dev/null +++ b/scripts/ActiveTimerConsideration/ActiveTimerConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Time", + "path": "folders/ECS/State Machine/Considerations/Time.yy", + }, + "resourceVersion": "1.0", + "name": "ActiveTimerConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/ActiveTimerConsideration/TimerConsideration.yy b/scripts/ActiveTimerConsideration/TimerConsideration.yy new file mode 100644 index 0000000..cc8e248 --- /dev/null +++ b/scripts/ActiveTimerConsideration/TimerConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Time", + "path": "folders/ECS/State Machine/Considerations/Time.yy", + }, + "resourceVersion": "1.0", + "name": "TimerConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/AnimationEndConsideration/AnimationEndConsideration.gml b/scripts/AnimationEndConsideration/AnimationEndConsideration.gml new file mode 100644 index 0000000..6236261 --- /dev/null +++ b/scripts/AnimationEndConsideration/AnimationEndConsideration.gml @@ -0,0 +1,16 @@ +function AnimationEndConsideration() : IConsideration() constructor { + previous_index = 0; + + static evaluate = function() { + if (previous_index > owner.image_index) { + return true; + } + + previous_index = owner.image_index; + return false; + } + + static reset = function() { + previous_index = 0; + } +} \ No newline at end of file diff --git a/scripts/AnimationEndConsideration/AnimationEndConsideration.yy b/scripts/AnimationEndConsideration/AnimationEndConsideration.yy new file mode 100644 index 0000000..94a0faf --- /dev/null +++ b/scripts/AnimationEndConsideration/AnimationEndConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Animation", + "path": "folders/ECS/State Machine/Considerations/Animation.yy", + }, + "resourceVersion": "1.0", + "name": "AnimationEndConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/AnimationEndMomentConsideration/AnimationEndConsideration.yy b/scripts/AnimationEndMomentConsideration/AnimationEndConsideration.yy new file mode 100644 index 0000000..bc7a622 --- /dev/null +++ b/scripts/AnimationEndMomentConsideration/AnimationEndConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Considerations", + "path": "folders/_ECS/Rendering/Considerations.yy", + }, + "resourceVersion": "1.0", + "name": "AnimationEndConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/AnimationEndMomentConsideration/AnimationEndMomentConsideration.gml b/scripts/AnimationEndMomentConsideration/AnimationEndMomentConsideration.gml new file mode 100644 index 0000000..b76adcd --- /dev/null +++ b/scripts/AnimationEndMomentConsideration/AnimationEndMomentConsideration.gml @@ -0,0 +1,17 @@ +function AnimationEndMomentConsideration() : IConsideration() constructor { + previous_index = 0; + + static evaluate = function() { + var _evaluate = false; + if (previous_index > owner.image_index) { + _evaluate = true; + } + + previous_index = owner.image_index; + return _evaluate; + } + + static reset = function() { + previous_index = 0; + } +} \ No newline at end of file diff --git a/scripts/AnimationEndMomentConsideration/AnimationEndMomentConsideration.yy b/scripts/AnimationEndMomentConsideration/AnimationEndMomentConsideration.yy new file mode 100644 index 0000000..83b2cb2 --- /dev/null +++ b/scripts/AnimationEndMomentConsideration/AnimationEndMomentConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Animation", + "path": "folders/ECS/State Machine/Considerations/Animation.yy", + }, + "resourceVersion": "1.0", + "name": "AnimationEndMomentConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/AnimationFrameBetweenConsideration/AnimationFrameBetweenConsideration.gml b/scripts/AnimationFrameBetweenConsideration/AnimationFrameBetweenConsideration.gml new file mode 100644 index 0000000..cf58763 --- /dev/null +++ b/scripts/AnimationFrameBetweenConsideration/AnimationFrameBetweenConsideration.gml @@ -0,0 +1,12 @@ +function AnimationFrameBetweenConsideration(frame_min, frame_max) : IConsideration() constructor { + self.frame_min = frame_min; + self.frame_max = frame_max; + + static evaluate = function() { + if (owner.image_index >= frame_min and owner.image_index <= frame_max) { + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/scripts/AnimationFrameBetweenConsideration/AnimationFrameBetweenConsideration.yy b/scripts/AnimationFrameBetweenConsideration/AnimationFrameBetweenConsideration.yy new file mode 100644 index 0000000..c361786 --- /dev/null +++ b/scripts/AnimationFrameBetweenConsideration/AnimationFrameBetweenConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Animation", + "path": "folders/ECS/State Machine/Considerations/Animation.yy", + }, + "resourceVersion": "1.0", + "name": "AnimationFrameBetweenConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/AnimationFrameConsideration/AnimationFrameConsideration.gml b/scripts/AnimationFrameConsideration/AnimationFrameConsideration.gml new file mode 100644 index 0000000..5e3e1c4 --- /dev/null +++ b/scripts/AnimationFrameConsideration/AnimationFrameConsideration.gml @@ -0,0 +1,26 @@ +function AnimationFrameConsideration(frame_number, comparison_type) : IConsideration() constructor { + self.frame_number = frame_number; + self.comparison_type = comparison_type; + + static evaluate = function() { + switch (comparison_type) { + case ComparisonType.LT: + if (floor(owner.image_index) < frame_number) { return true; } + break; + case ComparisonType.GT: + if (floor(owner.image_index) > frame_number) { return true; } + break; + case ComparisonType.EQ: + if (floor(owner.image_index) == frame_number) { return true; } + break; + case ComparisonType.LTE: + if (floor(owner.image_index) <= frame_number) { return true; } + break; + case ComparisonType.GTE: + if (floor(owner.image_index) >= frame_number) { return true; } + break; + } + + return false; + } +} \ No newline at end of file diff --git a/scripts/AnimationFrameConsideration/AnimationFrameConsideration.yy b/scripts/AnimationFrameConsideration/AnimationFrameConsideration.yy new file mode 100644 index 0000000..e900539 --- /dev/null +++ b/scripts/AnimationFrameConsideration/AnimationFrameConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Animation", + "path": "folders/ECS/State Machine/Considerations/Animation.yy", + }, + "resourceVersion": "1.0", + "name": "AnimationFrameConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/AnimationPauseSystem/AnimationPauseSystem.gml b/scripts/AnimationPauseSystem/AnimationPauseSystem.gml new file mode 100644 index 0000000..0e25b95 --- /dev/null +++ b/scripts/AnimationPauseSystem/AnimationPauseSystem.gml @@ -0,0 +1,40 @@ +function AnimationPauseSystem() : ISystem() constructor { + pausable(false); + + pause_list = []; + init_pause = true; + + static step = function() { + // PAUSE + if (global.pause == true and init_pause == true) { + init_pause = false; + var _instances = []; + + // STORE PAUSABLE INSTANCES + with (all) { + if (!component_exists(id, UnpausableTag)) { + array_push(_instances, id); + } + } + + // LOOP PAUSABLE INSTANCES AND PAUSE THEIR ANIMATION WHILE STORING THEIR IMAGE_SPEED + for (var i = 0; i < array_length(_instances); ++i) { + var _inst = _instances[i]; + array_push(pause_list, { + id: _inst.id, + image_speed: _inst.image_speed + }); + _inst.image_speed = 0; + } + } + + // UNPAUSE AND RESTORE PRIOR IMAGE_SPEED + if (global.pause == false and init_pause = false) { + init_pause = true; + for (var i = 0; i < array_length(pause_list); ++i) { + pause_list[i].id.image_speed = pause_list[i].image_speed; + } + array_resize(pause_list, 0); + } + } +} \ No newline at end of file diff --git a/scripts/AnimationPauseSystem/AnimationPauseSystem.yy b/scripts/AnimationPauseSystem/AnimationPauseSystem.yy new file mode 100644 index 0000000..df7775f --- /dev/null +++ b/scripts/AnimationPauseSystem/AnimationPauseSystem.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Systems", + "path": "folders/ECS/Rendering/Animation/Systems.yy", + }, + "resourceVersion": "1.0", + "name": "AnimationPauseSystem", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/AnimationSystem/AnimationSystem.gml b/scripts/AnimationSystem/AnimationSystem.gml new file mode 100644 index 0000000..86d1da9 --- /dev/null +++ b/scripts/AnimationSystem/AnimationSystem.gml @@ -0,0 +1,61 @@ +function AnimationSystem(requirements) : ISystem(requirements) constructor { + static endStep = function() { + for (var i = 0; i < entity_count; i++) { + var _entity = entities[i]; + var _sprite_component = component_get(_entity, SpriteComponent); + var _sprite_data = _sprite_component.sprite_data; + + if (component_exists(_entity, FacingDirectionComponent) and is_array(_sprite_data)) { + var _facing = component_get(_entity, FacingDirectionComponent); + _entity.sprite_index = _sprite_data[_facing.direction]; + } + + // SET PLAYBACK SPEED + _entity.image_speed = _sprite_component.playback_speed; + + // PLAYBACK OPTIONS + var _playback = _sprite_component.playback_type; + switch (_playback) { + case SpritePlaybackType.ONCE: + // FIXTHIS: IMPLEMENT LATER + break; + case SpritePlaybackType.LOOP: + // GM loops automatically + break; + case SpritePlaybackType.PING_PONG: + // FIXTHIS: IMPLEMENT LATER + break; + case SpritePlaybackType.FREEZE: + _entity.image_speed = 0; + break; + } + } + } + + static enterSystem = function(entity) { + var _sprite_component = component_get(entity, SpriteComponent); + var _sprite_data = _sprite_component.sprite_data; + var _sprite = undefined; + + // GRAB CORRECT SPRITE + if (is_array(_sprite_data)) { + var _facing_component = component_get(entity, FacingDirectionComponent); + if (is_undefined(_facing_component)) { + throw " AnimationSystem: FacingDirectionComponent does not exist on entity."; + } + _sprite = _sprite_data[_facing_component.direction]; + } else { + _sprite = _sprite_data; + } + + // SET SPRITE + entity.sprite_index = _sprite; + + // SET PLAYBACK SPEED + entity.image_speed = _sprite_component.playback_speed; + + if (_sprite_component.reset_index) { + entity.image_index = 0; + } + } +} \ No newline at end of file diff --git a/scripts/AnimationSystem/AnimationSystem.yy b/scripts/AnimationSystem/AnimationSystem.yy new file mode 100644 index 0000000..f890eb4 --- /dev/null +++ b/scripts/AnimationSystem/AnimationSystem.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Systems", + "path": "folders/ECS/Rendering/Animation/Systems.yy", + }, + "resourceVersion": "1.0", + "name": "AnimationSystem", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/ArrayHelpers/ArrayHelpers.gml b/scripts/ArrayHelpers/ArrayHelpers.gml new file mode 100644 index 0000000..e797e82 --- /dev/null +++ b/scripts/ArrayHelpers/ArrayHelpers.gml @@ -0,0 +1,27 @@ +function array_find(array, value) { + for (var i = array_length(array) - 1; i >= 0; --i) { + if (array[i] == value) { + return i; + } + } + + return -1; +} + +function array_contains(array, value) { + return bool(array_find(array, value) + 1); +} + +function array_filter(array, func) { + var _return_array = []; + + var _index = 0; + repeat (array_length(array)) { + if (func(array[_index], _index, array)) { + array_push(_return_array, array[_index]); + } + ++_index; + } + + return _return_array; +} \ No newline at end of file diff --git a/scripts/ArrayHelpers/ArrayHelpers.yy b/scripts/ArrayHelpers/ArrayHelpers.yy new file mode 100644 index 0000000..1a9b763 --- /dev/null +++ b/scripts/ArrayHelpers/ArrayHelpers.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Helper Functions", + "path": "folders/ECS/_Internal/Helper Functions.yy", + }, + "resourceVersion": "1.0", + "name": "ArrayHelpers", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/CameraFollowComponent/CameraFollowComponent.gml b/scripts/CameraFollowComponent/CameraFollowComponent.gml new file mode 100644 index 0000000..4a2f402 --- /dev/null +++ b/scripts/CameraFollowComponent/CameraFollowComponent.gml @@ -0,0 +1,7 @@ +/// @func CameraFollowComponent([offset_x], [offset_y], [ease], [lerp_amt]) +function CameraFollowComponent(offset_x, offset_y, ease, lerp_amt) : IComponent() constructor { + self.offset_x = is_undefined(offset_x) ? 0 : offset_x; + self.offset_y = is_undefined(offset_y) ? 0 : offset_y; + self.ease = is_undefined(ease) ? false : ease; + self.lerp_amt = is_undefined(lerp_amt) ? 0.1 : lerp_amt; +} \ No newline at end of file diff --git a/scripts/CameraFollowComponent/CameraFollowComponent.yy b/scripts/CameraFollowComponent/CameraFollowComponent.yy new file mode 100644 index 0000000..c74fe77 --- /dev/null +++ b/scripts/CameraFollowComponent/CameraFollowComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/ECS/Rendering/Camera/Components.yy", + }, + "resourceVersion": "1.0", + "name": "CameraFollowComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/CameraShakeComponent/CameraFollowComponent.yy b/scripts/CameraShakeComponent/CameraFollowComponent.yy new file mode 100644 index 0000000..92df82e --- /dev/null +++ b/scripts/CameraShakeComponent/CameraFollowComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/_ECS/Rendering/Camera/Components.yy", + }, + "resourceVersion": "1.0", + "name": "CameraFollowComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/CameraShakeComponent/CameraShakeComponent.gml b/scripts/CameraShakeComponent/CameraShakeComponent.gml new file mode 100644 index 0000000..b113eab --- /dev/null +++ b/scripts/CameraShakeComponent/CameraShakeComponent.gml @@ -0,0 +1,6 @@ +/// @func CameraShakeComponent([strength], [time], [frequency]) +function CameraShakeComponent(strength, time, frequency) : IComponent() constructor { + self.strength = is_undefined(strength) ? 4 : strength; + self.time = is_undefined(time) ? 1 : time; + self.frequency = is_undefined(frequency) ? 0.02 : frequency; +} \ No newline at end of file diff --git a/scripts/CameraShakeComponent/CameraShakeComponent.yy b/scripts/CameraShakeComponent/CameraShakeComponent.yy new file mode 100644 index 0000000..99ffb12 --- /dev/null +++ b/scripts/CameraShakeComponent/CameraShakeComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/ECS/Rendering/Camera/Components.yy", + }, + "resourceVersion": "1.0", + "name": "CameraShakeComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/CameraShakeSystem/CameraShakeSystem.gml b/scripts/CameraShakeSystem/CameraShakeSystem.gml new file mode 100644 index 0000000..857833e --- /dev/null +++ b/scripts/CameraShakeSystem/CameraShakeSystem.gml @@ -0,0 +1,33 @@ +function CameraShakeSystem(requirements) : ISystem(requirements) constructor { + pausable(false); + + static enterSystem = function(entity) { + for (var i = 0; i < entity_count; ++i) { + var _entity = entities[i]; + if (_entity != entity) { + component_remove(_entity, CameraShakeComponent); + } + } + entity_count = array_length(entities); + } + + static endStep = function() { + if (entity_count != 0) { + var _entity = entities[0]; + var _shake = component_get(_entity, CameraShakeComponent); + + if (_shake.time > 0) { + var _shake_x = CAMERA_X + choose(-_shake.strength, _shake.strength); + var _shake_y = CAMERA_Y + choose(-_shake.strength, _shake.strength); + + camera_set_view_pos(CAMERA, _shake_x, _shake_y); + camera_set_view_angle(CAMERA, choose(-0.5, 0.5)); + + --_shake.time; + } else { + camera_set_view_angle(CAMERA, 0); + component_remove(_entity, CameraShakeComponent); + } + } + } +} \ No newline at end of file diff --git a/scripts/CameraShakeSystem/CameraShakeSystem.yy b/scripts/CameraShakeSystem/CameraShakeSystem.yy new file mode 100644 index 0000000..568ce93 --- /dev/null +++ b/scripts/CameraShakeSystem/CameraShakeSystem.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Systems", + "path": "folders/ECS/Rendering/Camera/Systems.yy", + }, + "resourceVersion": "1.0", + "name": "CameraShakeSystem", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/CameraShakeSystem/CameraSystem.yy b/scripts/CameraShakeSystem/CameraSystem.yy new file mode 100644 index 0000000..c5afbf0 --- /dev/null +++ b/scripts/CameraShakeSystem/CameraSystem.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Systems", + "path": "folders/_ECS/Rendering/Camera/Systems.yy", + }, + "resourceVersion": "1.0", + "name": "CameraSystem", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/CameraSystem/CameraSystem.gml b/scripts/CameraSystem/CameraSystem.gml new file mode 100644 index 0000000..73254f1 --- /dev/null +++ b/scripts/CameraSystem/CameraSystem.gml @@ -0,0 +1,60 @@ +#macro CAMERA view_camera[0] +#macro CAMERA_X camera_get_view_x(view_camera[0]) +#macro CAMERA_Y camera_get_view_y(view_camera[0]) +#macro CAMERA_WIDTH camera_get_view_width(view_camera[0]) +#macro CAMERA_HEIGHT camera_get_view_height(view_camera[0]) + +function CameraSystem(requirements) : ISystem(requirements) constructor { + pausable(false); + + static roomStart = function() { + view_enabled = true; + view_visible[0] = true; + camera_set_view_size(CAMERA, 480, 270); + } + + static endStep = function() { + if (entity_count <= 0) { return; } + + var _target_x = 0; + var _target_y = 0; + + // CODE TO GO IN BETWEEN TWO ENTITIES + //for (var i = 0; i < entity_count; ++i) { + // var _entity = entities[i]; + + // _target_x += _entity.x - (CAMERA_WIDTH / 2); + // _target_y += _entity.y - (CAMERA_HEIGHT / 2); + //} + //_target_x /= entity_count; + //_target_y /= entity_count; + + // FOLLOW LATEST TARGET + var _e = entities[entity_count - 1]; + var _cam_comp = component_get(_e, CameraFollowComponent); + _target_x += _e.x + _cam_comp.offset_x - (CAMERA_WIDTH / 2); + _target_y += _e.y + _cam_comp.offset_y - (CAMERA_HEIGHT / 2); + + if (_cam_comp.ease) { + var _current_x = lerp(CAMERA_X, _target_x, _cam_comp.lerp_amt); + var _current_y = lerp(CAMERA_Y, _target_y, _cam_comp.lerp_amt); + } else { + var _current_x = _target_x; + var _current_y = _target_y; + } + + // CLAMP TO ROOM BORDERS + if (room_width < CAMERA_WIDTH) { + _current_x = -(CAMERA_WIDTH - room_width) / 2; + } else { + _current_x = clamp(_current_x, 0, room_width - CAMERA_WIDTH); + } + if (room_height < CAMERA_HEIGHT) { + _current_y = -(CAMERA_HEIGHT - room_height) / 2; + } else { + _current_y = clamp(_current_y, 0, room_height - CAMERA_HEIGHT); + } + + camera_set_view_pos(CAMERA, _current_x, _current_y); + } +} \ No newline at end of file diff --git a/scripts/CameraSystem/CameraSystem.yy b/scripts/CameraSystem/CameraSystem.yy new file mode 100644 index 0000000..66602b3 --- /dev/null +++ b/scripts/CameraSystem/CameraSystem.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Systems", + "path": "folders/ECS/Rendering/Camera/Systems.yy", + }, + "resourceVersion": "1.0", + "name": "CameraSystem", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/CounterComponent/CounterComponent.gml b/scripts/CounterComponent/CounterComponent.gml new file mode 100644 index 0000000..e0af033 --- /dev/null +++ b/scripts/CounterComponent/CounterComponent.gml @@ -0,0 +1,3 @@ +function CounterComponent() : IComponent() constructor { + time = 0; +} \ No newline at end of file diff --git a/scripts/CounterComponent/CounterComponent.yy b/scripts/CounterComponent/CounterComponent.yy new file mode 100644 index 0000000..365896a --- /dev/null +++ b/scripts/CounterComponent/CounterComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/ECS/Utilities/Counter/Components.yy", + }, + "resourceVersion": "1.0", + "name": "CounterComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/CounterSystem/CounterSystem.gml b/scripts/CounterSystem/CounterSystem.gml new file mode 100644 index 0000000..2868b59 --- /dev/null +++ b/scripts/CounterSystem/CounterSystem.gml @@ -0,0 +1,15 @@ +function CounterSystem(requirements) : ISystem(requirements) constructor { + static enterSystem = function(entity) { + var _counter = component_get(entity, CounterComponent); + _counter.time = 0; + } + + static endStep = function() { + for (var i = 0; i < entity_count; ++i) { + var _entity = entities[i]; + var _counter = component_get(_entity, CounterComponent); + + _counter.time++; + } + } +} \ No newline at end of file diff --git a/scripts/CounterSystem/CounterSystem.yy b/scripts/CounterSystem/CounterSystem.yy new file mode 100644 index 0000000..5ca9278 --- /dev/null +++ b/scripts/CounterSystem/CounterSystem.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Systems", + "path": "folders/ECS/Utilities/Counter/Systems.yy", + }, + "resourceVersion": "1.0", + "name": "CounterSystem", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/FacingDirectionComponent/FacingDirectionComponent.gml b/scripts/FacingDirectionComponent/FacingDirectionComponent.gml new file mode 100644 index 0000000..b23300c --- /dev/null +++ b/scripts/FacingDirectionComponent/FacingDirectionComponent.gml @@ -0,0 +1,3 @@ +function FacingDirectionComponent(initial_direction) : IComponent() constructor { + direction = initial_direction; +} \ No newline at end of file diff --git a/scripts/FacingDirectionComponent/FacingDirectionComponent.yy b/scripts/FacingDirectionComponent/FacingDirectionComponent.yy new file mode 100644 index 0000000..a8cac50 --- /dev/null +++ b/scripts/FacingDirectionComponent/FacingDirectionComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/ECS/Rendering/Animation/Components.yy", + }, + "resourceVersion": "1.0", + "name": "FacingDirectionComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/FrictionComponent/FrictionComponent.gml b/scripts/FrictionComponent/FrictionComponent.gml new file mode 100644 index 0000000..52cf0ca --- /dev/null +++ b/scripts/FrictionComponent/FrictionComponent.gml @@ -0,0 +1,3 @@ +function FrictionComponent(amount) : IComponent() constructor { + self.amount = amount; +} \ No newline at end of file diff --git a/scripts/FrictionComponent/FrictionComponent.yy b/scripts/FrictionComponent/FrictionComponent.yy new file mode 100644 index 0000000..d9b31b3 --- /dev/null +++ b/scripts/FrictionComponent/FrictionComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/ECS/Movement/Components.yy", + }, + "resourceVersion": "1.0", + "name": "FrictionComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/HasComponentConsideration/HasComponentConsideration.gml b/scripts/HasComponentConsideration/HasComponentConsideration.gml new file mode 100644 index 0000000..3a2bb70 --- /dev/null +++ b/scripts/HasComponentConsideration/HasComponentConsideration.gml @@ -0,0 +1,7 @@ +function HasComponentConsideration(component) : IConsideration() constructor { + self.component = component; + + static evaluate = function() { + return component_exists(owner, component); + } +} \ No newline at end of file diff --git a/scripts/HasComponentConsideration/HasComponentConsideration.yy b/scripts/HasComponentConsideration/HasComponentConsideration.yy new file mode 100644 index 0000000..2d31aeb --- /dev/null +++ b/scripts/HasComponentConsideration/HasComponentConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "ECS", + "path": "folders/ECS/State Machine/Considerations/ECS.yy", + }, + "resourceVersion": "1.0", + "name": "HasComponentConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/HasNotComponentConsideration/HasNotComponentConsideration.gml b/scripts/HasNotComponentConsideration/HasNotComponentConsideration.gml new file mode 100644 index 0000000..6541301 --- /dev/null +++ b/scripts/HasNotComponentConsideration/HasNotComponentConsideration.gml @@ -0,0 +1,7 @@ +function HasNotComponentConsideration(component) : IConsideration() constructor { + self.component = component; + + static evaluate = function() { + return !component_exists(owner, component); + } +} \ No newline at end of file diff --git a/scripts/HasNotComponentConsideration/HasNotComponentConsideration.yy b/scripts/HasNotComponentConsideration/HasNotComponentConsideration.yy new file mode 100644 index 0000000..fa1cc67 --- /dev/null +++ b/scripts/HasNotComponentConsideration/HasNotComponentConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "ECS", + "path": "folders/ECS/State Machine/Considerations/ECS.yy", + }, + "resourceVersion": "1.0", + "name": "HasNotComponentConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/HealthBelowConsideration/HealthBelowConsideration.gml b/scripts/HealthBelowConsideration/HealthBelowConsideration.gml new file mode 100644 index 0000000..f67555a --- /dev/null +++ b/scripts/HealthBelowConsideration/HealthBelowConsideration.gml @@ -0,0 +1,9 @@ +function HealthBelowConsideration(amount) : IConsideration() constructor { + required_components = [HealthComponent]; + self.amount = amount; + + static evaluate = function() { + var _health = component_get(owner, HealthComponent); + return (_health.amount < amount); + } +} \ No newline at end of file diff --git a/scripts/HealthBelowConsideration/HealthBelowConsideration.yy b/scripts/HealthBelowConsideration/HealthBelowConsideration.yy new file mode 100644 index 0000000..8ef2163 --- /dev/null +++ b/scripts/HealthBelowConsideration/HealthBelowConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Health", + "path": "folders/ECS/State Machine/Considerations/Stats/Health.yy", + }, + "resourceVersion": "1.0", + "name": "HealthBelowConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/HealthBelowConsideration/StaminaDepletedConsideration.yy b/scripts/HealthBelowConsideration/StaminaDepletedConsideration.yy new file mode 100644 index 0000000..650728a --- /dev/null +++ b/scripts/HealthBelowConsideration/StaminaDepletedConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Stamina", + "path": "folders/FaultyECS/State Machine/Considerations/Stats/Stamina.yy", + }, + "resourceVersion": "1.0", + "name": "StaminaDepletedConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/HealthComponent/HealthComponent.gml b/scripts/HealthComponent/HealthComponent.gml new file mode 100644 index 0000000..416e9d7 --- /dev/null +++ b/scripts/HealthComponent/HealthComponent.gml @@ -0,0 +1,11 @@ +function HealthComponent(max_health) : IComponent() constructor { + maximum = max_health; + amount = max_health; + + modify_health_queue = []; + + /// @func modifyHealth(amount); + static modifyHealth = function(amount) { + array_push(modify_health_queue, amount); + } +} \ No newline at end of file diff --git a/scripts/HealthComponent/HealthComponent.yy b/scripts/HealthComponent/HealthComponent.yy new file mode 100644 index 0000000..31485a2 --- /dev/null +++ b/scripts/HealthComponent/HealthComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/ECS/Stats/Health/Components.yy", + }, + "resourceVersion": "1.0", + "name": "HealthComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/HealthConsumeComponent/HealthConsumeComponent.gml b/scripts/HealthConsumeComponent/HealthConsumeComponent.gml new file mode 100644 index 0000000..33a43eb --- /dev/null +++ b/scripts/HealthConsumeComponent/HealthConsumeComponent.gml @@ -0,0 +1,4 @@ +function HealthConsumeComponent(amount) : IComponent() constructor { + self.amount = amount; + consumed = false; +} \ No newline at end of file diff --git a/scripts/HealthConsumeComponent/HealthConsumeComponent.yy b/scripts/HealthConsumeComponent/HealthConsumeComponent.yy new file mode 100644 index 0000000..8c96a9d --- /dev/null +++ b/scripts/HealthConsumeComponent/HealthConsumeComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/ECS/Stats/Health/Components.yy", + }, + "resourceVersion": "1.0", + "name": "HealthConsumeComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/HealthConsumeComponent/StaminaConsumeComponent.yy b/scripts/HealthConsumeComponent/StaminaConsumeComponent.yy new file mode 100644 index 0000000..b531631 --- /dev/null +++ b/scripts/HealthConsumeComponent/StaminaConsumeComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/ECS/Stats/Stamina/Components.yy", + }, + "resourceVersion": "1.0", + "name": "StaminaConsumeComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/HealthDepletedConsideration/HealthBelowConsideration.yy b/scripts/HealthDepletedConsideration/HealthBelowConsideration.yy new file mode 100644 index 0000000..e012f7d --- /dev/null +++ b/scripts/HealthDepletedConsideration/HealthBelowConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Health", + "path": "folders/FaultyECS/State Machine/Considerations/Stats/Health.yy", + }, + "resourceVersion": "1.0", + "name": "HealthBelowConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/HealthDepletedConsideration/HealthDepletedConsideration.gml b/scripts/HealthDepletedConsideration/HealthDepletedConsideration.gml new file mode 100644 index 0000000..40232cc --- /dev/null +++ b/scripts/HealthDepletedConsideration/HealthDepletedConsideration.gml @@ -0,0 +1,8 @@ +function HealthDepletedConsideration() : IConsideration() constructor { + required_components = [HealthComponent]; + + static evaluate = function() { + var _health = component_get(owner, HealthComponent); + return (_health.amount <= 0); + } +} \ No newline at end of file diff --git a/scripts/HealthDepletedConsideration/HealthDepletedConsideration.yy b/scripts/HealthDepletedConsideration/HealthDepletedConsideration.yy new file mode 100644 index 0000000..4679c7f --- /dev/null +++ b/scripts/HealthDepletedConsideration/HealthDepletedConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Health", + "path": "folders/ECS/State Machine/Considerations/Stats/Health.yy", + }, + "resourceVersion": "1.0", + "name": "HealthDepletedConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/HealthDepletedConsideration/StaminaDepletedConsideration.yy b/scripts/HealthDepletedConsideration/StaminaDepletedConsideration.yy new file mode 100644 index 0000000..650728a --- /dev/null +++ b/scripts/HealthDepletedConsideration/StaminaDepletedConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Stamina", + "path": "folders/FaultyECS/State Machine/Considerations/Stats/Stamina.yy", + }, + "resourceVersion": "1.0", + "name": "StaminaDepletedConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/HealthDrainComponent/HealthDrainComponent.gml b/scripts/HealthDrainComponent/HealthDrainComponent.gml new file mode 100644 index 0000000..9006666 --- /dev/null +++ b/scripts/HealthDrainComponent/HealthDrainComponent.gml @@ -0,0 +1,7 @@ +function HealthDrainComponent(amount, rate, delay) : IComponent() constructor { + self.amount = amount; + self.rate = rate; + self.delay = is_undefined(delay) ? 0 : delay; + time = rate * game_get_speed(gamespeed_fps); + enabled = true; +} \ No newline at end of file diff --git a/scripts/HealthDrainComponent/HealthDrainComponent.yy b/scripts/HealthDrainComponent/HealthDrainComponent.yy new file mode 100644 index 0000000..6beef58 --- /dev/null +++ b/scripts/HealthDrainComponent/HealthDrainComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/ECS/Stats/Health/Components.yy", + }, + "resourceVersion": "1.0", + "name": "HealthDrainComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/HealthSystem/HealthSystem.gml b/scripts/HealthSystem/HealthSystem.gml new file mode 100644 index 0000000..88a077a --- /dev/null +++ b/scripts/HealthSystem/HealthSystem.gml @@ -0,0 +1,38 @@ +function HealthSystem(requirements) : ISystem(requirements) constructor { + static endStep = function() { + for (var i = 0; i < entity_count; ++i) { + var _entity = entities[i]; + + var _health = component_get(_entity, HealthComponent); + + // HEALTH DRAIN + var _drain = component_get(_entity, HealthDrainComponent); + if (_drain != undefined and _drain.enabled) { + if (_drain.delay <= 0) { + --_drain.time; + if (_drain.time <= 0) { + _drain.time = _drain.rate * game_get_speed(gamespeed_fps); + _health.amount -= _drain.amount; + } + } else { + --_drain.delay; + } + } + + // HEALTH CONSUME + if (component_exists(_entity, HealthConsumeComponent)) { + var _consume = component_get(_entity, HealthConsumeComponent); + _health.amount -= _consume.amount; + component_remove(_entity, HealthConsumeComponent); + } + + for (var j = 0; j < array_length(_health.modify_health_queue); ++j) { + _health.amount += _health.modify_health_queue[j]; + _health.amount = clamp(_health.amount, 0, _health.maximum); + } + if (array_length(_health.modify_health_queue) > 0) { + array_resize(_health.modify_health_queue, 0); + } + } + } +} \ No newline at end of file diff --git a/scripts/HealthSystem/HealthSystem.yy b/scripts/HealthSystem/HealthSystem.yy new file mode 100644 index 0000000..c333eff --- /dev/null +++ b/scripts/HealthSystem/HealthSystem.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Systems", + "path": "folders/ECS/Stats/Health/Systems.yy", + }, + "resourceVersion": "1.0", + "name": "HealthSystem", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/ImpulseComponent/ConstandSpeedComponent.yy b/scripts/ImpulseComponent/ConstandSpeedComponent.yy new file mode 100644 index 0000000..371b8a2 --- /dev/null +++ b/scripts/ImpulseComponent/ConstandSpeedComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/FaultyECS/Movement/Components.yy", + }, + "resourceVersion": "1.0", + "name": "ConstandSpeedComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/ImpulseComponent/ImpulseComponent.gml b/scripts/ImpulseComponent/ImpulseComponent.gml new file mode 100644 index 0000000..8e8f864 --- /dev/null +++ b/scripts/ImpulseComponent/ImpulseComponent.gml @@ -0,0 +1,6 @@ +/// @func ImpulseComponent(force, [direction]); +function ImpulseComponent(force, direction) : IComponent() constructor { + self.force = force; + self.direction = direction; + used = false; +} \ No newline at end of file diff --git a/scripts/ImpulseComponent/ImpulseComponent.yy b/scripts/ImpulseComponent/ImpulseComponent.yy new file mode 100644 index 0000000..3ce02f3 --- /dev/null +++ b/scripts/ImpulseComponent/ImpulseComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/ECS/Movement/Components.yy", + }, + "resourceVersion": "1.0", + "name": "ImpulseComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/ImpulseComponent/VelocityComponent.yy b/scripts/ImpulseComponent/VelocityComponent.yy new file mode 100644 index 0000000..f720c55 --- /dev/null +++ b/scripts/ImpulseComponent/VelocityComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/FaultyECS/Movement/Components.yy", + }, + "resourceVersion": "1.0", + "name": "VelocityComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/ImpulseFacingComponent/ImpulseFacingComponent.gml b/scripts/ImpulseFacingComponent/ImpulseFacingComponent.gml new file mode 100644 index 0000000..88ac936 --- /dev/null +++ b/scripts/ImpulseFacingComponent/ImpulseFacingComponent.gml @@ -0,0 +1,3 @@ +function ImpulseFacingComponent(force) : IComponent() constructor { + self.force = force; +} \ No newline at end of file diff --git a/scripts/ImpulseFacingComponent/ImpulseFacingComponent.yy b/scripts/ImpulseFacingComponent/ImpulseFacingComponent.yy new file mode 100644 index 0000000..6ba9ca5 --- /dev/null +++ b/scripts/ImpulseFacingComponent/ImpulseFacingComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/ECS/Movement/Components.yy", + }, + "resourceVersion": "1.0", + "name": "ImpulseFacingComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/MoveComponent/MoveComponent.gml b/scripts/MoveComponent/MoveComponent.gml new file mode 100644 index 0000000..c56a3ac --- /dev/null +++ b/scripts/MoveComponent/MoveComponent.gml @@ -0,0 +1,38 @@ +enum CollisionType { + NONE, + SIMPLE, + NORMAL +} + +function MoveComponent(collision_type = CollisionType.SIMPLE) : IComponent() constructor { + self.collision_type = collision_type; + velocity = new Vector2(0, 0); + enabled = true; + collided = false; +} + +function mask_get_width(inst) { + inst = is_undefined(inst) ? id : inst; + var _mask = (inst.mask_index != -1) ? inst.sprite_index : inst.mask_index; + return sprite_get_bbox_right(_mask) - sprite_get_bbox_left(_mask); +} + +function mask_get_height(inst) { + inst = is_undefined(inst) ? id : inst; + var _mask = (inst.mask_index != -1) ? inst.sprite_index : inst.mask_index; + return sprite_get_bbox_bottom(_mask) - sprite_get_bbox_top(_mask); +} + +function mask_get_offset_x(inst) { + inst = is_undefined(inst) ? id : inst; + var _mask = (inst.mask_index != -1) ? inst.sprite_index : inst.mask_index; + var _mask_center = (sprite_get_bbox_left(_mask) + sprite_get_bbox_right(_mask)) / 2; + return (_mask_center - inst.sprite_xoffset) +} + +function mask_get_offset_y(inst) { + inst = is_undefined(inst) ? id : inst; + var _mask = (inst.mask_index != -1) ? inst.sprite_index : inst.mask_index; + var _mask_center = (sprite_get_bbox_top(_mask) + sprite_get_bbox_bottom(_mask)) / 2; + return (_mask_center - inst.sprite_yoffset) +} \ No newline at end of file diff --git a/scripts/MoveComponent/MoveComponent.yy b/scripts/MoveComponent/MoveComponent.yy new file mode 100644 index 0000000..b88a2fc --- /dev/null +++ b/scripts/MoveComponent/MoveComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/ECS/Movement/Components.yy", + }, + "resourceVersion": "1.0", + "name": "MoveComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/MoveInputConsideration/MoveInputConsideration.gml b/scripts/MoveInputConsideration/MoveInputConsideration.gml new file mode 100644 index 0000000..c326ff2 --- /dev/null +++ b/scripts/MoveInputConsideration/MoveInputConsideration.gml @@ -0,0 +1,5 @@ +function MoveInputConsideration() : IConsideration() constructor { + static evaluate = function() { + return (InputManager.get_x() != 0) or (InputManager.get_y() != 0); + } +} \ No newline at end of file diff --git a/scripts/MoveInputConsideration/MoveInputConsideration.yy b/scripts/MoveInputConsideration/MoveInputConsideration.yy new file mode 100644 index 0000000..a423274 --- /dev/null +++ b/scripts/MoveInputConsideration/MoveInputConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Player", + "path": "folders/ECS/State Machine/Considerations/Player.yy", + }, + "resourceVersion": "1.0", + "name": "MoveInputConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/MovementSystem/MovementSystem.gml b/scripts/MovementSystem/MovementSystem.gml new file mode 100644 index 0000000..bf5ca0a --- /dev/null +++ b/scripts/MovementSystem/MovementSystem.gml @@ -0,0 +1,114 @@ +#macro NO_COLLISION 0 +#macro OBJ_COLLISION 1 +#macro TILE_COLLISION 2 + +function MovementSystem(requirements) : ISystem(requirements) constructor { + static endStep = function() { + for (var i = 0; i < entity_count; i++) { + var _e = entities[i]; + var _move = component_get(_e, MoveComponent); + if (_move.enabled == false) { continue; } + + // PROCESS VELOCITY COMPONENT + if (component_exists(_e, VelocityComponent)) { + var _velocity = component_get(_e, VelocityComponent); + _move.velocity.x = lengthdir_x(_velocity.speed, _velocity.direction); + _move.velocity.y = lengthdir_y(_velocity.speed, _velocity.direction); + } else if (component_exists(_e, FrictionComponent)) { + var _friction = component_get(_e, FrictionComponent); + _move.velocity = _move.velocity.move_toward(global.zero_vector, _friction.amount); + } else { + //// SAMPLE FLOOR FOR FRICTION VALUES? + _move.velocity = _move.velocity.move_toward(global.zero_vector, 1); + } + + // PROCESS IMPULSE COMPONENT + if (component_exists(_e, ImpulseComponent)) { + var _impulse = component_get(_e, ImpulseComponent); + var _comp_x = lengthdir_x(_impulse.force, _impulse.direction); + var _comp_y = lengthdir_y(_impulse.force, _impulse.direction); + _move.velocity.x += _comp_x; + _move.velocity.y += _comp_y; + component_remove(_e, ImpulseComponent); + } + + // PROCESS IMPULSE FACING COMPONENT + if (component_exists(_e, ImpulseFacingComponent)) { + var _impulse = component_get(_e, ImpulseFacingComponent); + var _facing = component_get(_e, FacingDirectionComponent); + var _comp_x = lengthdir_x(_impulse.force, _facing.direction * 90); + var _comp_y = lengthdir_y(_impulse.force, _facing.direction * 90); + _move.velocity.x += _comp_x; + _move.velocity.y += _comp_y; + component_remove(_e, ImpulseFacingComponent); + } + + var _collided = false; + + switch (_move.collision_type) { + case CollisionType.NONE: + _e.x += _move.velocity.x; + _e.y += _move.velocity.y; + break; + case CollisionType.SIMPLE: + _collided = simpleCollision(_e, _move.velocity); + break; + } + + _move.collided = _collided; + } + } +} + +function simpleCollision(entity, velocity) { + var _xcomp = velocity.x; + var _ycomp = velocity.y; + var _xsign = sign(_xcomp); + var _ysign = sign(_ycomp); + + var _repeat_amount = max(abs((_xcomp & ~0) + _xsign), abs((_ycomp & ~0) + _ysign)); + repeat (_repeat_amount) { + // X COMPONENT + if (_xcomp != 0) { + with (entity) { + var _collision = false; + var _coll_objects = tag_get_asset_ids("SolidTag", asset_object); + for (var i = 0; i < array_length(_coll_objects); ++i) { + if (place_meeting(x + _xsign, y, _coll_objects[i])) { _collision = true; } + } + } + if (!_collision) { + if (abs(_xcomp) >= 1) { // Subtract 1 + entity.x += _xsign; + _xcomp -= _xsign; + } else { // If _xcomp is fractional, subtract the entire _xcomp + entity.x += _xcomp; + _xcomp = 0; + } + } + } + + // Y COMPONENT + if (_ycomp != 0) { + with (entity) { + var _collision = false; + var _coll_objects = tag_get_asset_ids("SolidTag", asset_object); + for (var i = 0; i < array_length(_coll_objects); ++i) { + if (place_meeting(x, y + _ysign, _coll_objects[i])) { _collision = true; } + } + } + if (!_collision) { + if (abs(_ycomp) >= 1) { // Subtract 1 + entity.y += _ysign; + _ycomp -= _ysign; + } else { // If _xcomp is fractional, subtract the entire _ycomp + entity.y += _ycomp; + _ycomp = 0; + } + } + } + + // Early Exit + if ((_xcomp == 0 and _ycomp == 0) or (entity.x == entity.xprevious and entity.y == entity.yprevious)) { break; } + } +} \ No newline at end of file diff --git a/scripts/MovementSystem/MovementSystem.yy b/scripts/MovementSystem/MovementSystem.yy new file mode 100644 index 0000000..541c677 --- /dev/null +++ b/scripts/MovementSystem/MovementSystem.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Systems", + "path": "folders/ECS/Movement/Systems.yy", + }, + "resourceVersion": "1.0", + "name": "MovementSystem", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/NoMoveInputConsideration/NoMoveInputConsideration.gml b/scripts/NoMoveInputConsideration/NoMoveInputConsideration.gml new file mode 100644 index 0000000..b8c15af --- /dev/null +++ b/scripts/NoMoveInputConsideration/NoMoveInputConsideration.gml @@ -0,0 +1,5 @@ +function NoMoveInputConsideration() : IConsideration() constructor { + static evaluate = function() { + return !((InputManager.get_x() != 0) or (InputManager.get_y() != 0)); + } +} \ No newline at end of file diff --git a/scripts/NoMoveInputConsideration/NoMoveInputConsideration.yy b/scripts/NoMoveInputConsideration/NoMoveInputConsideration.yy new file mode 100644 index 0000000..cd94527 --- /dev/null +++ b/scripts/NoMoveInputConsideration/NoMoveInputConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Player", + "path": "folders/ECS/State Machine/Considerations/Player.yy", + }, + "resourceVersion": "1.0", + "name": "NoMoveInputConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/PlayerMoveSystem/PlayerMoveSystem.gml b/scripts/PlayerMoveSystem/PlayerMoveSystem.gml new file mode 100644 index 0000000..45ca29a --- /dev/null +++ b/scripts/PlayerMoveSystem/PlayerMoveSystem.gml @@ -0,0 +1,13 @@ +function PlayerMoveSystem(requirements) : ISystem(requirements) constructor { + static step = function() { + for (var i = 0; i < entity_count; ++i) { + var _e = entities[i]; + + var _input_dir = point_direction(0, 0, InputManager.get_x(), InputManager.get_y()); + if (_input_dir != undefined) { + var _velocity = component_get(_e, VelocityComponent); + _velocity.direction = _input_dir; + } + } + } +} \ No newline at end of file diff --git a/scripts/PlayerMoveSystem/PlayerMoveSystem.yy b/scripts/PlayerMoveSystem/PlayerMoveSystem.yy new file mode 100644 index 0000000..ca6d9b7 --- /dev/null +++ b/scripts/PlayerMoveSystem/PlayerMoveSystem.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Systems", + "path": "folders/ECS/Player/Systems.yy", + }, + "resourceVersion": "1.0", + "name": "PlayerMoveSystem", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/PlayerStateTags/PlayerStateTags.gml b/scripts/PlayerStateTags/PlayerStateTags.gml new file mode 100644 index 0000000..763fabc --- /dev/null +++ b/scripts/PlayerStateTags/PlayerStateTags.gml @@ -0,0 +1 @@ +function PlayerMoveTag() : IComponent() constructor { } \ No newline at end of file diff --git a/scripts/PlayerStateTags/PlayerStateTags.yy b/scripts/PlayerStateTags/PlayerStateTags.yy new file mode 100644 index 0000000..8f804b5 --- /dev/null +++ b/scripts/PlayerStateTags/PlayerStateTags.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Tags", + "path": "folders/ECS/Player/Tags.yy", + }, + "resourceVersion": "1.0", + "name": "PlayerStateTags", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/PreviousStateConsideration/PreviousStateConsideration.gml b/scripts/PreviousStateConsideration/PreviousStateConsideration.gml new file mode 100644 index 0000000..e9e0729 --- /dev/null +++ b/scripts/PreviousStateConsideration/PreviousStateConsideration.gml @@ -0,0 +1,14 @@ +function PreviousStateConsideration(state) : IConsideration() constructor { + required_components = [StateMachineComponent]; + self.state = state; + + static evaluate = function() { + var _fsm = component_get(owner, StateMachineComponent); + + if (_fsm.previous_state.name == state) { + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/scripts/PreviousStateConsideration/PreviousStateConsideration.yy b/scripts/PreviousStateConsideration/PreviousStateConsideration.yy new file mode 100644 index 0000000..7860d34 --- /dev/null +++ b/scripts/PreviousStateConsideration/PreviousStateConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "State Machine", + "path": "folders/ECS/State Machine/Considerations/State Machine.yy", + }, + "resourceVersion": "1.0", + "name": "PreviousStateConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/RandomTimerConsideration/RandomTimerConsideration.gml b/scripts/RandomTimerConsideration/RandomTimerConsideration.gml new file mode 100644 index 0000000..264e7c8 --- /dev/null +++ b/scripts/RandomTimerConsideration/RandomTimerConsideration.gml @@ -0,0 +1,19 @@ +/// @func RandomTimerConsideration(min_time, max_time, [in_frames]); +function RandomTimerConsideration(min_time, max_time, in_frames) : IConsideration() constructor { + self.min_time = (is_undefined(in_frames) or in_frames == false) ? min_time * game_get_speed(gamespeed_fps) : min_time; + self.max_time = (is_undefined(in_frames) or in_frames == false) ? max_time * game_get_speed(gamespeed_fps) : max_time; + time = random_range(self.min_time, self.max_time); + + static evaluate = function() { + if (time <= 0) { + return true; + } else { + --time; + return false; + } + } + + static reset = function() { + time = random_range(min_time, max_time); + } +} \ No newline at end of file diff --git a/scripts/RandomTimerConsideration/RandomTimerConsideration.yy b/scripts/RandomTimerConsideration/RandomTimerConsideration.yy new file mode 100644 index 0000000..bad1878 --- /dev/null +++ b/scripts/RandomTimerConsideration/RandomTimerConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Time", + "path": "folders/ECS/State Machine/Considerations/Time.yy", + }, + "resourceVersion": "1.0", + "name": "RandomTimerConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/ShadowComponent/ShadowComponent.gml b/scripts/ShadowComponent/ShadowComponent.gml new file mode 100644 index 0000000..f8103a7 --- /dev/null +++ b/scripts/ShadowComponent/ShadowComponent.gml @@ -0,0 +1,7 @@ +function ShadowComponent(width, height, offset_x, offset_y, color) : IComponent() constructor { + self.width = width; + self.height = height; + self.offset_x = is_undefined(offset_x) ? 0 : offset_x; + self.offset_y = is_undefined(offset_y) ? 0 : offset_y; + self.color = is_undefined(color) ? make_color_rgb(21, 19, 43) : color; +} \ No newline at end of file diff --git a/scripts/ShadowComponent/ShadowComponent.yy b/scripts/ShadowComponent/ShadowComponent.yy new file mode 100644 index 0000000..3a7ee2c --- /dev/null +++ b/scripts/ShadowComponent/ShadowComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/ECS/Rendering/Shadows/Components.yy", + }, + "resourceVersion": "1.0", + "name": "ShadowComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/ShadowSystem/ShadowSystem.gml b/scripts/ShadowSystem/ShadowSystem.gml new file mode 100644 index 0000000..23d351a --- /dev/null +++ b/scripts/ShadowSystem/ShadowSystem.gml @@ -0,0 +1,32 @@ +function ShadowSystem(requirements) : ISystem(requirements) constructor { + static shadow_surface = -1; + pausable(false); + + static draw = function() { + if (!surface_exists(shadow_surface)) { + shadow_surface = surface_create(surface_get_width(application_surface), surface_get_height(application_surface)); + } + + surface_set_target(shadow_surface); + draw_clear_alpha(c_black, 0.0); + for (var i = 0; i < entity_count; ++i) { + var _e = entities[i]; + + var _shadow = component_get(_e, ShadowComponent); + + var _x1 = _e.x - (_shadow.width * .5) + _shadow.offset_x; + var _y1 = _e.y - (_shadow.height * .5) + _shadow.offset_y; + var _x2 = _e.x + (_shadow.width * .5) + _shadow.offset_x; + var _y2 = _e.y + (_shadow.height * .5) + _shadow.offset_y; + + draw_set_color(_shadow.color); + draw_ellipse(_x1, _y1, _x2, _y2, false); + draw_set_color(c_white); + } + surface_reset_target(); + + draw_set_alpha(0.6); + draw_surface(shadow_surface, 0, 0); + draw_set_alpha(1.0); + } +} \ No newline at end of file diff --git a/scripts/ShadowSystem/ShadowSystem.yy b/scripts/ShadowSystem/ShadowSystem.yy new file mode 100644 index 0000000..9ad9a36 --- /dev/null +++ b/scripts/ShadowSystem/ShadowSystem.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Systems", + "path": "folders/ECS/Rendering/Shadows/Systems.yy", + }, + "resourceVersion": "1.0", + "name": "ShadowSystem", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/SolidTag/SolidTag.gml b/scripts/SolidTag/SolidTag.gml new file mode 100644 index 0000000..8976170 --- /dev/null +++ b/scripts/SolidTag/SolidTag.gml @@ -0,0 +1,3 @@ +function SolidTag() : IComponent() constructor { + +} \ No newline at end of file diff --git a/scripts/SolidTag/SolidTag.yy b/scripts/SolidTag/SolidTag.yy new file mode 100644 index 0000000..6dd5450 --- /dev/null +++ b/scripts/SolidTag/SolidTag.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Tags", + "path": "folders/ECS/Movement/Tags.yy", + }, + "resourceVersion": "1.0", + "name": "SolidTag", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/SpriteComponent/SpriteComponent.gml b/scripts/SpriteComponent/SpriteComponent.gml new file mode 100644 index 0000000..73833d9 --- /dev/null +++ b/scripts/SpriteComponent/SpriteComponent.gml @@ -0,0 +1,14 @@ +enum SpritePlaybackType { + ONCE, + LOOP, + PING_PONG, + FREEZE +} + +/// @func SpriteComponent(sprite_data, [playback_type], [playback_speed], [reset_index]); +function SpriteComponent(sprite_data, playback_type, playback_speed, reset_index) : IComponent() constructor { + self.sprite_data = sprite_data; + self.playback_type = (is_undefined(playback_type)) ? SpritePlaybackType.LOOP : playback_type; + self.playback_speed = (is_undefined(playback_speed)) ? 1 : playback_speed; + self.reset_index = (is_undefined(reset_index)) ? true : reset_index; +} \ No newline at end of file diff --git a/scripts/SpriteComponent/SpriteComponent.yy b/scripts/SpriteComponent/SpriteComponent.yy new file mode 100644 index 0000000..bc07607 --- /dev/null +++ b/scripts/SpriteComponent/SpriteComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/ECS/Rendering/Animation/Components.yy", + }, + "resourceVersion": "1.0", + "name": "SpriteComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/StateComponent/StateComponent.gml b/scripts/StateComponent/StateComponent.gml new file mode 100644 index 0000000..b442057 --- /dev/null +++ b/scripts/StateComponent/StateComponent.gml @@ -0,0 +1,185 @@ +/* +* Represents a state for an EntityStateMachine. The state contains any number of +* ComponentProviders which are used to add components to the entity when this state is entered. +*/ +function StateComponent(name) : IComponent() constructor { + self.name = name; // Name of the state + providers = {}; // Provides component data to generate components on enter + exit_providers = {}; // Provides component data to generate on exit + transitions = []; // Transition data to determine if we should transition to another state + + /// @func addComponent(type); + static addComponent = function(type) { + return new StateComponentMapping(self, type, providers); + } + + /// @func addExitComponent(type); + static addExitComponent = function(type) { + return new StateComponentMapping(self, type, exit_providers); + } + + /// @func getComponent(type); + static getComponent = function(type) { + return providers[$ type]; + } + + /// @func hasComponent(type); + static hasComponent = function(type) { + return providers[$ type] != undefined; + } + + /// @func addTransition(transition); + static addTransition = function(transition) { + array_push(transitions, transition); + return self; + } + + /// @func addTransitionExt(transition); + static addTransitionExt = function(transition) { + var _transition = new StateComponentTransition(self, transition.to_state); + array_copy(_transition.considerations, 0, transition.considerations, 0, array_length(transition.considerations)); + array_push(transitions, _transition); + return _transition; + } + + /// @func createTransition(to_state); + static createTransition = function(to_state) { + var _transition = new StateComponentTransition(self, to_state); + array_push(transitions, _transition); + return _transition; + } +} + +/* +* Used by the StateComponent to create the mappings of components to providers via a fluent interface. +*/ +function StateComponentMapping(creating_state, type, providers_struct) constructor { + self.creating_state = creating_state; + self.component_type = type; + self.providers_struct = providers_struct; + provider = undefined; + + // Default + static withType = function(type) { + __setProvider(new ComponentTypeProvider(type)); + return self; + } + + // Data gets reset on state changes + static withData = function(component) { + __setProvider(new ComponentDataProvider(component)); + return self; + } + + // Data does not get reset on state changes + static withSingleton = function(component) { + __setProvider(new ComponentSingletonProvider(component)); + return self; + } + + static __setProvider = function(provider) { + self.provider = provider; + providers_struct[$ component_type] = provider; + } + + static endComponent = function() { + var _creating_state = creating_state; + // REMOVE CIRCULAR REFERENCE + variable_struct_remove(self, "creating_state"); + return _creating_state; + } + + withType(type); +} + +/* +* This component provider always returns a new instance of a component. An instance +* is created when requested and is of the type passed in to the constructor. +*/ +function ComponentTypeProvider(type) constructor { + component_type = type; + + static getComponent = function() { + return new component_type(); + } + + static identifier = function() { + return component_type; + } +} + +function ComponentDataProvider(data) constructor { + self.data = data; + init_data = snap_deep_copy(data); + + static getComponent = function() { + var _names = variable_struct_get_names(data); + for (var i = 0; i < array_length(_names); i++) { + if (is_array(init_data[$ _names[i]])) { + var _init_data = []; + array_copy(_init_data, 0, init_data[$ _names[i]], 0, array_length(init_data[$ _names[i]])); + data[$ _names[i]] = _init_data; + } else if (is_struct(init_data[$ _names[i]])) { + var _init_data = snap_deep_copy(init_data[$ _names[i]]); + data[$ _names[i]] = _init_data; + } else { + data[$ _names[i]] = init_data[$ _names[i]]; + } + } + return data; + } + + static identifier = function() { + return undefined; + } +} + +function ComponentSingletonProvider(data) constructor { + self.data = data; + + static getComponent = function() { + return data; + } + + static identifier = function() { + return data; + } +} + +function StateComponentTransition(creating_state, to_state) constructor { + self.creating_state = creating_state; + self.to_state = to_state; + considerations = []; + bypass_considerations = []; + + /// @func addConsideration(consideration); + static addConsideration = function(consideration) { + array_push(considerations, consideration); + return self; + } + + /// @func addBypassConsideration(consideration); + static addBypassConsideration = function(consideration) { + array_push(bypass_considerations, consideration); + return self; + } + + static endTransition = function() { + var _creating_state = creating_state; + // REMOVE CIRCULAR REFERENCE + if (creating_state != undefined) { + delete creating_state; + } + + return _creating_state; + } +} + +function IConsideration() constructor { + owner = other.id; + required_components = undefined; + + static evaluate = undefined; + static reset = undefined; + static debugDraw = undefined; +} \ No newline at end of file diff --git a/scripts/StateComponent/StateComponent.yy b/scripts/StateComponent/StateComponent.yy new file mode 100644 index 0000000..b4b7c82 --- /dev/null +++ b/scripts/StateComponent/StateComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/ECS/State Machine/Components.yy", + }, + "resourceVersion": "1.0", + "name": "StateComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/StateMachineComponent/StateMachineComponent.gml b/scripts/StateMachineComponent/StateMachineComponent.gml new file mode 100644 index 0000000..cb77c9c --- /dev/null +++ b/scripts/StateMachineComponent/StateMachineComponent.gml @@ -0,0 +1,29 @@ +/* +* This is a state machine for an entity. The state machine manages a set of states, each of which +* has a set of component providers. When the state machine system changes the state, it removes +* components associated with the previous state and adds components associated with the new state. +*/ +function StateMachineComponent() : IComponent() constructor { + states = {}; + current_state = undefined; + previous_state = undefined; + intial_state = undefined; + time = 0; + previous_time = 0; + + static addState = function(name, state) { + states[$ name] = state; + return self; + } + + static createState = function(name) { + var _state = new StateComponent(name); + states[$ name] = _state; + return _state; + } + + static setInitialState = function(name) { + initial_state = states[$ name]; + return self; + } +} \ No newline at end of file diff --git a/scripts/StateMachineComponent/StateMachineComponent.yy b/scripts/StateMachineComponent/StateMachineComponent.yy new file mode 100644 index 0000000..a4b5940 --- /dev/null +++ b/scripts/StateMachineComponent/StateMachineComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/ECS/State Machine/Components.yy", + }, + "resourceVersion": "1.0", + "name": "StateMachineComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/StateMachineSystem/StateMachineSystem.gml b/scripts/StateMachineSystem/StateMachineSystem.gml new file mode 100644 index 0000000..1c8afbe --- /dev/null +++ b/scripts/StateMachineSystem/StateMachineSystem.gml @@ -0,0 +1,141 @@ +function StateMachineSystem(requirements) : ISystem(requirements) constructor { + static step = function() { + for (var i = 0; i < array_length(entities); ++i) { + var _entity = entities[i]; + var _sm = component_get(entities[i], StateMachineComponent); + ++_sm.time; + + // INIT + if (_sm.current_state == undefined) { + __changeState(_entity, _sm, _sm.initial_state); + } + + // STATE TRANSITIONS & CONSIDERATIONS + var _transitions = _sm.current_state.transitions; + for (var j = 0; j < array_length(_transitions); ++j) { + var _transition = _transitions[j]; + + // CHECK BYPASS CONSIDERATIONS + var _bypass_considerations = _transition.bypass_considerations; + var _bypass_passed = false; + for (var k = 0; k < array_length(_bypass_considerations); ++k) { + var _bypass = _bypass_considerations[k]; + + // ARRAY BYPASSES?? + + if (__considerationRequirementsMet(_entity, _bypass)) { + _bypass_passed = _bypass.evaluate(); + if (_bypass_passed) { break; } + } + } + if (_bypass_passed) { + __changeState(_entity, _sm, _sm.states[$ _transition.to_state]); + break; + } + + // CHECK CONSIDERATIONS + var _considerations = _transition.considerations; + var _considerations_passed = true; + for (var k = 0; k < array_length(_considerations); ++k) { + var _consideration = _considerations[k]; + + if (is_array(_consideration)) { + var _or_considerations_passed = false; + for (var l = 0; l < array_length(_consideration); ++l) { + var _or_consideration = _consideration[l]; + if (__considerationRequirementsMet(_entity, _or_consideration.required_components)) { + _or_considerations_passed = _or_considerations_passed or _or_consideration.evaluate(); + if (_or_considerations_passed) { break; } + } + } + _considerations_passed = _considerations_passed and _or_considerations_passed; + } else { + if (__considerationRequirementsMet(_entity, _consideration)) { + _considerations_passed = _considerations_passed and _consideration.evaluate(); + } + } + } + if (_considerations_passed) { + __changeState(_entity, _sm, _sm.states[$ _transition.to_state]); + break; + } + } + } + } + + static __considerationRequirementsMet = function(entity, requirements) { + for (var i = 0; i < array_length(requirements); ++i) { + if (component_exists(entity, requirements[i]) == false) { return false; } + } + return true; + } + + static __changeState = function(entity, state_machine, new_state) { + state_machine.previous_time = state_machine.time; + state_machine.time = 0; + var _to_add = {}; + + if (state_machine.current_state != undefined) { + // CONSTRUCT WHAT WE WANT TO ADD TO THE ENTITY + var _new_provider_names = variable_struct_get_names(new_state.providers); + for (var i = 0; i < array_length(_new_provider_names); ++i) { + var _t = _new_provider_names[i]; + var _type = real(_t); + _to_add[$ _type] = new_state.providers[$ _type]; + } + + // REMOVE COMPONENTS FROM PREVIOUS STATE + var _current_provider_names = variable_struct_get_names(state_machine.current_state.providers); + for (var i = 0; i < array_length(_current_provider_names); ++i) { + var _t = _current_provider_names[i]; + var _type = real(_t); + var _other = _to_add[$ _type]; + + component_remove(entity, _type); + } + + // EXIT COMPONENTS + var _current_state = state_machine.current_state; + var _exit_provider_names = variable_struct_get_names(_current_state.exit_providers); + for (var i = 0; i < array_length(_exit_provider_names); ++i) { + var _t = _exit_provider_names[i]; + var _type = real(_t); + _to_add[$ _type] = _current_state.exit_providers[$ _type]; + } + + // LOOP OVER CONSIDERATIONS AND RESET IF NEEDED + var _transitions = _current_state.transitions; + for (var i = 0; i < array_length(_transitions); ++i) { + __resetConsiderations(_transitions[i].considerations); + } + + state_machine.previous_state = state_machine.current_state; + } else { + _to_add = new_state.providers; + state_machine.previous_state = new_state; + } + + // ADD COMPONENTS FOR THE STATE TO THE ENTITY + var _to_add_names = variable_struct_get_names(_to_add); + for (var i = 0; i < array_length(_to_add_names); ++i) { + var _t = _to_add_names[i]; + var _type = real(_t); + component_add(entity, _to_add[$ _type].getComponent()); + } + + state_machine.current_state = new_state; + } + + static __resetConsiderations = function(considerations) { + for (var i = 0; i < array_length(considerations); ++i) { + var _consideration = considerations[i]; + if (is_array(_consideration)) { + __resetConsiderations(_consideration); + } else { + if (_consideration.reset != undefined) { + _consideration.reset(); + } + } + } + } +} \ No newline at end of file diff --git a/scripts/StateMachineSystem/StateMachineSystem.yy b/scripts/StateMachineSystem/StateMachineSystem.yy new file mode 100644 index 0000000..023e3bd --- /dev/null +++ b/scripts/StateMachineSystem/StateMachineSystem.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Systems", + "path": "folders/ECS/State Machine/Systems.yy", + }, + "resourceVersion": "1.0", + "name": "StateMachineSystem", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/TimerConsideration/TimerConsideration.gml b/scripts/TimerConsideration/TimerConsideration.gml new file mode 100644 index 0000000..c15f0e9 --- /dev/null +++ b/scripts/TimerConsideration/TimerConsideration.gml @@ -0,0 +1,18 @@ +/// @func TimerConsideration(time, [in_frames]); +function TimerConsideration(time, in_frames) : IConsideration() constructor { + self.set_time = (is_undefined(in_frames) or in_frames == false) ? time * game_get_speed(gamespeed_fps) : time; + self.time = set_time; + + static evaluate = function() { + if (time <= 0) { + return true; + } else { + --time; + return false; + } + } + + static reset = function() { + time = set_time; + } +} \ No newline at end of file diff --git a/scripts/TimerConsideration/TimerConsideration.yy b/scripts/TimerConsideration/TimerConsideration.yy new file mode 100644 index 0000000..cc8e248 --- /dev/null +++ b/scripts/TimerConsideration/TimerConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Time", + "path": "folders/ECS/State Machine/Considerations/Time.yy", + }, + "resourceVersion": "1.0", + "name": "TimerConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/UnpausableTag/UnpausableTag.gml b/scripts/UnpausableTag/UnpausableTag.gml new file mode 100644 index 0000000..212d397 --- /dev/null +++ b/scripts/UnpausableTag/UnpausableTag.gml @@ -0,0 +1,3 @@ +function UnpausableTag() : IComponent() constructor { + +} \ No newline at end of file diff --git a/scripts/UnpausableTag/UnpausableTag.yy b/scripts/UnpausableTag/UnpausableTag.yy new file mode 100644 index 0000000..9348c5f --- /dev/null +++ b/scripts/UnpausableTag/UnpausableTag.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Tags", + "path": "folders/ECS/Rendering/Animation/Tags.yy", + }, + "resourceVersion": "1.0", + "name": "UnpausableTag", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/Vector2/Vector2.gml b/scripts/Vector2/Vector2.gml new file mode 100644 index 0000000..b081455 --- /dev/null +++ b/scripts/Vector2/Vector2.gml @@ -0,0 +1,247 @@ +global.zero_vector = new Vector2(0, 0); + +/// Mostly ported from: https://github.com/godotengine/godot/blob/master/core/math/vector2.cpp +/// @func Vector2(x/speed, y/direction, non-comp?) +/// @param x/speed +/// @param y/direction +/// @param [non-comp?] +/// @return Vector2 [Vector2] +function Vector2(x, y, non_comp) constructor { + if (non_comp == true) { + self.x = lengthdir_x(x, y); + self.y = lengthdir_y(x, y); + } else { + self.x = x; + self.y = y; + } + + /// @desc Returns a new vector with all components in absolute values. + static absv = function() { + return (new Vector2(abs(x), abs(y))); + } + + /// @param {bool} + /// @desc Returns this vector's angle with respect to the X axis. + static angle = function() { + //return (radians) ? arctan2(y, x) : darctan2(y, x); + return point_direction(0, 0, x, y); + } + + /// @param vector2 + /// @param {bool} return_radians + /// @desc Returns the angle to the given vector. + static angle_to = function(vector2, radians) { + var _check = instanceof(vector2); + if (is_string(_check)) { + return (radians) ? arctan2(cross(vector2), dot(vector2)) : darctan2(cross(vector2), dot(vector2)); + } else { + return undefined; + } + } + + /// @param vector2 + /// @param {bool} return_radians + /// @desc Returns the angle between the line connecting the two points and the X axis. + static angle_to_point = function(vector2, radians) { + var _check = instanceof(vector2); + if (is_string(_check)) { + return (radians) ? arctan2(y - vector2.y, x - vector2.x) : darctan2(y - vector2.y, x - vector2.x); + } else { + return undefined; + } + } + + /// @desc Returns the length (magnitude) of this vector. + static length = function() { + return sqrt(x * x + y * y); + } + + /// @desc Returns the squared length (squared magnitude) of this vector. Faster than length(). + static length_squared = function() { + return (x * x + y * y); + } + + /// @desc Normalizes the vector's components to be between 0 and 1. + static normalize = function() { + var _l = length_squared(); + if (_l != 0) { + _l = sqrt(_l); + x = x / _l; + y = y / _l; + } + } + + /// @desc Returns the vector scaled to unit length. + static normalized = function() { + var _vector = new Vector2(self.x, self.y); + _vector.normalize(); + return _vector; + } + + /// @param normal + /// @desc Returns the reflected vector based on the normal vector + static reflect = function(normal) { + var _dn = self.dot(normal); + var _mult = normal.multiply(2 * _dn); + return subtract(_mult); + } + + /// @param vector + /// @desc Returns a vector from the two vectors added + static add = function(vector) { + return new Vector2(self.x + vector.x, self.y + vector.y); + } + + /// @param scalar + static multiply = function(scalar) { + return new Vector2(self.x * scalar, self.y * scalar); + } + + /// @param vector + /// @desc Returns a vector from the two vectors subtracted + static subtract = function(vector) { + return new Vector2(self.x - vector.x, self.y - vector.y); + } + + /// @desc Returns true if the vector is normalized, and false otherwise. + static is_normalized = function() { + var _epsilon = 0.0001; + var _difference = abs(length_squared() - 1.0); + return (_difference < _epsilon); + } + + /// @param vector2 + /// @desc Returns the distance between the two vectors. + static distance_to = function(vector2) { + var _check = instanceof(vector2); + if (is_string(_check)) { + return sqrt((x - vector2.x) * (x - vector2.x) + (y - vector2.y) * (y - vector2.y)); + } else { + return undefined; + } + } + + /// @param vector2 + /// @desc Returns the squared distance between the two vectors. Faster than distance_to(). + static distance_to_squared = function(vector2) { + var _check = instanceof(vector2); + if (is_string(_check)) { + return ((x - vector2.x) * (x - vector2.x) + (y - vector2.y) * (y - vector2.y)); + } else { + return undefined; + } + } + + /// @param vector2 + /// @desc Returns the dot product. + static dot = function(vector2) { + return (x * vector2.x + y * vector2.y); + } + + /// @param vector2 + /// @desc Returns the cross product. + static cross = function(vector2) { + return (x * vector2.x - y * vector2.y); + } + + /// @desc Returns the vector with each component set to one or negative one, depending on the signs of the components, or zero if the component is zero. + static signv = function() { + return (new Vector2(sign(x), sign(y))); + } + + /// @desc Returns the vector with all components rounded down. + static floorv = function() { + return (new Vector2(floor(x), floor(y))); + } + + /// @desc Returns the vector with all components rounded up. + static ceilv = function() { + return (new Vector2(ceil(x), ceil(x))); + } + + /// @desc Returns the vector with all components rounded. + static roundv = function() { + return (new Vector2(round(x), round(y))); + } + + /// @param new_direction + /// @desc Returns the vector rotated by the amount supplied in degrees. + static rotated = function(new_direction) { + return new Vector2(lengthdir_x(length(), new_direction), lengthdir_y(length(), new_direction)); + } + + /// @param by_amount + /// @param {bool} by_radians? + /// @desc Returns the vector rotated by the amount supplied in degrees or radians. + static rotated2 = function(by_amount, radians) { + var _sine = (radians) ? sin(by_amount) : dsin(by_amount); + var _cosi = (radians) ? cos(by_amount) : dcos(by_amount); + return (new Vector2(x * _cosi - y * _sine, x * _sine + y * _cosi)); + } + + /// @param vector2 + /// @desc Returns the vector projected onto the given vector. + static project = function(vector2) { + return (vector2 * (dot(vector2) / vector2.length_squared())); + } + + /// @param vector2 + /// @desc Returns this vector with each component snapped to the nearest multiple of step. + static snapped = function(vector2) { + return new Vector2(floor(x / vector2.x + 0.5) * vector2.x, floor(y / vector2.y + 0.5) * vector2.y); + } + + /// @param max_length + /// @desc Returns the vector with a maximum length by limiting its length to length. + static clamped = function(max_length) { + var _length = length(); + var _vector = self; + if (_length > 0 and max_length < _length) { + _vector.x /= _length; + _vector.y /= _length; + _vector.x *= max_length; + _vector.y *= max_length; + } + + return _vector; + } + + /// @param vector2 + /// @param delta + /// @desc Moves the vector toward vector2 by the fixed delta amount. + static move_toward = function(vector2, delta) { + var _vector = self; + var _epsilon = 0.0001; + var _vector_delta = new Vector2(vector2.x - _vector.x, vector2.y - _vector.y); + var _length = _vector_delta.length(); + + if (_length <= delta or _length < _epsilon) { + return new Vector2(vector2.x, vector2.y); + } else { + return new Vector2(_vector.x + _vector_delta.x / _length * delta, _vector.y + _vector_delta.y / _length * delta); + } + } + + /// @param target_direction + /// @param delta + /// @desc Moves the vector's direction towards the given direction by the fixed delta amount. + static turn_toward = function(target_direction, delta) { + var _direction = point_direction(0, 0, x, y); + _direction += median(-delta, delta, angle_difference(target_direction, _direction)); + _direction = abs(_direction + 360) mod 360; + return new Vector2(lengthdir_x(length(), _direction), lengthdir_y(length(), _direction)); + } + + /// @param vector2 + /// @desc Returns true if this vector and v are approximately equal. + static is_approx_equal = function(vector2) { + var _epsilon = 0.0001; + var _x_difference= abs(x - vector2.x); + var _y_difference = abs(y - vector2.y); + return (_x_difference < _epsilon and _y_difference < _epsilon); + } + + static toString = function() { + return ("{" + string(x) + ", " + string(y) + "}"); + } +} \ No newline at end of file diff --git a/scripts/Vector2/Vector2.yy b/scripts/Vector2/Vector2.yy new file mode 100644 index 0000000..f88836d --- /dev/null +++ b/scripts/Vector2/Vector2.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Helper Functions", + "path": "folders/ECS/_Internal/Helper Functions.yy", + }, + "resourceVersion": "1.0", + "name": "Vector2", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/VelocityComponent/VelocityComponent.gml b/scripts/VelocityComponent/VelocityComponent.gml new file mode 100644 index 0000000..4f019d4 --- /dev/null +++ b/scripts/VelocityComponent/VelocityComponent.gml @@ -0,0 +1,5 @@ +/// @func VelocityComponent(speed, [direction]) +function VelocityComponent(speed, direction) : IComponent() constructor { + self.speed = speed; + self.direction = is_undefined(direction) ? 0 : direction; +} \ No newline at end of file diff --git a/scripts/VelocityComponent/VelocityComponent.yy b/scripts/VelocityComponent/VelocityComponent.yy new file mode 100644 index 0000000..a744f7f --- /dev/null +++ b/scripts/VelocityComponent/VelocityComponent.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Components", + "path": "folders/ECS/Movement/Components.yy", + }, + "resourceVersion": "1.0", + "name": "VelocityComponent", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/WallCollideConsideration/WallCollideConsideration.gml b/scripts/WallCollideConsideration/WallCollideConsideration.gml new file mode 100644 index 0000000..64ce394 --- /dev/null +++ b/scripts/WallCollideConsideration/WallCollideConsideration.gml @@ -0,0 +1,8 @@ +function WallCollideConsideration() : IConsideration() constructor{ + required_components = [MoveComponent]; + + static evaluate = function() { + var _move = component_get(owner, MoveComponent); + return _move.collided; + } +} \ No newline at end of file diff --git a/scripts/WallCollideConsideration/WallCollideConsideration.yy b/scripts/WallCollideConsideration/WallCollideConsideration.yy new file mode 100644 index 0000000..d3b68c0 --- /dev/null +++ b/scripts/WallCollideConsideration/WallCollideConsideration.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Movement", + "path": "folders/ECS/State Machine/Considerations/Movement.yy", + }, + "resourceVersion": "1.0", + "name": "WallCollideConsideration", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/__ComponentFunctions/__ComponentFunctions.gml b/scripts/__ComponentFunctions/__ComponentFunctions.gml new file mode 100644 index 0000000..9525124 --- /dev/null +++ b/scripts/__ComponentFunctions/__ComponentFunctions.gml @@ -0,0 +1,68 @@ +function component_add(entity, component) { + // ADD COMPONENT DATA TO ENTITY + if (is_array(component)) { + for (var i = 0; i < array_length(component); i++) { + var _index = asset_get_index(instanceof(component[i])); + entity.__components[$ _index] = component[i]; + // SEND MESSAGE TO SYSTEMS THAT THIS ENTITY HAS CHANGED + broadcast_channel(_index, CH_ENTITY_ADD, entity); + asset_add_tags(entity, instanceof(component[i]), asset_object); + } + } else { + var _index = asset_get_index(instanceof(component)); + entity.__components[$ _index] = component; + // SEND MESSAGE TO SYSTEMS THAT THIS ENTITY HAS CHANGED + broadcast_channel(_index, CH_ENTITY_ADD, entity); + asset_add_tags(entity, instanceof(component), asset_object); + } +} + +function component_get(entity, component_name) { + if (component_name == all) { + return entity.__components; + } else { + return entity.__components[$ component_name]; + } +} + +function component_remove(entity, component_name) { + if (component_name == all) { + var _names = variable_struct_get_names(entity.__components); + for (var i = 0; i < array_length(_names); i++) { + asset_remove_tags(entity, script_get_name(_names[i]), asset_object); + // SEND MESSAGE TO SYSTEMS THAT THIS ENTITY HAS CHANGED + broadcast_channel(_names[i], CH_ENTITY_REMOVE, entity); + delete entity.__components[$ _names[i]]; + } + entity.__components = {}; + } else if (is_array(component_name)) { + for (var i = 0; i < array_length(component_name); i++) { + asset_remove_tags(entity, script_get_name(component_name[i]), asset_object); + if (variable_struct_exists(entity.__components, component_name[i])) { + // SEND MESSAGE TO SYSTEMS THAT THIS ENTITY HAS CHANGED + broadcast_channel(component_name[i], CH_ENTITY_REMOVE, entity); + delete entity.__components[$ component_name[i]]; + } + } + } else { + asset_remove_tags(entity, script_get_name(component_name), asset_object); + if (variable_struct_exists(entity.__components, component_name)) { + // SEND MESSAGE TO SYSTEMS THAT THIS ENTITY HAS CHANGED + broadcast_channel(component_name, CH_ENTITY_REMOVE, entity); + delete entity.__components[$ component_name]; + variable_struct_remove(entity.__components, component_name); + } + } +} + +function component_exists(entity, component) { + if (variable_instance_exists(entity, "__components")) { + return variable_struct_exists(entity.__components, component); + } else { + return false; + } +} + +function IComponent() constructor { + debug = false; +} \ No newline at end of file diff --git a/scripts/__ComponentFunctions/__ComponentFunctions.yy b/scripts/__ComponentFunctions/__ComponentFunctions.yy new file mode 100644 index 0000000..98686e2 --- /dev/null +++ b/scripts/__ComponentFunctions/__ComponentFunctions.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Component", + "path": "folders/ECS/_Internal/Component.yy", + }, + "resourceVersion": "1.0", + "name": "__ComponentFunctions", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/__EntityFunctions/__EntityFunctions.gml b/scripts/__EntityFunctions/__EntityFunctions.gml new file mode 100644 index 0000000..1ae8fe3 --- /dev/null +++ b/scripts/__EntityFunctions/__EntityFunctions.gml @@ -0,0 +1,3 @@ +function IEntity() constructor { + +} \ No newline at end of file diff --git a/scripts/__EntityFunctions/__EntityFunctions.yy b/scripts/__EntityFunctions/__EntityFunctions.yy new file mode 100644 index 0000000..efeda17 --- /dev/null +++ b/scripts/__EntityFunctions/__EntityFunctions.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Entity", + "path": "folders/ECS/_Internal/Entity.yy", + }, + "resourceVersion": "1.0", + "name": "__EntityFunctions", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/__NotificationSystem/__NotificationSystem.gml b/scripts/__NotificationSystem/__NotificationSystem.gml new file mode 100644 index 0000000..de8a5c4 --- /dev/null +++ b/scripts/__NotificationSystem/__NotificationSystem.gml @@ -0,0 +1,379 @@ +/** +* GMS 2.3+ NotificationSystem | v1.2.4 +* +* +* Struct(s): +* > NotificationSystem() +* > Receiver([subscribe]) +* - add(message, [callback]) +* - on(message, [callback]) +* - remove(message) +* +* +* Function(s): +* > channel_exists(channel) +* > log_channels() +* > subscribe([id, channel]) +* > unsubscribe([id, channel]) +* > broadcast(message, [callback, data]) +* > broadcast_channel(message, channel, [callback, data]) +* +* +* Author: Lars Andersson | @babaganosch +* | github.com/babaganosch/NotificationSystem +*/ +global.__notifications__ = new NotificationSystem(); +#macro __NOTIFICATIONS_SAFE true + +/// @struct NotificationSystem() +function NotificationSystem() constructor { + + _subscribers = []; + _channels = {}; + + /// @param {string} channel Name of the channel + /// @param {real} id Id of the instance to subscribe + /// @returns N/A + static __subscribe_channel__ = function(_channel, _id) { + + if (is_array(_channel)) + { + for (var _i = 0; _i < array_length(_channel); _i++) + { + __subscribe_channel__(_channel[_i], _id); + } + return; + } + + if (_channel == global) { + __subscribe__(_id); + return; + } + + var _list = variable_struct_get(_channels, _channel); + if (is_undefined(_list)) variable_struct_set(_channels, _channel, [ _id ]); + else + { + var _size = array_length(_list); + for (var _i = 0; _i < _size; _i++) + { + if (_list[_i] == _id) return; + } + _list[_size] = _id; + variable_struct_set(_channels, _channel, _list); + } + } + + /// @param {real} id Id of the instance to subscribe + /// @returns N/A + static __subscribe__ = function(_id) { + var _size = array_length(_subscribers); + for (var _i = 0; _i < _size; _i++) + if (_subscribers[_i] == _id) return; + _subscribers[_size] = _id; + } + + /// @param {real} id Id of the instance to unsubscribe + /// @returns N/A + static __unsubscribe__ = function(_id) { + var _newSubscribers = [], _j = 0; + for (var _i = 0; _i < array_length(_subscribers); _i++) + { + if (_subscribers[_i] != _id) + { + _newSubscribers[_j++] = _subscribers[_i]; + } + } + _subscribers = _newSubscribers; + + var _nameList = variable_struct_get_names(_channels); + for (var _i = 0; _i < array_length(_nameList); _i++) + { + var _list = variable_struct_get(_channels, _nameList[_i]); + var _newList = [], _z = 0; + for (var _j = 0; _j < array_length(_list); _j++) + { + if (_list[_j] != _id) + { + _newList[_z++] = _list[_j]; + } + } + variable_struct_set(_channels, _nameList[_i], _newList); + } + } + + /// @param {string} channel Name of the channel + /// @param {real} id Id of the instance to unsubscribe + /// @returns N/A + static __unsubscribe_channel__ = function(_channel, _id) { + if (is_array(_channel)) + { + for (var _i = 0; _i < array_length(_channel); _i++) + { + __unsubscribe_channel__(_channel[_i], _id); + } + return; + } + + if (_channel == global) { + __unsubscribe__(_id); + return; + } + + var _list = variable_struct_get(_channels, _channel); + if (is_undefined(_list)) return; + + var _newList = [], _j = 0; + for (var _i = 0; _i < array_length(_list); _i++) + { + if (_list[_i] != _id) + { + _newList[_j++] = _list[_i]; + } + } + variable_struct_set(_channels, _channel, _newList); + if (array_length(variable_struct_get(_channels, _channel)) == 0) { + variable_struct_remove(_channels, _channel); + } + } + + /// @param {enum} message Message to broadcast to the receivers + /// @param {string} channel Name of the channel + /// @param {func} callback Additional callback + /// @param {any} data Data given to callback on receiver side + /// @returns N/A + static __broadcast__ = function(_msg, _channel, _cb, _data) { + if (is_array(_channel)) { + for (var _i = 0; _i < array_length(_channel); _i++) { + __broadcast__(_msg, _channel[_i], _cb, _data); + } + return; + } + + var _list; + if (is_string(_channel)) + { + _list = variable_struct_get(_channels, _channel); + if (is_undefined(_list)) + { + var _error_msg = "Channel '" + _channel + "' does not exist!"; + if (__NOTIFICATIONS_SAFE) show_error(_error_msg, true); + else show_debug_message(_error_msg); + } + } else + { + _list = _subscribers; + } + + for (var _i = 0; _i < array_length(_list); _i++) + { + if (instance_exists(_list[_i]) && + variable_instance_exists(_list[_i], "__notificationsReceiver__")) + _list[_i].__notificationsReceiver__.__receive__(_msg, _channel, _cb, _data); + } + } + + /// @param {array} array Array to iterate + /// @returns {string} + static __log_array_contents__ = function(_array) { + var _len = array_length(_array); + var _string = string(_len) + " intsances [ "; + for (var _i = 0; _i < _len; _i++) + { + if (_i != 0) _string += ", "; + _string += string(object_get_name(_array[_i].object_index)) + " " + string(_array[_i].id); + } + _string += " ]"; + return _string; + } + + /// @returns N/A + static __log_channels__ = function() { + show_debug_message(""); + show_debug_message("-- SUBSCRIBERS --"); + show_debug_message("no channel:" + __log_array_contents__(_subscribers)); + var _names = variable_struct_get_names(_channels); + for (var _i = 0; _i < array_length(_names); _i++) + { + var _list = variable_struct_get(_channels, _names[_i]); + var _string = _names[_i] + ": " + __log_array_contents__(_list); + show_debug_message(_string); + } + show_debug_message(""); + } + + /// @param {string} channel Name of the channel to check for + /// @returns {bool} + static __channel_exists__ = function(_channel) { + return !is_undefined(variable_struct_get(_channels, _channel)); + } +} + +/// @func channel_exists(channel) +/// @param {string} channel Name of the channel to check for +/// @returns {bool} +function channel_exists(_channel) { + return global.__notifications__.__channel_exists__(_channel); +} + +/// @func log_channels() +/// @returns N/A +function log_channels() { + global.__notifications__.__log_channels__(); +} + +/// @func subscribe([id, channel]) +/// @param {real} [id] Id of the instance to subscribe | Default: id of the caller +/// @param {string} [channel] Name of the channel | Default: no channel +/// @returns N/A +function subscribe(_id, _channel) { + if (is_undefined(argument[0])) _id = self; + else if (is_string(argument[0]) || is_array(argument[0]) || argument[0] == global) + { + _channel = _id; + _id = self; + } + + if (!is_undefined(_channel) and _channel != global) { + global.__notifications__.__subscribe_channel__(_channel, _id); + } else { + global.__notifications__.__subscribe__(_id); + } +} + +/// @func unsubscribe([id, channel]) +/// @param {real} [id] Id of the instance to unsubscribe | Default: id of the caller +/// @param {string} [channel] Name of the channel | Default: no channel +/// @returns N/A +function unsubscribe(_id, _channel) { + if (is_undefined(argument[0])) _id = self; + else if (is_string(argument[0]) || is_array(argument[0]) || argument[0] == global) + { + _channel = _id; + _id = self; + } + + if (!is_undefined(_channel) and _channel != global) { + global.__notifications__.__unsubscribe_channel__(_channel, _id); + } else { + global.__notifications__.__unsubscribe__(_id); + } +} + +/// @func broadcast(message, [callback, data]) +/// @param {enum} message Message to broadcast to the receivers +/// @param {func} [callback] Callback function | Default: undefined +/// @param {any} [data] Data given to callback on receiver side | Default: -1 +/// @returns N/A +function broadcast(_msg, _cb, _data) { + broadcast_channel(argument[0], global, _cb, _data); +} + +/// @func broadcast_channel(message, channel, [callback, data]) +/// @param {enum} message Message to broadcast to the receivers +/// @param {array/string} channel Name(s) of the channel +/// @param {func} [callback] Callback function | Default: undefined +/// @param {any} [data] Data given to callback on receiver side | Default: -1 +/// @returns N/A +function broadcast_channel(_msg, _channel, _cb, _data) { + + if (is_undefined(_data)) _data = -1; + if (!is_undefined(_cb) && !is_method(_cb)) + { + _data = _cb; + _cb = undefined; + } + global.__notifications__.__broadcast__(argument[0], _channel, _cb, _data); +} + + +/// @struct Receiver([subscribe]) +/// @param {bool|string} [subscribe] Auto subscribe | Default: true +function Receiver(_sub) constructor { + + _events = []; + _size = 0; + _parent = other.id; + + if (variable_instance_exists(_parent, "__notificationsReceiver__")) { + var _message = "-- WARNING --\nObject " + string(object_get_name(other.object_index) + ": Notification receiver already exists."); + show_error(_message, true); + } + variable_instance_set(_parent, "__notificationsReceiver__", self); + + if (!is_undefined(_sub)) + { + if (is_string(_sub) || is_array(_sub) || _sub == global) + subscribe(_parent, argument[0]); + } else + { + subscribe(_parent); + } + + /// @func add(message, [channel, callback]) + /// @param {enum} message Message to listen for + /// @param {string} [channel] The channel to listen on + /// @param {func} [callback] Callback function to run when message received + /// @returns N/A + static add = function(_event, _channel, _cb) { + if (is_method(_channel)) { + _cb = _channel; + _channel = undefined; + } + _events[_size] = { + event: argument[0], + channel: _channel, + callback: _cb + } + _size++; + } + + /// @func on(message, [channel, callback]) + /// @param {enum} message Message to listen for + /// @param {string} [channel] The channel to listen on + /// @param {func} [callback] Callback function to run when message received + /// @returns N/A + static on = function(_event, _channel, _cb) { + add(_event, _channel, _cb); + } + + /// @func remove(message, [trigger]) + /// @param {enum} message Message to stop listening for + /// @param {bool} [trigger] Run callback once before deletion | Default: false + /// @returns N/A + static remove = function(_event, _trigger) { + var _newEvents = []; + var _j = 0; + for (var _i = 0; _i < _size; _i++) + { + if (_events[_i].event != _event) + { + _newEvents[_j] = _events[_i]; + _j++; + } else + { + if (!is_undefined(_trigger) && argument[1]) _events[_i].callback(); + } + } + _events = _newEvents; + _size = _j; + } + + /// @param {enum} message Message to receive + /// @param {string} channel Channel the msg was sent through + /// @param {func} callback Additional callback to run + /// @param {any} data Data given to callback on receiver side + /// @returns N/A + static __receive__ = function(_msg, _channel, _cb, _data) { + for (var _i = 0; _i < _size; _i++) + { + if (_events[_i].event == _msg && + (_events[_i].channel == _channel || is_undefined(_events[_i].channel))) + { + var _fn = _events[_i].callback; + if (!is_undefined(_fn)) _fn(_data); + if (!is_undefined(_cb)) method(_parent, _cb)(); + } + } + } +} diff --git a/scripts/__NotificationSystem/__NotificationSystem.yy b/scripts/__NotificationSystem/__NotificationSystem.yy new file mode 100644 index 0000000..19bcd18 --- /dev/null +++ b/scripts/__NotificationSystem/__NotificationSystem.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "NotificationSystem", + "path": "folders/THIRD PARTY HELPERS/NotificationSystem.yy", + }, + "resourceVersion": "1.0", + "name": "__NotificationSystem", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/__SystemFunctions/__SystemFunctions.gml b/scripts/__SystemFunctions/__SystemFunctions.gml new file mode 100644 index 0000000..4af23e4 --- /dev/null +++ b/scripts/__SystemFunctions/__SystemFunctions.gml @@ -0,0 +1,106 @@ +function ISystem(requirements) constructor { + self.__requirements = requirements; + self.__pausable = true; + + self.name = instanceof(self); + self.entities = []; + self.entity_count = 0; + self.manager = other.id; + + debug = false; + + if (requirements != undefined) { + // SET UP UPDATE MESSAGES + if (is_array(requirements)) { + for (var i = 0; i < array_length(requirements); ++i) { + manager.system_updater_receiver.on(requirements[i], CH_ENTITY_ADD, function(entity) { + updateEntities(entity, CH_ENTITY_ADD); + }); + manager.system_updater_receiver.on(requirements[i], CH_ENTITY_REMOVE, function(entity) { + updateEntities(entity, CH_ENTITY_REMOVE); + }); + + } + } else { + manager.system_updater_receiver.on(requirements, CH_ENTITY_ADD, function(entity) { + updateEntities(entity, CH_ENTITY_ADD); + }); + manager.system_updater_receiver.on(requirements, CH_ENTITY_REMOVE, function(entity) { + updateEntities(entity, CH_ENTITY_REMOVE); + }); + } + } + + static create = undefined; + + static beginStep = undefined; + + static step = undefined; + + static endStep = undefined; + + static drawBegin = undefined; + + static draw = undefined; + + static drawEnd = undefined; + + static drawGUI = undefined; + + static roomStart = undefined; + + static roomEnd = undefined; + + static destroy = undefined; + + static enterSystem = undefined; + + static exitSystem = undefined; + + static updateEntities = function(entity, operation) { + switch (operation) { + case CH_ENTITY_ADD: + if (__requirements_met(entity) and !array_contains(entities, entity)) { + array_push(entities, entity); + entity_count = array_length(entities); + if (enterSystem != undefined) { + enterSystem(entity); + } + } + break; + case CH_ENTITY_REMOVE: + var _index = array_find(entities, entity); + if (_index != -1) { + array_delete(entities, _index, 1); + entity_count = array_length(entities); + if (exitSystem != undefined) { + exitSystem(entity); + } + } + break; + } + } + + static pausable = function(value) { + __pausable = value; + } + + static is_pausable = function() { + return __pausable; + } + + static __requirements_met = function(entity) { + var _has_components = true; + + if (is_array(__requirements)) { + for (var i = 0; i < array_length(__requirements); ++i) { + var _comp_check = entity.__components[$ __requirements[i]]; + _has_components = _has_components and !is_undefined(_comp_check); + } + } else { + var _comp_check = entity.__components[$ __requirements]; + _has_components = !is_undefined(_comp_check); + } + return _has_components; + } +} \ No newline at end of file diff --git a/scripts/__SystemFunctions/__SystemFunctions.yy b/scripts/__SystemFunctions/__SystemFunctions.yy new file mode 100644 index 0000000..f97358b --- /dev/null +++ b/scripts/__SystemFunctions/__SystemFunctions.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "System", + "path": "folders/ECS/_Internal/System.yy", + }, + "resourceVersion": "1.0", + "name": "__SystemFunctions", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/snap_deep_copy/snap_deep_copy.gml b/scripts/snap_deep_copy/snap_deep_copy.gml new file mode 100644 index 0000000..2a92a8c --- /dev/null +++ b/scripts/snap_deep_copy/snap_deep_copy.gml @@ -0,0 +1,105 @@ +/// @returm Copy of the given struct/array, including a copy of any nested structs and arrays +/// +/// This function is designed to copy simple tree-like structures that have been imported from +/// +/// @param struct/array The struct/array to be copied +/// +/// @jujuadams 2021-02-14 + +function snap_deep_copy(_value) +{ + return (new __snap_deep_copy(_value)).copy; +} + +function __snap_deep_copy(_value) constructor +{ + source = _value; + copy = undefined; + + + static copy_struct = function(_source) + { + var _copy = {}; + + var _names = variable_struct_get_names(_source); + var _i = 0; + repeat(array_length(_names)) + { + var _name = _names[_i]; + var _value = variable_struct_get(_source, _name); + + if (is_struct(_value)) + { + _value = copy_struct(_value); + } + else if (is_array(_value)) + { + _value = copy_array(_value); + } + else if (is_method(_value)) + { + var _self = method_get_self(_value); + if (_self == _source) + { + //If this method is bound to the source struct, create a new method bound to the new struct + _value = method(_copy, method_get_index(_value)); + } + else if (_self != undefined) + { + //If the scope of the method isn't (global) then spit out a warning + show_debug_message("snap_deep_copy(): Warning! Deep copy found a method reference that could not be appropriately handled"); + } + } + + variable_struct_set(_copy, _name, _value); + + ++_i; + } + + return _copy; + }; + + + + static copy_array = function(_source) + { + var _length = array_length(_source); + var _copy = array_create(_length,); + + var _i = 0; + repeat(_length) + { + var _value = _source[_i]; + + if (is_struct(_value)) + { + _value = copy_struct(_value); + } + else if (is_array(_value)) + { + _value = copy_array(_value); + } + + _copy[@ _i] = _value; + + ++_i; + } + + return _copy; + }; + + + + if (is_struct(source)) + { + copy = copy_struct(source); + } + else if (is_array(source)) + { + copy = copy_array(source); + } + else + { + copy = source; + } +} \ No newline at end of file diff --git a/scripts/snap_deep_copy/snap_deep_copy.yy b/scripts/snap_deep_copy/snap_deep_copy.yy new file mode 100644 index 0000000..3448728 --- /dev/null +++ b/scripts/snap_deep_copy/snap_deep_copy.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "THIRD PARTY HELPERS", + "path": "folders/THIRD PARTY HELPERS.yy", + }, + "resourceVersion": "1.0", + "name": "snap_deep_copy", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/sprites/spr_checkboard/78284bff-2ffb-47cc-b83f-a91486be9135.png b/sprites/spr_checkboard/78284bff-2ffb-47cc-b83f-a91486be9135.png new file mode 100644 index 0000000000000000000000000000000000000000..6a4428f978c2073e23b5d783290645818618cd5a GIT binary patch literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Ydl>XLn`LHy}6P1fC0}D2XVc< z?ceYF)*2mS<=A;ZxW(#i_4~~V#>&sHFMBP&fFa5um_c`eW`o!T5eM!Jt_7?ntQVMO zF=a6NGHz*DhFkjVwf{eh`R=}F!mA3OA@|uU7;m5B2&`4=Wd*vM!PC{xWt~$(69D~U BN}~V( literal 0 HcmV?d00001 diff --git a/sprites/spr_checkboard/layers/78284bff-2ffb-47cc-b83f-a91486be9135/ed1c8057-d138-491e-bbbe-637c6a9586ee.png b/sprites/spr_checkboard/layers/78284bff-2ffb-47cc-b83f-a91486be9135/ed1c8057-d138-491e-bbbe-637c6a9586ee.png new file mode 100644 index 0000000000000000000000000000000000000000..6a4428f978c2073e23b5d783290645818618cd5a GIT binary patch literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Ydl>XLn`LHy}6P1fC0}D2XVc< z?ceYF)*2mS<=A;ZxW(#i_4~~V#>&sHFMBP&fFa5um_c`eW`o!T5eM!Jt_7?ntQVMO zF=a6NGHz*DhFkjVwf{eh`R=}F!mA3OA@|uU7;m5B2&`4=Wd*vM!PC{xWt~$(69D~U BN}~V( literal 0 HcmV?d00001 diff --git a/sprites/spr_checkboard/spr_checkboard.yy b/sprites/spr_checkboard/spr_checkboard.yy new file mode 100644 index 0000000..cd94016 --- /dev/null +++ b/sprites/spr_checkboard/spr_checkboard.yy @@ -0,0 +1,79 @@ +{ + "bboxMode": 0, + "collisionKind": 1, + "type": 0, + "origin": 0, + "preMultiplyAlpha": false, + "edgeFiltering": false, + "collisionTolerance": 0, + "swfPrecision": 2.525, + "bbox_left": 0, + "bbox_right": 63, + "bbox_top": 0, + "bbox_bottom": 63, + "HTile": false, + "VTile": false, + "For3D": false, + "width": 64, + "height": 64, + "textureGroupId": { + "name": "Default", + "path": "texturegroups/Default", + }, + "swatchColours": null, + "gridX": 0, + "gridY": 0, + "frames": [ + {"compositeImage":{"FrameId":{"name":"78284bff-2ffb-47cc-b83f-a91486be9135","path":"sprites/spr_checkboard/spr_checkboard.yy",},"LayerId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",},"images":[ + {"FrameId":{"name":"78284bff-2ffb-47cc-b83f-a91486be9135","path":"sprites/spr_checkboard/spr_checkboard.yy",},"LayerId":{"name":"ed1c8057-d138-491e-bbbe-637c6a9586ee","path":"sprites/spr_checkboard/spr_checkboard.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",}, + ],"parent":{"name":"spr_checkboard","path":"sprites/spr_checkboard/spr_checkboard.yy",},"resourceVersion":"1.0","name":"78284bff-2ffb-47cc-b83f-a91486be9135","tags":[],"resourceType":"GMSpriteFrame",}, + ], + "sequence": { + "spriteId": {"name":"spr_checkboard","path":"sprites/spr_checkboard/spr_checkboard.yy",}, + "timeUnits": 1, + "playback": 1, + "playbackSpeed": 30.0, + "playbackSpeedType": 0, + "autoRecord": true, + "volume": 1.0, + "length": 1.0, + "events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "tracks": [ + {"name":"frames","spriteId":null,"keyframes":{"Keyframes":[ + {"id":"db163a2d-9712-415d-a904-f04ef90cba31","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"78284bff-2ffb-47cc-b83f-a91486be9135","path":"sprites/spr_checkboard/spr_checkboard.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + ],"resourceVersion":"1.0","resourceType":"KeyframeStore",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"modifiers":[],"isCreationTrack":false,"resourceVersion":"1.0","tags":[],"resourceType":"GMSpriteFramesTrack",}, + ], + "visibleRange": null, + "lockOrigin": false, + "showBackdrop": true, + "showBackdropImage": false, + "backdropImagePath": "", + "backdropImageOpacity": 0.5, + "backdropWidth": 1366, + "backdropHeight": 768, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "xorigin": 0, + "yorigin": 0, + "eventToFunction": {}, + "eventStubScript": null, + "parent": {"name":"spr_checkboard","path":"sprites/spr_checkboard/spr_checkboard.yy",}, + "resourceVersion": "1.3", + "name": "spr_checkboard", + "tags": [], + "resourceType": "GMSequence", + }, + "layers": [ + {"visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default","resourceVersion":"1.0","name":"ed1c8057-d138-491e-bbbe-637c6a9586ee","tags":[],"resourceType":"GMImageLayer",}, + ], + "nineSlice": null, + "parent": { + "name": "Sprites", + "path": "folders/Sprites.yy", + }, + "resourceVersion": "1.0", + "name": "spr_checkboard", + "tags": [], + "resourceType": "GMSprite", +} \ No newline at end of file diff --git a/sprites/spr_player_idle/ea48d3dd-25f2-429a-b853-7e4db4c54b91.png b/sprites/spr_player_idle/ea48d3dd-25f2-429a-b853-7e4db4c54b91.png new file mode 100644 index 0000000000000000000000000000000000000000..cbff8cf278d303313e8ffa826a78ea8dfaa62f86 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Gdx`!Ln`LHy#C=6Sw++IddN8<$zT{H!^s-`njxg HN@xNA0h~op literal 0 HcmV?d00001 diff --git a/sprites/spr_player_idle/layers/ea48d3dd-25f2-429a-b853-7e4db4c54b91/10652100-57ca-474a-a52a-9b4b7316dbdd.png b/sprites/spr_player_idle/layers/ea48d3dd-25f2-429a-b853-7e4db4c54b91/10652100-57ca-474a-a52a-9b4b7316dbdd.png new file mode 100644 index 0000000000000000000000000000000000000000..cbff8cf278d303313e8ffa826a78ea8dfaa62f86 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Gdx`!Ln`LHy#C=6Sw++IddN8<$zT{H!^s-`njxg HN@xNA0h~op literal 0 HcmV?d00001 diff --git a/sprites/spr_player_idle/spr_player_idle.yy b/sprites/spr_player_idle/spr_player_idle.yy new file mode 100644 index 0000000..e7e4867 --- /dev/null +++ b/sprites/spr_player_idle/spr_player_idle.yy @@ -0,0 +1,79 @@ +{ + "bboxMode": 0, + "collisionKind": 1, + "type": 0, + "origin": 0, + "preMultiplyAlpha": false, + "edgeFiltering": false, + "collisionTolerance": 0, + "swfPrecision": 2.525, + "bbox_left": 0, + "bbox_right": 63, + "bbox_top": 0, + "bbox_bottom": 63, + "HTile": false, + "VTile": false, + "For3D": false, + "width": 64, + "height": 64, + "textureGroupId": { + "name": "Default", + "path": "texturegroups/Default", + }, + "swatchColours": null, + "gridX": 0, + "gridY": 0, + "frames": [ + {"compositeImage":{"FrameId":{"name":"ea48d3dd-25f2-429a-b853-7e4db4c54b91","path":"sprites/spr_player_idle/spr_player_idle.yy",},"LayerId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",},"images":[ + {"FrameId":{"name":"ea48d3dd-25f2-429a-b853-7e4db4c54b91","path":"sprites/spr_player_idle/spr_player_idle.yy",},"LayerId":{"name":"10652100-57ca-474a-a52a-9b4b7316dbdd","path":"sprites/spr_player_idle/spr_player_idle.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",}, + ],"parent":{"name":"spr_player_idle","path":"sprites/spr_player_idle/spr_player_idle.yy",},"resourceVersion":"1.0","name":"ea48d3dd-25f2-429a-b853-7e4db4c54b91","tags":[],"resourceType":"GMSpriteFrame",}, + ], + "sequence": { + "spriteId": {"name":"spr_player_idle","path":"sprites/spr_player_idle/spr_player_idle.yy",}, + "timeUnits": 1, + "playback": 1, + "playbackSpeed": 30.0, + "playbackSpeedType": 0, + "autoRecord": true, + "volume": 1.0, + "length": 1.0, + "events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "tracks": [ + {"name":"frames","spriteId":null,"keyframes":{"Keyframes":[ + {"id":"553f6fec-84b5-40a9-9d34-6db671949b35","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"ea48d3dd-25f2-429a-b853-7e4db4c54b91","path":"sprites/spr_player_idle/spr_player_idle.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + ],"resourceVersion":"1.0","resourceType":"KeyframeStore",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"modifiers":[],"isCreationTrack":false,"resourceVersion":"1.0","tags":[],"resourceType":"GMSpriteFramesTrack",}, + ], + "visibleRange": null, + "lockOrigin": false, + "showBackdrop": true, + "showBackdropImage": false, + "backdropImagePath": "", + "backdropImageOpacity": 0.5, + "backdropWidth": 1366, + "backdropHeight": 768, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "xorigin": 0, + "yorigin": 0, + "eventToFunction": {}, + "eventStubScript": null, + "parent": {"name":"spr_player_idle","path":"sprites/spr_player_idle/spr_player_idle.yy",}, + "resourceVersion": "1.3", + "name": "spr_player_idle", + "tags": [], + "resourceType": "GMSequence", + }, + "layers": [ + {"visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default","resourceVersion":"1.0","name":"10652100-57ca-474a-a52a-9b4b7316dbdd","tags":[],"resourceType":"GMImageLayer",}, + ], + "nineSlice": null, + "parent": { + "name": "Sprites", + "path": "folders/Sprites.yy", + }, + "resourceVersion": "1.0", + "name": "spr_player_idle", + "tags": [], + "resourceType": "GMSprite", +} \ No newline at end of file diff --git a/sprites/spr_player_move/ea48d3dd-25f2-429a-b853-7e4db4c54b91.png b/sprites/spr_player_move/ea48d3dd-25f2-429a-b853-7e4db4c54b91.png new file mode 100644 index 0000000000000000000000000000000000000000..34887b885a637e7ac57ea76e303fcbf145b53008 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Gdx`!Ln`LHy$l&Sf=d#Wz Gp$P!=H$M6R literal 0 HcmV?d00001 diff --git a/sprites/spr_player_move/layers/ea48d3dd-25f2-429a-b853-7e4db4c54b91/10652100-57ca-474a-a52a-9b4b7316dbdd.png b/sprites/spr_player_move/layers/ea48d3dd-25f2-429a-b853-7e4db4c54b91/10652100-57ca-474a-a52a-9b4b7316dbdd.png new file mode 100644 index 0000000000000000000000000000000000000000..34887b885a637e7ac57ea76e303fcbf145b53008 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Gdx`!Ln`LHy$l&Sf=d#Wz Gp$P!=H$M6R literal 0 HcmV?d00001 diff --git a/sprites/spr_player_move/spr_player_idle.yy b/sprites/spr_player_move/spr_player_idle.yy new file mode 100644 index 0000000..e7e4867 --- /dev/null +++ b/sprites/spr_player_move/spr_player_idle.yy @@ -0,0 +1,79 @@ +{ + "bboxMode": 0, + "collisionKind": 1, + "type": 0, + "origin": 0, + "preMultiplyAlpha": false, + "edgeFiltering": false, + "collisionTolerance": 0, + "swfPrecision": 2.525, + "bbox_left": 0, + "bbox_right": 63, + "bbox_top": 0, + "bbox_bottom": 63, + "HTile": false, + "VTile": false, + "For3D": false, + "width": 64, + "height": 64, + "textureGroupId": { + "name": "Default", + "path": "texturegroups/Default", + }, + "swatchColours": null, + "gridX": 0, + "gridY": 0, + "frames": [ + {"compositeImage":{"FrameId":{"name":"ea48d3dd-25f2-429a-b853-7e4db4c54b91","path":"sprites/spr_player_idle/spr_player_idle.yy",},"LayerId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",},"images":[ + {"FrameId":{"name":"ea48d3dd-25f2-429a-b853-7e4db4c54b91","path":"sprites/spr_player_idle/spr_player_idle.yy",},"LayerId":{"name":"10652100-57ca-474a-a52a-9b4b7316dbdd","path":"sprites/spr_player_idle/spr_player_idle.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",}, + ],"parent":{"name":"spr_player_idle","path":"sprites/spr_player_idle/spr_player_idle.yy",},"resourceVersion":"1.0","name":"ea48d3dd-25f2-429a-b853-7e4db4c54b91","tags":[],"resourceType":"GMSpriteFrame",}, + ], + "sequence": { + "spriteId": {"name":"spr_player_idle","path":"sprites/spr_player_idle/spr_player_idle.yy",}, + "timeUnits": 1, + "playback": 1, + "playbackSpeed": 30.0, + "playbackSpeedType": 0, + "autoRecord": true, + "volume": 1.0, + "length": 1.0, + "events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "tracks": [ + {"name":"frames","spriteId":null,"keyframes":{"Keyframes":[ + {"id":"553f6fec-84b5-40a9-9d34-6db671949b35","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"ea48d3dd-25f2-429a-b853-7e4db4c54b91","path":"sprites/spr_player_idle/spr_player_idle.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + ],"resourceVersion":"1.0","resourceType":"KeyframeStore",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"modifiers":[],"isCreationTrack":false,"resourceVersion":"1.0","tags":[],"resourceType":"GMSpriteFramesTrack",}, + ], + "visibleRange": null, + "lockOrigin": false, + "showBackdrop": true, + "showBackdropImage": false, + "backdropImagePath": "", + "backdropImageOpacity": 0.5, + "backdropWidth": 1366, + "backdropHeight": 768, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "xorigin": 0, + "yorigin": 0, + "eventToFunction": {}, + "eventStubScript": null, + "parent": {"name":"spr_player_idle","path":"sprites/spr_player_idle/spr_player_idle.yy",}, + "resourceVersion": "1.3", + "name": "spr_player_idle", + "tags": [], + "resourceType": "GMSequence", + }, + "layers": [ + {"visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default","resourceVersion":"1.0","name":"10652100-57ca-474a-a52a-9b4b7316dbdd","tags":[],"resourceType":"GMImageLayer",}, + ], + "nineSlice": null, + "parent": { + "name": "Sprites", + "path": "folders/Sprites.yy", + }, + "resourceVersion": "1.0", + "name": "spr_player_idle", + "tags": [], + "resourceType": "GMSprite", +} \ No newline at end of file diff --git a/sprites/spr_player_move/spr_player_move.yy b/sprites/spr_player_move/spr_player_move.yy new file mode 100644 index 0000000..5d27aca --- /dev/null +++ b/sprites/spr_player_move/spr_player_move.yy @@ -0,0 +1,79 @@ +{ + "bboxMode": 0, + "collisionKind": 1, + "type": 0, + "origin": 0, + "preMultiplyAlpha": false, + "edgeFiltering": false, + "collisionTolerance": 0, + "swfPrecision": 2.525, + "bbox_left": 0, + "bbox_right": 63, + "bbox_top": 0, + "bbox_bottom": 63, + "HTile": false, + "VTile": false, + "For3D": false, + "width": 64, + "height": 64, + "textureGroupId": { + "name": "Default", + "path": "texturegroups/Default", + }, + "swatchColours": null, + "gridX": 0, + "gridY": 0, + "frames": [ + {"compositeImage":{"FrameId":{"name":"ea48d3dd-25f2-429a-b853-7e4db4c54b91","path":"sprites/spr_player_move/spr_player_move.yy",},"LayerId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",},"images":[ + {"FrameId":{"name":"ea48d3dd-25f2-429a-b853-7e4db4c54b91","path":"sprites/spr_player_move/spr_player_move.yy",},"LayerId":{"name":"10652100-57ca-474a-a52a-9b4b7316dbdd","path":"sprites/spr_player_move/spr_player_move.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",}, + ],"parent":{"name":"spr_player_move","path":"sprites/spr_player_move/spr_player_move.yy",},"resourceVersion":"1.0","name":"ea48d3dd-25f2-429a-b853-7e4db4c54b91","tags":[],"resourceType":"GMSpriteFrame",}, + ], + "sequence": { + "spriteId": {"name":"spr_player_move","path":"sprites/spr_player_move/spr_player_move.yy",}, + "timeUnits": 1, + "playback": 1, + "playbackSpeed": 30.0, + "playbackSpeedType": 0, + "autoRecord": true, + "volume": 1.0, + "length": 1.0, + "events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "tracks": [ + {"name":"frames","spriteId":null,"keyframes":{"Keyframes":[ + {"id":"07712aca-20ed-445e-8067-ed48cb995c38","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"ea48d3dd-25f2-429a-b853-7e4db4c54b91","path":"sprites/spr_player_move/spr_player_move.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + ],"resourceVersion":"1.0","resourceType":"KeyframeStore",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"modifiers":[],"isCreationTrack":false,"resourceVersion":"1.0","tags":[],"resourceType":"GMSpriteFramesTrack",}, + ], + "visibleRange": null, + "lockOrigin": false, + "showBackdrop": true, + "showBackdropImage": false, + "backdropImagePath": "", + "backdropImageOpacity": 0.5, + "backdropWidth": 1366, + "backdropHeight": 768, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "xorigin": 0, + "yorigin": 0, + "eventToFunction": {}, + "eventStubScript": null, + "parent": {"name":"spr_player_move","path":"sprites/spr_player_move/spr_player_move.yy",}, + "resourceVersion": "1.3", + "name": "spr_player_move", + "tags": [], + "resourceType": "GMSequence", + }, + "layers": [ + {"visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default","resourceVersion":"1.0","name":"10652100-57ca-474a-a52a-9b4b7316dbdd","tags":[],"resourceType":"GMImageLayer",}, + ], + "nineSlice": null, + "parent": { + "name": "Sprites", + "path": "folders/Sprites.yy", + }, + "resourceVersion": "1.0", + "name": "spr_player_move", + "tags": [], + "resourceType": "GMSprite", +} \ No newline at end of file diff --git a/sprites/spr_wall/e4e6fbb0-1e04-4079-a3b2-0312b563ba47.png b/sprites/spr_wall/e4e6fbb0-1e04-4079-a3b2-0312b563ba47.png new file mode 100644 index 0000000000000000000000000000000000000000..12331f54e156bc5bc95de5c8ebd48bc311e8f60a GIT binary patch literal 210 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Gd*1#Ln`LHy",}, + "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "tracks": [ + {"name":"frames","spriteId":null,"keyframes":{"Keyframes":[ + {"id":"a69c5508-be3f-4fcc-a977-0a4e26ef3b06","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"e4e6fbb0-1e04-4079-a3b2-0312b563ba47","path":"sprites/spr_wall/spr_wall.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + ],"resourceVersion":"1.0","resourceType":"KeyframeStore",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"modifiers":[],"isCreationTrack":false,"resourceVersion":"1.0","tags":[],"resourceType":"GMSpriteFramesTrack",}, + ], + "visibleRange": null, + "lockOrigin": false, + "showBackdrop": true, + "showBackdropImage": false, + "backdropImagePath": "", + "backdropImageOpacity": 0.5, + "backdropWidth": 1366, + "backdropHeight": 768, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "xorigin": 0, + "yorigin": 0, + "eventToFunction": {}, + "eventStubScript": null, + "parent": {"name":"spr_wall","path":"sprites/spr_wall/spr_wall.yy",}, + "resourceVersion": "1.3", + "name": "spr_wall", + "tags": [], + "resourceType": "GMSequence", + }, + "layers": [ + {"visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default","resourceVersion":"1.0","name":"f5f1c9a5-150a-4183-99b0-e00e04178a98","tags":[],"resourceType":"GMImageLayer",}, + ], + "nineSlice": null, + "parent": { + "name": "Sprites", + "path": "folders/Sprites.yy", + }, + "resourceVersion": "1.0", + "name": "spr_wall", + "tags": [], + "resourceType": "GMSprite", +} \ No newline at end of file