This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Create | |
// editable variables | |
acceleration_ = 1; | |
jump_height_ = 14; | |
friction_ = 0.3; | |
// control input | |
left_ = vk_left; | |
right_ = vk_right; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch (state_) { | |
case "move": | |
#region Move State | |
// left and right movement | |
var h_input = keyboard_check(vk_right) - keyboard_check(vk_left); | |
if (h_input != 0) { | |
hspeed_ += h_input * acceleration_; | |
hspeed_ = clamp(hspeed_, -max_speed_, max_speed_); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// movement variables | |
velocity = [0, 0]; | |
new_gravity = 1.5; | |
jumpspeed = 28; | |
max_velocity = [8, 32]; | |
acceleration = 2.1; | |
// get the tile map id | |
var _layer_id = layer_get_id("CollisionTiles"); | |
collision_tile_map_id = layer_tilemap_get_id(_layer_id); |
NewerOlder