Well I can already make the game stop and show a popup message, but to unpause the game with my method, any key will play it. What I want is for only "P" to unpause it.A simple method is to show a pop-up message.
Press P Eventshow_message("Game Paused");You can customize the message by changing the defaults. The size, background, buttons etc.
Another method is to temp save the game, move to another room (like an options menu) and to continue simply re-load the game. This will also work with Lite versions.
Press P Eventgame_save(temp_directory+"\tmpsave.sav"); room_goto(options_room);Continue Button or Key Eventgame_load((temp_directory+"\tmpsave.sav");
Either can be used with Lite and both are simple to implement.
- Game Maker Community
- → Viewing Profile: Posts: FOGHAT
FOGHAT
Member Since 16 Apr 2012Offline Last Active Apr 20 2013 05:54 PM
Community Stats
- Group GMC Member
- Active Posts 95
- Profile Views 742
- Member Title GMC Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
-
Version
Unknown
Friends
FOGHAT hasn't added any friends yet.
Posts I've Made
In Topic: Pause Help
19 February 2013 - 03:05 AM
In Topic: Pause Help
17 February 2013 - 11:03 PM
How elaborate do you want the pause?
Professional looking or just functional?
Obviously you will vote for the first but the first may mean adding a lot of code.
So then.
How elaborate do you want the pause, easy or hard?
I can do either.
Well if you can do either than the professional one, but i don't have gm pro,
so all codes need to be useable by the free version.
In Topic: Full collision with the ground
05 January 2013 - 12:24 AM
Alright, here are my codes:Post your code, some pics and the collision mask of the player sprite
//jump
if keyboard_check(vk_up)||keyboard_check(ord("W")) && !place_free(x,y+1)
vspeed = -14.5;
if place_free(x,y+1)
gravity = 3;
else gravity = 0;
if vspeed > 13
vspeed = 13;
And the collision mask sprite is:
32x32
The actual mask is 8 hight 9 width
and is sentered 11 pixels from the far left and is plased at the bottom of the sprite
The origin is x 16 y 23
In Topic: Full collision with the ground
04 January 2013 - 11:37 PM
the move_to_contact function doesn't work 100% of the time, because it will contact the first object it comes into contact with. So for example if you had a powerup sitting on the ground and you fell onto it from above, move_contact_all would stop at the powerup and not the ground.
In the Game Maker's Companion book they went over this, and they gave this script to use in it's place, where you can name the object you want to contact with to avoid this problem.// An alternative to the "Move To Contact" action that allows for contact with a specified object / instance { var dirn, max_dist, contact_obj, dx, dy; dirn = argument0; max_dist = argument1; contact_obj = argument2; if( max_dist == -1 ) then max_dist = 1000; dx = lengthdir_x( 1, dirn ); dy = lengthdir_y( 1, dirn ); dist = 1; while( dist <= max_dist ) { if( place_meeting( x+dx, y+dy, contact_obj ) == true ) then return true; x = x + dx; y = y + dy; dist = dist + 1; } return false; }
To prevent the issue of going too fast and landing in the middle of an object, you need to set x and y to their value from the previous step before using the move contact function:x = xprevious; y = yprevious; //then use the script I linked above like: move_to_contact_with(direction,-1,obj_ground); //assuming you named the script move_to_contact_with and your ground object is named obj_ground
Would all of this be in the collision event?
In Topic: about the x += -= etc.
14 October 2012 - 04:52 PM
my new code
//controls
if keyboard_check(vk_left)||keyboard_check(ord("A"))
{
if place_free(x-4,y)
x -= 4;
else if place_free(x-3,y)
x -= 3;
}
if keyboard_check(vk_right)||keyboard_check(ord("D"))
{
if place_free(x+4,y)
x += 4;
else if place_free(x+3,y)
x += 3;
}
but thanks to every one!
- Game Maker Community
- → Viewing Profile: Posts: FOGHAT
- Privacy Policy
- GMC Rules and Forum Rules ·



Find content