More random RPG Stuff last night!

Published November 18, 2018
Advertisement

I don't always get crazy distracted. I did rpg stuff 2 days in a row! lol. 

Last night I was messing around making a pause menu -- I did a raid on Destiny 2 with the clan first of course! But for the longest time I just couldn't get it to unpause and sometimes it wouldn't even pause.. Something to do with the order of my commandy stuff and something about using Booleans it just didn't like what I was trying to do (I most probably did something wrong - rather than blame the game engine)

I would use if !global.paused then global.paused = true else global.paused = false ... i just assumed that it would alternate between the two when you click the space bar... But I'm thinking that maybe something to do with how it checks the key pressed and the speed at which it checks (30 times a second?) that you would be slow to not press the spacebar anymore so it'd activate both one after the other? I dunno... 

Ultimately this would work:


if keyboard_check_pressed(vk_space) //spacebar pauses the game
{
  global.paused = true;
}

if global.paused
{
  instance_deactivate_all(true); //Deactivate everything BUT this object
}

if global.paused && keyboard_check_pressed(vk_escape) //resume the game with escape key (later change to a button/mouse position type stuff)
{ 
  global.paused = false;
  instance_activate_all();
}

I used escape key instead of spacebar to unpause just to not risk double pressing spacebar but I'm confident it'd work with spacebar now too (I'm changed it since to do a check on the mouse position as this later will showup a highlighted icon to exit pause instead of hitting escape -- that all works fine now also) 

It was fun to mess around with even though it feels so simple. I mean I did end up trying to read online and there would people on a distant forum talking about saving a screenshot and going to another room (i don't know about the screenshot thing, its something about displaying the same screen as the background to that room.. I dunno) and the whole going to another room is what I'd usually do in other games like a space shooter, idle game, tower defense etc, I'd just make a 'shop room' and then have the game resume when you go back to the room like nothing happened but technically no pause feature... So finally I've managed to make one.

I'm using Game Maker Studio just because a couple of years ago Humble Bundle did a bundle with a bunch of licenses and source codes (I really should look at the source codes again, its been a while) and so I have the pro license for this software and not others... Maybe one day I'll move to another software. I'm kinda hoping Humble does a Game Maker Studio 2 software bundle because I think that has 3D stuff in it... Or you know make a super dope game that makes some money so you're rich and you can just buy all the softwares and be cool. I joke of course. 

unknown.png?width=1160&height=676

The end result of my menu. I'm currently making a 'test' project. In the background is my test house that I spent hours messing with the walls. Maybe tonight I'm going to add in an Enemy and try to make it do stuff.. (Not sure what yet though... I don't know if I want to have it fight 'now' or go to a battle screen...) I'm just using it to figure out all the things I'll need to do and then I can put them together properly. I'm coming up with a list of questions to ask/google as I'm progressing to try and figure out 'the best practices' for certain things. Like these icons have got set coordinates but I used a variable and then I update that variable to add the set coordinates (both X and Y as 2 variables each) to values such as view_xview and view_yview ... So when drawing them I just give info like iconOneX iconTwoY -- I realize that I've named these kinda wrong though because the OneX bunch will be the first column, TwoY would be the second row instead of the first and second icon.. But I understand it and I'm working solo so its alright for now...

BUT my query is about the highlight box... You're supposed to give it x & y of the top left corner AND x & y of the bottom right corner for it to make a square... I know what these coordinates will be but I'm not so sure if I'm supposed to put together like 12 more variables 6 x and 6 y positions because these would cover all the points in mixed combinations OR just use the original variables of iconOneX and then + or - the remaining value.. which for each would be 100 since all images are 200x200... I've done it where I use the original center point values and just + and - the 100 for each draw command. Otherwise I'd need to be adding view_xview and view_yview to all the 12 extra variables so it updates the position each time.. The original center point variables do this already... Now 'it works' which is obviously the desired result.. Now I just need to learn what's the best practice for keeping it clean... 

I wasn't really intending on writing it out in a blog post cuz I was going to spam the forums asking for help from brainiacs but I got carried away!! I've got other issues like a big list of em but I don't wanna do one huge post with 20 questions so I've gotta thoroughly google things first.. like when's it a good time to use a script instead of just adding the info into the draw event.. You can click on the quest icon (2nd icon - nothing is labeled yet) and it'll draw new stuff on top of the existing stuff, (Maybe it deletes the old drawings? Not sure) and then on top of that I've added elements that would be placeholders.. This drawing stuff is done via a script, using the step event to check mouse position within the walls of the quest icon 200x200 then if clicked it'll set 'quest' to true.. In the draw event if quest is true it runs the questMenu script... I figured it would be a good idea to use a script merely for keeping it clean so I don't have 8 long chunks of code waiting in the draw event based on things like quest = true, bag = true etc etc... Maybe that's wrong and I should just add all the info into the draw event... This is the whole point of learning it..

unknown.png?width=1160&height=676

 

Now, I'm not at art guy so I'm fully taking advantage of that Humble Bundle 2D Art Sale they currently have, And this is just a test project so my pause is just black n white... Either I'll find art, make a new friend or figure out a design myself for an actual project... I'm just getting the ability to put it together right now. ?

1 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement