Everyone needs a break while playing a game, learn how to add that functionality to your game here! It’s versatile, and you can use it for GMS 1 and GMS 2.

Source Code: (notepad document)

Check out my GameMaker Studio course on Udemy for only $9.99:

Check out our website @ www.beyondusgames.com
Connect with us on Twitter @BeyondUsGames
Support us on Patreon @ www.patreon.com/beyondusgames

Outro Music courtesy of OC Remix.

Nguồn: https://shaarique.com/

Xem thêm bài viết khác: https://shaarique.com/game/

13 Comments

Josephine Powell

June 29, 2020

Is there any way to stop from drawing sprites that are not visible? Such as transition areas and such.

Reply

Danny Jensen

June 29, 2020

This works great thanks! Only thing is some instances in my game are marked as not visible, but they are drawn to the screen in my draw event. So I put this line
if instance_find(all, i).visible == true {
around my draw_sprite_ext code, but I get the error that unknown_object.visible not set before reading it. How can a built in variable not be set? By default all objects are set to visible so I'm not sure why I get this error, can anyone help plz?

Reply

VildStyle

June 29, 2020

That's a cool system. One small thing I'd like to point out is surely it's more efficient to assign instance_find(all, i) to a variable, and reference that variable within the for loop? Currently, you're calling instance_find 10 times per loop as opposed to once per loop. Small, but might help

Reply

Razorik

June 29, 2020

Wow! This was incredibly helpful!
I was actually going to do something kinda simple like take a screenshot and paste it over but I like your method better. Thanks for the video!

Reply

Darth Stal

June 29, 2020

it doesnt work anymore :/ . i get an error that i havent said if it was flase or true before if statement. if i do esc key does nothing

Reply

Igor Sandu

June 29, 2020

9:20 – Wrong! It works like that in other languages, but not in GML! "i" will be destroyed after WHOLE event "Key Press – Escape" will be executed.
It's easy to check:
for (var i = 0; i < 10; i++)
{

}
new_variable = i;
That will not create a mistake. "new_variable" will be equal to 10.

Reply

silent_lesch

June 29, 2020

You could just catch all the objects at application surface, store the surface, and then just draw it until unpause.

Reply

J_C

June 29, 2020

Thanks for the tutorial. I read about a similar way to do this, which proved to be working quite well for me. Just before you deactivate the objects, you take a screenshot of the screen and display it. You do it through creating a sprite from the applicaton surface and save that sprite in a varible. Then draw the sprite on the surface. This way I didn't have to manage all the different objects. And when unpaused you destroy the sprite.

Reply

Taencred

June 29, 2020

Hi Beyond Us Games. I have another problem that I'm not able to solve.

When paused, other objects start to appear on top of the player. I assume this has to do with the fact that they're redrawn after the player and therefore end up on top in the paused state. For example, if I walk up to a wall, I've made it so that the collision check only checks the bottom of my character, and therefore the character is beheaded by the wall when I pause. Any suggestion for an easy fix on controlling in which order things are redrawn during the pause? Sorry if I'm just missing something simple here but I'm rather new to data structures and arrays overall.

Cheers.

Reply

Elmin NCF

June 29, 2020

nice work!

Reply

Dino Donut Man

June 29, 2020

Hey could you do a 2.5 Denison tutorial I've been trying to make my own with no luck

Edit: for a platformer

Reply

Galewolf

June 29, 2020

Hey, could you make a tutorial Projectile Motion in GMS2?

Reply

Aqare

June 29, 2020

thanks for this helpful video, and your udemy course also seems to be interesting. are you actually planning to make an advanced udemy course one day?

Reply

Leave a Reply