-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
895 additions
and
72 deletions.
There are no files selected for viewing
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
event_inherited() | ||
|
||
grube_mode = false | ||
grube_button = instance_create_layer(200, 30, "WindowElements", asset_get_index("obj_ev_executing_button"), { | ||
txt : "Grube", | ||
base_scale_x : 1.2, | ||
base_scale_y : 0.9, | ||
count : 0, | ||
func : function () { | ||
var grube = instance_create_layer(200 + irandom_range(-20, 20), y + 42, "Grube", asset_get_index("obj_ev_grube")) | ||
grube.window = window; | ||
array_push(window.grubes, grube) | ||
count++; | ||
if count == 5 { | ||
window.grube_mode = true; | ||
|
||
if global.compiled_for_merge { | ||
audio_sound_gain(global.music_inst, 0, 1000) | ||
global.music_inst = noone | ||
ev_play_music(asset_get_index("msc_stg_extraboss")) | ||
audio_sound_gain(global.music_inst, 0, 0) | ||
audio_sound_gain(global.music_inst, 1, 1000) | ||
|
||
} | ||
else { | ||
audio_sound_gain(global.music, 0, 1000) | ||
global.music = noone | ||
ev_play_music(asset_get_index("msc_stg_extraboss")) | ||
audio_sound_gain(global.music, 0, 0) | ||
audio_sound_gain(global.music, 1, 1000) | ||
} | ||
|
||
instance_create_layer(mouse_x, mouse_y, "Plucker", asset_get_index("obj_ev_plucker")) | ||
|
||
with (window) { | ||
var t = instance_create_layer(200, 72, "Textbox", asset_get_index("obj_ev_textbox"), { | ||
opened_x : 112, | ||
opened_y : 72, | ||
txt : "Stack the grubes!\nLeft click to grab, right click to destroy. " | ||
+ "You can scroll with the scroll wheel or the up/down keys." | ||
+ "\nCAREFUL: Grubes under too much pressure may be destroyed...\n" | ||
+ "Try to keep a modest amount." | ||
, | ||
layer_num : 0, | ||
allow_deletion : false, | ||
char_limit : 0, | ||
}) | ||
add_child(t) | ||
} | ||
} | ||
|
||
|
||
} | ||
}) | ||
add_child(grube_button) | ||
|
||
max_stack = 0; | ||
grubes = [] | ||
dense_check_timer_max = 2; | ||
dense_check_timer = dense_check_timer_max; | ||
|
||
highest_stack = global.highest_grube_stack; | ||
timer_hold_highest_stack_max = 300; | ||
timer_hold_highest_stack = 0; | ||
potential_new_highest_stack = 0; | ||
|
||
scroll_accel = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
|
||
if grube_mode { | ||
draw_set_font(global.ev_font) | ||
draw_set_halign(fa_center) | ||
draw_set_valign(fa_top) | ||
var highest_str = string(highest_stack) + "\n" | ||
if potential_new_highest_stack != 0 { | ||
highest_str += "CHECKING STABILITY\n" | ||
repeat ((global.editor_time / 3) % 3 + 1) { | ||
highest_str += "." | ||
} | ||
} | ||
|
||
var camera_y = camera_get_view_y(view_camera[0]); | ||
draw_set_color(c_black) | ||
ev_draw_rectangle(20, camera_y + 5, 25, camera_y + 30, false) | ||
draw_set_color(c_white) | ||
var elevation = camera_y / -5700 | ||
|
||
var slider_height = 5; | ||
var slider_y = lerp(30 - slider_height, 5, elevation) | ||
|
||
|
||
ev_draw_rectangle(20, camera_y + slider_y, 25, camera_y + slider_y + slider_height, false) | ||
|
||
var txt = "STACK THE GRUBES\nSTACK: " + string(max_stack) + "\nHIGHEST: " + highest_str; | ||
var size = 0.5 | ||
|
||
var gy = camera_y + 5; | ||
|
||
draw_set_color(c_black) | ||
draw_text_transformed(112 + size, gy, txt, size, size, 0) | ||
draw_text_transformed(112 - size, gy, txt, size, size, 0) | ||
draw_text_transformed(112, gy + size, txt, size, size, 0) | ||
draw_text_transformed(112, gy - size, txt, size, size, 0) | ||
|
||
draw_set_color(c_white) | ||
draw_text_transformed(112, gy, txt, size, size, 0) | ||
|
||
|
||
draw_sprite(asset_get_index("spr_ev_tools"), 0, mouse_x, mouse_y) | ||
|
||
exit | ||
} | ||
|
||
draw_set_font(global.ev_font) | ||
draw_set_halign(fa_left) | ||
draw_set_valign(fa_top) | ||
|
||
|
||
|
||
|
||
var long_text = | ||
@"Development: | ||
Skirlez | ||
KyuuMetis | ||
Pyredrid - Branefuck functions | ||
Meepster99 - GBAStranger export | ||
gullwingdoors - Pencil Icon | ||
juliascythe - Helping with eventually creating the Grube | ||
|
||
Music Credits: | ||
Sunday - crappyblue - astra_jam (...ad astra) | ||
Monday - Skirlez - Monsday (Greedy Groove) | ||
Tuesday - 8bitavo - Tail's Lullaby (Tail, Affection Air, Void) | ||
Wednesday - gooeyPhantasm - Blossom (Dancing lesson, Blossom chime) | ||
Friday - gooeyPhantasm - Endless Void (Voided) | ||
Thursday/Saturday - eebrozgi - Stealie Feelies (slowed down) | ||
|
||
"; | ||
|
||
|
||
|
||
|
||
var draw_y = 5 | ||
|
||
var size = 0.35 | ||
draw_set_color(c_black) | ||
draw_text_transformed(4 + size, draw_y, long_text, size, size, 0) | ||
draw_text_transformed(4 - size, draw_y, long_text, size, size, 0) | ||
draw_text_transformed(4, draw_y + size, long_text, size, size, 0) | ||
draw_text_transformed(4, draw_y - size, long_text, size, size, 0) | ||
|
||
draw_set_color(c_white) | ||
draw_text_transformed(4, draw_y, long_text, size, size, 0) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if grube_mode { | ||
audio_stop_sound(global.menu_music) | ||
global.highest_grube_stack = highest_stack | ||
ev_save(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
event_inherited(); | ||
if !grube_mode | ||
exit | ||
|
||
var ypos = camera_get_view_y(view_camera[0]) | ||
if mouse_wheel_down() || ev_get_vertical_held() == 1 { | ||
ypos += 6 + scroll_accel | ||
scroll_accel += 0.25 | ||
} | ||
else if mouse_wheel_up() || ev_get_vertical_held() == -1 { | ||
ypos -= 6 + scroll_accel | ||
scroll_accel += 0.25 | ||
} | ||
else { | ||
scroll_accel = 0 | ||
} | ||
|
||
ypos = clamp(ypos, -5700, 0) | ||
|
||
camera_set_view_pos(view_camera[0], camera_get_view_x(view_camera[0]), ypos) | ||
grube_button.y = ypos + 30 | ||
var cache = ds_map_create(); | ||
|
||
function find_grubes_above(grube, cache) { | ||
static grube_object = asset_get_index("obj_ev_grube") | ||
|
||
if !ds_map_exists(cache, grube) { | ||
var above_grube = noone | ||
with (grube) { | ||
var list = ds_list_create() | ||
instance_place_list(x, y - 16, grube_object, list, true); | ||
var arr = ds_list_to_array(list); | ||
ds_list_destroy(list); | ||
|
||
for (var i = 0; i < array_length(arr) && above_grube == noone; i++) { | ||
if (arr[i].y > grube.y) | ||
continue; | ||
if (abs(arr[i].y - grube.y) < 12) | ||
continue; | ||
if (arr[i].death_timer != -1) | ||
continue; | ||
above_grube = arr[i] | ||
} | ||
|
||
|
||
} | ||
|
||
if above_grube == noone || above_grube.y > grube.y { | ||
ds_map_add(cache, grube, 0) | ||
return 0; | ||
} | ||
|
||
var above_above_value = find_grubes_above(above_grube, cache); | ||
ds_map_add(cache, grube, above_above_value + 1) | ||
return above_above_value + 1; | ||
} | ||
return ds_map_find_value(cache, grube); | ||
|
||
} | ||
max_stack = 0 | ||
for (var i = 0; i < array_length(grubes); i++) { | ||
var grube = grubes[i]; | ||
if !instance_exists(grube) { | ||
array_delete(grubes, i, 1) | ||
i--; | ||
continue; | ||
} | ||
var value = find_grubes_above(grube, cache) + 1 | ||
if value > max_stack | ||
max_stack = value; | ||
} | ||
|
||
|
||
ds_map_destroy(cache); | ||
|
||
dense_check_timer--; | ||
if dense_check_timer <= 0 && array_length(grubes) != 0 { | ||
dense_check_timer = dense_check_timer_max; | ||
var random_grube = grubes[irandom_range(0, array_length(grubes) - 1)] | ||
if random_grube.death_timer == -1 { | ||
|
||
var max_close_grubes = 8; | ||
var close_dist = 30; | ||
var close_grubes = 0; | ||
|
||
for (var i = 0; i < array_length(grubes); i++) { | ||
var grube = grubes[i] | ||
if grube == random_grube | ||
continue; | ||
if point_distance(grube.x, grube.y, random_grube.x, random_grube.y) < close_dist | ||
close_grubes++; | ||
} | ||
if close_grubes >= max_close_grubes { | ||
for (var i = 0; i < array_length(grubes); i++) { | ||
if grubes[i] == random_grube { | ||
array_delete(grubes, i, 1) | ||
break; | ||
} | ||
} | ||
random_grube.die() | ||
} | ||
} | ||
} | ||
|
||
if max_stack > highest_stack && max_stack > potential_new_highest_stack { | ||
potential_new_highest_stack = max_stack | ||
timer_hold_highest_stack = timer_hold_highest_stack_max; | ||
} | ||
if potential_new_highest_stack != 0 { | ||
timer_hold_highest_stack--; | ||
if timer_hold_highest_stack <= 0 { | ||
highest_stack = potential_new_highest_stack; | ||
potential_new_highest_stack = 0; | ||
} | ||
if max_stack < potential_new_highest_stack { | ||
potential_new_highest_stack = 0; | ||
timer_hold_highest_stack = 0; | ||
} | ||
|
||
} | ||
|
Oops, something went wrong.