Skip to content

Commit

Permalink
v3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sohomsahaun committed Nov 15, 2021
1 parent 497f3c8 commit e577054
Show file tree
Hide file tree
Showing 76 changed files with 1,162 additions and 258 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 align="center">SnowState 2.4.0</h1>
<h1 align="center">SnowState 3.0.0</h1>
<p align="center">@sohomsahaun</p>

---
Expand All @@ -20,4 +20,4 @@ You can find downloadable .yyz (project file with demo) and .yymps (SnowState on
To know more about SnowState, please visit the [Wiki](https://github.com/sohomsahaun/SnowState/wiki)!

## Note
This version of SnowState is for GameMaker Studio 2.3.2 or higher. If you are using earlier version(s) of GameMaker Studio, please check out earlier version(s) of SnowState.
This version of SnowState is for GameMaker Studio 2.3.6 or higher. If you are using earlier version(s) of GameMaker Studio, please check out earlier version(s) of SnowState.
108 changes: 56 additions & 52 deletions SnowState.yyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion objects/oCamera/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ width = 480;
height = 270;

targetPos = [x,y];
targetInst = oPlayer;
targetInst = (DEMO == "D") ? oPlayerD : oPlayerT;
rate = 2;

// Resize window and app surface
Expand Down
2 changes: 1 addition & 1 deletion objects/oGame/Alarm_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ with (instance_create_layer(_x, _y, "SmallClouds", oCloud)) {
hspeed = -random_range(.2, .4);
}

alarm[0] = irandom_range(5, 15) * game_get_speed(gamespeed_fps);
alarm[0] = irandom_range(5, 15) * game_get_speed(gamespeed_fps);
13 changes: 9 additions & 4 deletions objects/oGame/Draw_64.gml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,25 @@ if (showHistory) {
_x = 10;
_y = 10;

var _str, _states, _i;
_states = oPlayer.fsm.history_get();
var _player, _states, _str, _i, _col;
_player = (DEMO == "D") ? oPlayerD : oPlayerT;
_states = _player.fsm.history_get();
_str = "groundAttack3";

draw_set_alpha(.9);
draw_rectangle_color(0, 0, 20+string_width(_str), display_get_gui_height(),
c_black, c_black, c_black, c_black, 0);
draw_set_alpha(1);

draw_text_outline(_x, _y, "HISTORY", c_white, c_black, _thickness);
draw_text_color(_x, _y, "HISTORY", c_white, c_white, c_white, c_white, 1);
_y += 10;

_col = c_white;
_i = 0; repeat (array_length(_states)) {
_y += _diff; draw_text_outline(_x, _y, _states[@ _i], c_white, c_black, _thickness);
_str = _states[_i];
_y += _diff;
draw_text_color(_x, _y, _str, _col, _col, _col, _col, 1);
_col = c_gray;
++_i;
}
}
2 changes: 1 addition & 1 deletion objects/oGame/Step_0.gml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
showControls ^= keyboard_check_released(vk_f2);
showHistory ^= keyboard_check_released(ord("H"));
showHistory ^= keyboard_check_released(ord("H"));
1 change: 0 additions & 1 deletion objects/oPlayer/KeyRelease_82.gml

This file was deleted.

33 changes: 6 additions & 27 deletions objects/oPlayer/Create_0.gml → objects/oPlayerD/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ fsm
vspd = 0;
},
step: function() {
check_input();

// If left or right keys are pressed, run
if (abs(input.hdir)) {
fsm.change("run");
Expand All @@ -97,10 +95,7 @@ fsm
}
} else {
// Recall the sword
if (input.recallSword) {
var _sword = instance_find(oSword, 0);
_sword.recall();
}
recall_sword();
}

// Movement
Expand All @@ -120,8 +115,6 @@ fsm
image_speed = 1;
},
step: function() {
check_input();

var _dir = input.hdir;
hspd = spd * _dir;

Expand Down Expand Up @@ -153,10 +146,7 @@ fsm
}
} else {
// Recall the sword
if (input.recallSword) {
var _sword = instance_find(oSword, 0);
_sword.recall();
}
recall_sword();
}

// Movement
Expand Down Expand Up @@ -185,19 +175,14 @@ fsm
image_index = image_number - 1;
}

check_input();

// Throw the sword
if (input.throwSword && hasSword) {
fsm.change("throwSword");
return;
}

// Recall the sword
if (input.recallSword && !hasSword) {
var _sword = instance_find(oSword, 0);
_sword.recall();
}
recall_sword();

// Movement
apply_gravity();
Expand Down Expand Up @@ -229,7 +214,6 @@ fsm
image_index = image_number - 1;
}

check_input();
var _dir = input.hdir;
hspd = spd * _dir;
if (_dir != 0) face = _dir;
Expand All @@ -248,14 +232,11 @@ fsm
}
} else {
// Recall the sword
if (input.recallSword) {
var _sword = instance_find(oSword, 0);
_sword.recall();
}
recall_sword();
}

// Coyote time
if ((fsm.get_time() <= coyoteDuration) && input.jump) {
if ((fsm.get_time(false) <= coyoteDuration) && input.jump) {
// Apply only if we were running
if (fsm.get_previous_state() == "run") {
fsm.change("jump");
Expand Down Expand Up @@ -292,8 +273,6 @@ fsm
}
},
step: function() {
check_input();

// If attack key is pressed any time during the current state,
// go to the next attack state after the animation ends
if (input.attack) {
Expand Down Expand Up @@ -436,4 +415,4 @@ fsm
leave: function() {
grav = gravGround;
}
});
});
File renamed without changes.
1 change: 1 addition & 0 deletions objects/oPlayerD/KeyRelease_82.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
game_restart();
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ move_and_collide = function() {
};

spawn_sword = function() {
with (instance_create_depth(x+6*face, y-14, depth, oSword)) {
with (instance_create_depth(x+6*face, y-14, depth, oSwordD)) {
owner = other.id;
face = owner.face;
fsm.change("spinning");
Expand All @@ -68,4 +68,11 @@ spawn_sword = function() {
equip_sword = function() {
hasSword = true;
sprite_index = get_sprite();
};

recall_sword = function() {
if (!hasSword && input.recallSword) {
var _sword = instance_find(oSwordD, 0);
_sword.recall();
}
};
File renamed without changes.
2 changes: 2 additions & 0 deletions objects/oPlayerD/Step_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
check_input();
fsm.step();
6 changes: 3 additions & 3 deletions objects/oPlayer/oPlayer.yy → objects/oPlayerD/oPlayerD.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e577054

Please sign in to comment.