SanDeity
Member
Hello everybody! I am somewhat new to Game Maker and I am using Game Maker 2. This is my first post on here and I have used the community without making an account for a long time to help solve issued I had with programming but I have recently run into a slight issue with a big project I am working on. Unfortunately I don't want to give away too much information about what I am creating because I like to keep things secret and a surprise. Anyway I will present a scenario with what I am trying to do and what I want to do and see if anyone can help me out!
To start, I am trying to create a section of a game where you are in one room and different things can happen. The player is not free roam so I have an object in a location where the player can be. I would like the player to be able to hold right or left and have the object move to 2 different locations while holding down the direction. In all three of these locations they will have multiple different actions say: jump, dodge, attack, ect. While jumping they should have different interactions with a collision than if they were attacking. I am struggling to figure out a way to get this to work smoothly.
The complex part about this is that while blocking I would like them to be able to hold down the block button and have the sprite change to blocking sprite, with a different interaction than if they were to press nothing. However when they attack or jump I need the sprite to change for a set amount of time, and set a cool down on that so they can't infinitely jump giving I-frames at all times.
Now: what I have done is I set up a default object that if you press nothing, it does nothing. I have about 9 separate objects that will move to location on screen if a button is held and will move off if it is not pressed. The way I am doing this is on the main object I have global.stance set to 0 and it changes to -1 for left or 1 for right. Then it also changes to -2 for left and blocking, 2 for right and blocking. I also have some extra events fit in where if you are in stance 1 or 2 the background will move.
I am running into multiple issues with this setup and and having trouble finding different ways to code this room. Is there a better setup I can run where the object moves and switches sprites, and as certain events are activated (such as jumping) it will swap the sprite and hit box to a different one with a different interaction for room_speed setting off an alarm to set up a cool down for it and changing back to original sprite? Or is there another way I just don't know about yet that would work even better?
Thank you for your time and please let me know what resources I can use to figure this out or how I can code this whole sequence better.
To start, I am trying to create a section of a game where you are in one room and different things can happen. The player is not free roam so I have an object in a location where the player can be. I would like the player to be able to hold right or left and have the object move to 2 different locations while holding down the direction. In all three of these locations they will have multiple different actions say: jump, dodge, attack, ect. While jumping they should have different interactions with a collision than if they were attacking. I am struggling to figure out a way to get this to work smoothly.
The complex part about this is that while blocking I would like them to be able to hold down the block button and have the sprite change to blocking sprite, with a different interaction than if they were to press nothing. However when they attack or jump I need the sprite to change for a set amount of time, and set a cool down on that so they can't infinitely jump giving I-frames at all times.
Now: what I have done is I set up a default object that if you press nothing, it does nothing. I have about 9 separate objects that will move to location on screen if a button is held and will move off if it is not pressed. The way I am doing this is on the main object I have global.stance set to 0 and it changes to -1 for left or 1 for right. Then it also changes to -2 for left and blocking, 2 for right and blocking. I also have some extra events fit in where if you are in stance 1 or 2 the background will move.
I am running into multiple issues with this setup and and having trouble finding different ways to code this room. Is there a better setup I can run where the object moves and switches sprites, and as certain events are activated (such as jumping) it will swap the sprite and hit box to a different one with a different interaction for room_speed setting off an alarm to set up a cool down for it and changing back to original sprite? Or is there another way I just don't know about yet that would work even better?
Thank you for your time and please let me know what resources I can use to figure this out or how I can code this whole sequence better.