Skip to content

Commit

Permalink
iOS and shockwave
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonBergaker committed Apr 3, 2018
1 parent 857714e commit bc63abe
Show file tree
Hide file tree
Showing 39 changed files with 84 additions and 43 deletions.
3 changes: 2 additions & 1 deletion minisweeper/objects/oCamera/Step_1.gml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ if (_check) {
global.windowHeight = window_get_height();
global.guiWidth = display_get_gui_width();
global.guiHeight = display_get_gui_height();
log(global.guiHeight);
global.dpi = display_get_dpi_x();
global.dpiScale = global.dpi/72;
global.dpiScale *= global.dpiScaleFactor;

if (global.forceWindowX != -1 && global.forceWindowY != -1) {
var _xx = global.forceWindowX;
Expand Down
5 changes: 1 addition & 4 deletions minisweeper/objects/oCamera/Step_2.gml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
if room == rMain {
global.dpiScale = global.dpi/72;
if (global.onPhone) {
global.dpiScale *= 0.4;
}

var _dpiScale = global.dpiScale;

var _off = (min(oGridControl.fieldHeight, height)/global.guiHeight)*70*_dpiScale;
Expand Down
4 changes: 4 additions & 0 deletions minisweeper/objects/oGridControl/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ mipScale = power(2,mip);

surf = -1;

finalActive = false;
finalPressX = 0;
finalPressY = 0;
finalPressTime = 0;

saveTimer = 0;

Expand Down
17 changes: 16 additions & 1 deletion minisweeper/objects/oGridControl/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,14 @@ if (locked != LockedState.Locked) {
}
if (!clearedGrid[# _xx, _yy]) {
scr_clear_place(_xx, _yy);
finalPressX = _in.touchReleaseX[i];
finalPressY = _in.touchReleaseY[i];
} else {
var _nearFlags = scr_get_nearby(flagGrid, _xx, _yy);
if (_nearFlags == nearGrid[# _xx, _yy]) {
scr_clear_near(_xx,_yy);
finalPressX = _in.touchReleaseX[i];
finalPressY = _in.touchReleaseY[i];
}
}
}
Expand Down Expand Up @@ -651,14 +655,25 @@ if (instance_exists(oColorChanger)) {
}

if (won == 0 && leftToClear <= 0 && enabled && !firstPress && lost == 0) {
finalPressTime = 0;
finalActive = true;
won = 1;
}

if finalActive {
finalPressTime+=deltaTimeS;
updateDrawing = true;
log(finalPressX, finalPressY);
if finalPressTime > 5 {
finalActive = false;
}
}


if (won==1) {
locked = LockedState.InputLocked;
wonTimer+=deltaTimeS;
if (wonTimer > 1) {
if (wonTimer > 0.5) {
won = 2;
wonTimer = 0;
lost = 2;
Expand Down
9 changes: 8 additions & 1 deletion minisweeper/objects/oInit/Create_0.gml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
global.onPhone = true;
global.dpiScaleFactor = 1;
if (os_type == os_windows || os_type == os_macosx || os_type == os_linux || os_type == os_uwp) {
global.onPhone = false;
}
Expand Down Expand Up @@ -39,8 +40,14 @@ if (os_type == os_android || os_type == os_ios) {

global.dpiScale = global.dpi/72;
if (global.onPhone) {
global.dpiScale *= 0.4;
global.dpiScaleFactor = 0.4;
}
if (os_device = device_ios_ipad || os_device = device_ios_ipad_retina) {
global.dpiScaleFactor = 0.7;
}


global.dpiScale *= global.dpiScaleFactor;

global.vibrate = true;
global.audioVolume = 1;
Expand Down
Binary file added minisweeper/options/ios/icons/app/ipad_152.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 minisweeper/options/ios/icons/app/ipad_76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 minisweeper/options/ios/icons/app/iphone_120.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 minisweeper/options/ios/icons/app/iphone_180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 35 additions & 35 deletions minisweeper/options/ios/options_ios.yy

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

Binary file added minisweeper/options/ios/splash/ipad_landscape.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 minisweeper/options/ios/splash/ipad_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 18 additions & 1 deletion minisweeper/scripts/scr_draw_cell/scr_draw_cell.gml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ var _yy = (100+yy*160 - oCamera.y)*_scale;
var _sScale = _scale;
_scale = _scale * mipScale;

if finalActive {
var _time = (finalPressTime * 120) - 7;
var _xx2 = 100+xx*160;
var _yy2 = 100+yy*160;
var _dist = point_distance(finalPressX, finalPressY, _xx2, _yy2)/2;
var _intense = 1-abs(100 - power(_dist,0.9999) + (value_suppress(_time+7,0.05)-7)*10)/100;
if _intense >= 0 && _dist < 900 {
_intense *= (1-_dist/900);
var _dir = point_direction(finalPressX, finalPressY, _xx2, _yy2)
_scale *= 1+_intense/3.5;
_xx += lengthdir_x(_intense*18,_dir)*_sScale;
_yy += lengthdir_y(_intense*18,_dir)*_sScale;
}
}

if (_mask) {
draw_sprite_ext(sMask,mip,_xx,_yy,_scale,_scale,0,global.backColor,1);
}
Expand All @@ -20,6 +35,7 @@ if (clearedGrid[# xx,yy]) {
_alpha = 1 - hideOnResetTimer;
}

if (global.clearedColor != global.backColor)
draw_sprite_ext(sSquare,mip,_xx,_yy,_scale,_scale,0,global.clearedColor,_alpha);

var _count = nearGrid[# xx,yy];
Expand Down Expand Up @@ -52,6 +68,7 @@ if (clearedGrid[# xx,yy]) {
var _ySize = ease_backOut(0,1,flagEaseGrid[# xx,yy],1, 3.5);
var _xSize = lerp(_ySize, ease_expoIn(0,1, flagEaseGrid[# xx,yy], 1),0.5);
if (lost && mineGrid[# xx,yy]) {
#region Flagged mine on loss
var _mineEase = mineEaseGrid[# xx,yy];
var _shiftX = _sScale*-2*_mineEase;
var _shiftY = lerp(30,15,_mineEase)*_sScale;
Expand All @@ -65,7 +82,7 @@ if (clearedGrid[# xx,yy]) {
var _size = ease_backOut(0,0.76,mineEaseGrid[# xx,yy],1, 3.5);
var _shift = _sScale*15*_mineEase;
draw_sprite_ext(sMine,mip,_xx+_shift,_yy+_shift,_scale*_size,_scale*_size,0,global.mineColor,1);

#endregion
} else {
draw_sprite_ext(sFlag,mip,_xx,_yy+30*_sScale,_scale*_xSize,_scale*_ySize,0,global.flagColor,1);
}
Expand Down

0 comments on commit bc63abe

Please sign in to comment.