Skip to content

Commit

Permalink
Reimplement pause.
Browse files Browse the repository at this point in the history
  • Loading branch information
yancharkin committed Jun 29, 2017
1 parent 1b8b900 commit ad6dd58
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 9 deletions.
103 changes: 103 additions & 0 deletions objects/oGame.object.gmx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ globalvar debug;
debug = false;
global.ghostExists = false;

paused = false;

damsel = false;
idol = false;
altar = false;
Expand Down Expand Up @@ -387,6 +389,48 @@ if (global.mobileBuild == true)
{
scrTouchInputEnable();
}
</string>
</argument>
</arguments>
</action>
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>///Pause
if (paused)
{
strLen = string_length(global.Paused)*16;
posX = ceil((global.display_w - strLen) / 2);
draw_set_font(global.myFont);
draw_set_color(c_white);

if (global.mobileBuild)
{
draw_text(posX, 112, global.Paused);
}
else
{
draw_text(posX, 100, global.Paused);
strLen = string_length(global.EscReturnF10Quit)*8;
posX = ceil((global.display_w - strLen) / 2);
draw_set_font(global.myFontSmall);
draw_text(posX, 120, global.EscReturnF10Quit);
}
}

</string>
</argument>
</arguments>
Expand Down Expand Up @@ -666,6 +710,30 @@ if (false and room == rLevel and instance_exists(oXMarket))
draw_text(oPlayer1.x-24, oPlayer1.y-48, string(oPlayer1.x-oXMarket.x));
draw_text(oPlayer1.x, oPlayer1.y-48, string(oPlayer1.y-oXMarket.y));
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="9" enumb="121">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>///Exit
game_end();
</string>
</argument>
</arguments>
Expand Down Expand Up @@ -714,6 +782,41 @@ else
</arguments>
</action>
</event>
<event eventtype="9" enumb="27">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>///Pause
if (not paused)
{
instance_deactivate_all(true);
audio_pause_all();
paused = true;
}
else
{
paused = false;
instance_activate_all();
audio_resume_all();
}
</string>
</argument>
</arguments>
</action>
</event>
</events>
<PhysicsObject>0</PhysicsObject>
<PhysicsObjectSensor>0</PhysicsObjectSensor>
Expand Down
4 changes: 2 additions & 2 deletions objects/oTitle.object.gmx
Original file line number Diff line number Diff line change
Expand Up @@ -303,15 +303,15 @@ alarm[1] = 100;
if (gamepad.attackPressed) gamepad.attackPressed = false;
if (gamepad.startPressed) gamepad.startPressed = false;
global.titleStart = 2;
room_restart();
//room_restart();
}
}
else
{
if (gamepad.attackPressed) gamepad.attackPressed = false;
if (gamepad.startPressed) gamepad.startPressed = false;
global.titleStart = 2;
room_restart();
//room_restart();
}
}

Expand Down
8 changes: 5 additions & 3 deletions scripts/scrTouchInputEnable.gml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ virtual_key_add(global.display_w - vkey_size, global.display_h - (1.5*vkey_size)
virtual_key_add(global.display_w - (2.5*vkey_size), global.display_h - (2.5*vkey_size), vkey_size, vkey_size, ord('C'));
// Action
virtual_key_add(global.display_w - (2.5*vkey_size), global.display_h - vkey_size, vkey_size, vkey_size, ord('X'));
// Pause
virtual_key_add(global.display_w - vkey_size, 0, vkey_size, vkey_size, vk_escape);
// Hide touch controls
virtual_key_add(global.display_w - vkey_size, 0, vkey_size, vkey_size, ord('F'));
virtual_key_add(global.display_w - 2*vkey_size, 0, vkey_size, vkey_size, ord('F'));
// Purchase
virtual_key_add(global.display_w - vkey_size, vkey_size, vkey_size, vkey_size, ord('P'));
// Rope
Expand All @@ -45,13 +47,13 @@ if (global.touchControlsVisible == 1)
{
draw_sprite(TouchArrowsSemiTr, -1, 0, global.display_h - (3*vkey_size));
draw_sprite(TouchButtons1SemiTr, -1, global.display_w - (2.5*vkey_size), global.display_h - (2.5*vkey_size));
draw_sprite(TouchButtons2SemiTr, -1, global.display_w - vkey_size, 0);
draw_sprite(TouchButtons2SemiTr, -1, global.display_w - 2*vkey_size, 0);
}
else if (global.touchControlsVisible == 2)
{
draw_sprite(TouchArrowsOp, -1, 0, global.display_h - (3*vkey_size));
draw_sprite(TouchButtons1Op, -1, global.display_w - (2.5*vkey_size), global.display_h - (2.5*vkey_size));
draw_sprite(TouchButtons2Op, -1, global.display_w - vkey_size, 0);
draw_sprite(TouchButtons2Op, -1, global.display_w - 2*vkey_size, 0);
}
else if (global.touchControlsVisible == 0)
{
Expand Down
4 changes: 2 additions & 2 deletions sprites/TouchButtons2Op.sprite.gmx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<sepmasks>0</sepmasks>
<bboxmode>0</bboxmode>
<bbox_left>0</bbox_left>
<bbox_right>31</bbox_right>
<bbox_right>63</bbox_right>
<bbox_top>0</bbox_top>
<bbox_bottom>127</bbox_bottom>
<HTile>0</HTile>
Expand All @@ -17,7 +17,7 @@
<TextureGroup0>0</TextureGroup0>
</TextureGroups>
<For3D>0</For3D>
<width>32</width>
<width>64</width>
<height>128</height>
<frames>
<frame index="0">images\TouchButtons2Op_0.png</frame>
Expand Down
4 changes: 2 additions & 2 deletions sprites/TouchButtons2SemiTr.sprite.gmx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<sepmasks>0</sepmasks>
<bboxmode>0</bboxmode>
<bbox_left>0</bbox_left>
<bbox_right>31</bbox_right>
<bbox_right>63</bbox_right>
<bbox_top>0</bbox_top>
<bbox_bottom>127</bbox_bottom>
<HTile>0</HTile>
Expand All @@ -17,7 +17,7 @@
<TextureGroup0>0</TextureGroup0>
</TextureGroups>
<For3D>0</For3D>
<width>32</width>
<width>64</width>
<height>128</height>
<frames>
<frame index="0">images\TouchButtons2SemiTr_0.png</frame>
Expand Down
Binary file modified sprites/images/TouchButtons2Op_0.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 sprites/images/TouchButtons2SemiTr_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ad6dd58

Please sign in to comment.