Skip to content

Commit

Permalink
Fixing menu new icons
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonBergaker committed Nov 22, 2017
1 parent 6c21ade commit 265fa7e
Show file tree
Hide file tree
Showing 42 changed files with 80 additions and 72 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ A mobile version of a classic game with a similar name.

Couldn't find an Android version that didn't make me accidently click the damn bomb everytime I tried to flag.

Made in GameMaker Studio 2 for Android. Could probably work on iOS.
Made in GameMaker Studio 2 primarly for Android. Could probably work on iOS aswell.
PC build is available under releases

## Features
* Controls that makes it really hard to mess up
Expand Down
Binary file modified icons/144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed icons/2_144.png
Binary file not shown.
Binary file removed icons/2_192.png
Binary file not shown.
Binary file removed icons/2_36.png
Binary file not shown.
Binary file removed icons/2_48.png
Binary file not shown.
Binary file removed icons/2_72.png
Binary file not shown.
Binary file removed icons/2_96.png
Binary file not shown.
Binary file modified icons/36.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed icons/main.psd
Binary file not shown.
Binary file removed icons/minefield_icon.png
Binary file not shown.
Binary file removed icons/minefield_icon2.png
Binary file not shown.
Binary file removed icons/minefield_icon2_4CS_icon.ico
Binary file not shown.
File renamed without changes.
2 changes: 1 addition & 1 deletion minisweeper/objects/oGridControl/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ updateDrawing = false;
firstStep = true;



//If a save exists import it
if (file_exists("save.sav")) {
scr_load_grid();
Expand All @@ -21,6 +20,7 @@ if (file_exists("save.sav")) {
scr_place_mines(gridMines);
firstPress = true;
minesLeft = gridMines;
leftToClear = gridWidth * gridHeight - gridMines;
}

lastPanX = 0;
Expand Down
24 changes: 6 additions & 18 deletions minisweeper/objects/oGridControl/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ if (firstStep) {
firstStep = false;
}

var _updatedField = false;

if (locked == false) {
for (var i=0;i<5;i++) {
Expand Down Expand Up @@ -48,12 +47,10 @@ if (locked == false) {
}
if (!clearedGrid[# _xx, _yy]) {
scr_clear_place(_xx, _yy);
_updatedField = true;
} else {
var _nearFlags = scr_get_nearby(flagGrid, _xx, _yy);
if (_nearFlags == nearGrid[# _xx, _yy]) {
scr_clear_near(_xx,_yy);
_updatedField = true;
}
}
}
Expand Down Expand Up @@ -448,24 +445,15 @@ if (pitch > 0) {
}


if (_updatedField) {
var _won = true;
for (var xx=0;xx<gridWidth;xx++) {
for (var yy=0;yy<gridHeight;yy++) {
if (clearedGrid[# xx,yy] == 0 && mineGrid[# xx,yy] == 0) {
_won = false;
xx+=gridWidth+1;
break;
}
}
}


if (_won) {
won = 1;
locked = true;
}
if (won == 0 && leftToClear == 0) {
won = 1;
locked = true;
}

log(leftToClear);

if (won==1) {
wonTimer+=deltaTimeS;
if (wonTimer > 1) {
Expand Down
2 changes: 1 addition & 1 deletion minisweeper/objects/oInit/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (os_type == os_android) {
global.dpi = 72;
}

//show_debug_overlay(1)
show_debug_overlay(1)

window_set_size(global.windowWidth,global.windowHeight);

Expand Down
1 change: 1 addition & 0 deletions minisweeper/objects/oInit/Draw_64.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
draw_clear(global.backColor);
10 changes: 10 additions & 0 deletions minisweeper/objects/oInit/oInit.yy

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

1 change: 1 addition & 0 deletions minisweeper/objects/oMenuGameEnd/Step_2.gml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ if (!destroy) {
}
var _inst = instance_create_layer(0,0,"MenuMain",oMenuMain);
_inst.fadeIn = true;
_inst.fadeInInit = false;
_inst.rebootGrid = true;
introTimer = -1;
destroy = true;
Expand Down
11 changes: 9 additions & 2 deletions minisweeper/objects/oMenuMain/Create_0.gml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
fadeIn = false;
fadeIn = true;
fadeInInit = true;
fadeInTimer = 0;
rebootGrid = false;
fadeOut = false;
Expand All @@ -7,6 +8,7 @@ alpha = 0;
updateSize = false;

presetTimer = 0;
bestTimeTimer = 0;


if (file_exists("save.sav")) {
Expand All @@ -25,7 +27,7 @@ if (file_exists("save.sav")) {
settingsButton = scr_menu_create_button(menu,0.5,0.75,"Settings","settings",false);

scr_menu_set_button_settings(menu,fa_center,fa_middle,fLightMenu,0.4,0.07)
sizeToggle = scr_menu_create_button(menu,0.5,0.62,"Presets","sizeToggle",false);
sizeToggle = scr_menu_create_button(menu,0.5,0.62,"Custom","sizeToggle",false);

scr_menu_set_button_settings(menu,fa_center,fa_middle,fThinMenu,0.8,0.2)
nameLabel = scr_menu_create_label(menu, 0.5, 0.2, "miniSweeper")
Expand All @@ -49,5 +51,10 @@ if (file_exists("save.sav")) {

recordLabel = scr_menu_create_label(menu, 0.15, 0.48, "10:20:42");
recordLabel.alpha = 0.8;

var _result = global.highScores[? scr_format_gridstring_unordered(global.gridWidth, global.gridHeight, global.mineCount)];
if (_result != undefined) {
bestTimeTimer = 1;
}
}

4 changes: 2 additions & 2 deletions minisweeper/objects/oMenuMain/Draw_64.gml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
draw_set_color(global.backColor);
if (alpha != 1) {
if (!fadeInInit && alpha != 1) {
draw_set_alpha(alpha);
}
draw_rectangle(0,0,global.internalWidth,global.internalHeight,0);
if (alpha != 1) {
if (!fadeInInit && alpha != 1) {
draw_set_alpha(1);
}
9 changes: 7 additions & 2 deletions minisweeper/objects/oMenuMain/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ if (_ratio) > 0.6 {
if (fadeIn) {
fadeInTimer+=deltaTimeS;
if (fadeInTimer >= 1) {
fadeIn = false;
fadeIn = false;
fadeInInit = false;
}
}

Expand All @@ -29,10 +30,14 @@ if (fadeOut) {

var _result = global.highScores[? scr_format_gridstring_unordered(global.gridWidth, global.gridHeight, global.mineCount)];
if (_result == undefined) {
recordLabel.text = "";
bestTimeTimer -= deltaTimeS*3;
} else {
recordLabel.text = scr_get_formatted__time( _result);
bestTimeTimer += deltaTimeS*3;
}
bestTimeTimer = clamp(bestTimeTimer,0,1);
recordLabel.x = ease_quadOut(-0.1,0.15, bestTimeTimer, 1);
recordLabel.alpha = ease_quadIn(0,1,clamp(bestTimeTimer,0,0.2),0.2)

minesLabel.text = string(round((100*global.mineCount)/(global.gridWidth*global.gridHeight))) + "%*";
minesLabel.alpha = lerp(0,0.7,presetTimer);
Expand Down
3 changes: 2 additions & 1 deletion minisweeper/objects/oMenuMain/Step_2.gml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ if (!fadeOut) {
oGridControl.enabled = true;
if (rebootGrid) {
with oGridControl {
if (other.updateSize) {
if (other.updateSize || global.gridWidth != gridWidth
|| global.gridHeight != gridHeight || global.mineCount != gridMines) {
scr_grid_update_size();
}
scr_reset_grid();
Expand Down
Binary file modified minisweeper/options/android/icons/hdpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified minisweeper/options/android/icons/ldpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified minisweeper/options/android/icons/mdpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified minisweeper/options/android/icons/xhdpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified minisweeper/options/android/icons/xxhdpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified minisweeper/options/android/icons/xxxhdpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

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

35 changes: 0 additions & 35 deletions minisweeper/rooms/rInit/rInit.yy

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

32 changes: 29 additions & 3 deletions minisweeper/rooms/rMain/rMain.yy

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

1 change: 1 addition & 0 deletions minisweeper/scripts/scr_clear_place/scr_clear_place.gml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ if !(clearedGrid[# _xx, _yy]) {
audio_play(aBleep,clamp(0.5 - log10(pitch+1),0.1,0.5),random_range(0.5,1.5) + log10(pitch+1));
pitch += 0.1;
}
leftToClear--;
}

if (mineGrid[# _xx, _yy]) {
Expand Down
1 change: 1 addition & 0 deletions minisweeper/scripts/scr_load_grid/scr_load_grid.gml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ if (file_exists("save.sav")) {


minesLeft = ds_grid_get_sum(mineGrid,0,0,gridWidth-1,gridHeight-1) - ds_grid_get_sum(flagGrid,0,0,gridWidth-1,gridHeight-1);
leftToClear = gridWidth*gridHeight - ds_grid_get_sum(clearedGrid,0,0,gridWidth-1,gridHeight-1) - gridMines;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (_inst.filled) {

if (_fade >= 0) {
if (_pressIn >= 1) {
draw_sprite_ext(sSmallBox,0,_x,_y,_width/374,_height/84,0,merge_color(global.buttonColor,pressColorFilled,0.2*_fade),alpha);
draw_sprite_ext(sSmallBox,0,_x,_y,_width/374,_height/84,0,merge_color(global.buttonColor,pressColorFilled,0.2*_fade),alpha*_inst.alpha);
} else {
draw_sprite_ext(sSmallBox,0,_x,_y,_width/374,_height/84,0,global.buttonColor,alpha);

Expand All @@ -35,7 +35,7 @@ if (_inst.filled) {


draw_set_alpha(1);
draw_sprite_ext(sSmallBox,0,_x,_y,_width/374,_height/84,0,c_white,alpha);
draw_sprite_ext(sSmallBox,0,_x,_y,_width/374,_height/84,0,c_white,alpha*_inst.alpha);
gpu_set_blendenable(true);
gpu_set_colorwriteenable(true,true,true,true);

Expand All @@ -47,7 +47,7 @@ if (_inst.filled) {

}
} else {
draw_sprite_ext(sSmallBox,0,_x,_y,_width/374,_height/84,0,global.buttonColor,1);
draw_sprite_ext(sSmallBox,0,_x,_y,_width/374,_height/84,0,global.buttonColor,alpha*_inst.alpha);
}
} else {
var _pressIn = menuTime - _inst.pressedTime;
Expand Down Expand Up @@ -77,7 +77,7 @@ if (_inst.filled) {

gpu_set_blendmode_ext(bm_dest_alpha,bm_inv_dest_alpha);
gpu_set_alphatestenable(true);
draw_sprite_ext(sCircle,0,_x+_xx,_y+_yy,_raidus/128,_raidus/128,0,pressColor,alpha);
draw_sprite_ext(sCircle,0,_x+_xx,_y+_yy,_raidus/128,_raidus/128,0,pressColor,alpha*_inst.alpha);
gpu_set_alphatestenable(false);
gpu_set_blendmode(bm_normal);

Expand Down
3 changes: 2 additions & 1 deletion minisweeper/scripts/scr_reset_grid/scr_reset_grid.gml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ lostTimer = 0;
gameplayTime = 0;
timerX = 0;
minesLeft = gridMines;
updateDrawing = true;
updateDrawing = true;
leftToClear = gridWidth * gridHeight - gridMines;

0 comments on commit 265fa7e

Please sign in to comment.