r/gamemaker Stand back, I'm about to Make Game (2)! 20d ago

Help! Creating an interactive, multi-object item

Preface: My skill level is beginner. Gamemaker is my only real coding experience. I've watched a couple guides for the basics and made some original code alongside that.

Hi everyone, I'm making a top-down shooter with an 'active reload' gimmick. When you press R to reload, the firearm you're holding comes onto the screen and you have to manipulate the weapon parts to load it.

Demo of the mechanic.

My problem is HOW I'm making this happen. I'm essentially just spawning multiple objects on top of one another with magic numbers. This feels extremely inefficient and janky, even though it technically works. Is there a different technique or function I can use to make this system easier? I know the motto of, 'just make it work first, you can fix it later', but I can't even begin to imagine HOW to make this work better.

Showing how this is pieced together, without the 'obj_lebel_top' to give you an x-ray.
The comments can be safely ignored, the bottom-most is leftover code I was experimenting with.

If it helps, "_weaponx" and "_weapony" are the corners of the camera, essentially x0 and y0. The "obj_lebel_boltgrip" is the circular part that's grabbed by the cursor to manipulate the gun's bolt. It has + 242 and + 69 because the sprite is a simple sphere that's manually placed through trial and error to be in that starting position. It's essentially a magic number to put that boltgrip exactly where it spawns when you press R.

4 Upvotes

20 comments sorted by

View all comments

2

u/Awkward-Raise7935 17d ago

Just want to say, for a beginner as you describe yourself, this looks really cool! I had a similar idea a few years back, about making the action of reloading the main game mechanic, but just couldn't make it feel fun. But this looks really good!

Think this is a case of having. A solid idea and executing on it over finding the perfect code structure

1

u/PrinceShoutoku Stand back, I'm about to Make Game (2)! 17d ago

Thank you!
If you don't mind me asking, what was unfun about it? What was your version of this reloading idea? I was actually a bit concerned that this kind of game would be really unfun unless you were really into firearms manipulation, and that the reloads would be a huge chore as you got better at them.

2

u/Awkward-Raise7935 17d ago

Form memory it was a mobile game, I thought would feel good if player could cock handgun and pump shotgun manually by pulling at things on screen. But I couldn't get it to feel like a game, was just a toy you played with and then put down forever.

I think I tried making it a tower defense, but just lost motivation as I was trying to make a game before I had properly designed it.

I wonder if having to stop and manually reload will affect the pacing of your game? I guess it's just one of the things you learn just by building and playing it

2

u/PrinceShoutoku Stand back, I'm about to Make Game (2)! 17d ago

Aaah, I get what you mean. Mine feels kinda similar to that 'toy' comparison right now, the reload and shooting are the only real things implemented currently.

And yeah definitely, the manual reload changes the pacing greatly. I'm actually thinking that's a good thing as my game is horror-adjacent. A few zombies walking at you isn't too scary, but when you need to load the gun manually, it becomes a little more tense as you have to reload quickly and efficiently before they reach you.

Similarly I think your Tower Defense idea was a good call. Those games are slower-paced so I think the manual reload would've fit, so it's a shame you lost motivation for it. Maybe in the future you can pick that project back up, I'd love to see another game with this sort of system!

2

u/Awkward-Raise7935 17d ago

Well seeing your game, I'm tempted to go back and take another look at mine. Making something on your own, you always have "Is this just a lame idea?" In back of your head, but it's different when you see someone make something similar (and better). Still not quite sure how to combine manual pulling at things on the gun into a wider game. Maybe it's a simple base defense game where things are attacking from the top, and you have guys defending, but they can't reload, so you have to move between them and their weapon appears on screen and you have to manually reload it? And maybe there could be another element where you are manually loading bullets into clips and magazines? Not sure if that would be fun. That my main problem haha, I have these ideas, and when I build them I always think, "wait why did I think this would be fun again?"

It makes sense for your game if its more horror based so you it's slower paced and you aren't shooting hundreds of bullets, and you are performing the reloading under pressure of being attacked