/r/gamemaker

Photograph via snooOG

This subreddit is dedicated to providing programmer support for the game development platform, GameMaker Studio. GameMaker Studio is designed to make developing games fun and easy. Coders can take advantage of its built in scripting language, "GML" to design and create fully-featured, professional grade games. This subreddit is not designed for promoting your content and is instead focused on helping people make games, not promote them.

GameMaker is software designed to make developing games easy and fun. It features a unique "Drag-and-Drop" system which allows non-programmers to make simple games. Additionally, experienced coders can take advantage of its built in scripting language, "GML" to design and create fully-featured, professional grade games.

subreddit_guidelines()

Content that does not follow the subreddit guidelines is subject to deletion, so please become familiar with them.

  1. Content must be directly related to GameMaker
  2. Content must be in English
  3. Content must not be obscene, illegal, racist or offensive
  4. Content must not use "click-bait" titles, shortened links, or solicitation
  5. Content must demonstrate a previous effort and research before posting and must provide adequate detailed information
  6. Show respect to all users of the subreddit and have patience with other users when providing help
  7. Promotional content must contribute to the community
  8. Technical support requests are to be directed to YoYo Games Support
  9. Content must be appropriately flaired at the time of submission

community()

Conversation

/r/gamemaker sponsors three chat-rooms: IRC, a Discord server, and a Slack team. Join in the conversation, get help with any issues you might have and connect with your fellow developers! We also have a Steam Group for playing games. Feel free to join.

Scheduled content

Schedule Content Summary
Monday Quick Questions Ask questions, ask for assistance or ask about something else entirely.
Wednesday Game Design & Development Discuss game design and game development.
Friday Feedback Friday Play games and lend feedback
Saturday Screenshot Saturday Share the latest pictures and videos of your game
Monthly Monthly Challenge Are you in need of motivation? Then take a stab at these creative challenges.
Bi-weekly Community Spotlight Shining a light on high-quality projects and resources created by our community.

gm(48)

For more than 8 years, the tight-knit community of /r/gamemaker has run the game jam gm(48) for GameMaker developers of all ages and experience levels. The gm(48) is a casual, fun game jam that helps you to learn and grow as a developer.

The next gm(48) will take place on Oct 20, 2018.

/r/gamemaker

88,706 Subscribers

1

I need help with collision.

I have the following code for the player obj and am trying to get it to collide with the wall obj while being able to move along side it with making it come to a complete stop while any part of the player obj is touching the wall obj. The player obj just uses the move variable to move forward in the direction the sprite is facing while moveleft and moveright change the sprite direction. The code I have is the following:

move = keyboard_check (ord("W"));

moveleft = keyboard_check (ord("A"));

moveright = keyboard_check (ord("D"));

if (move)

{

direction = image\_angle;

speed = 0.5

move\_and\_collide(0, 0,  obj\_wallmain)

}else{

speed = 0

}

if (moveleft) image_angle +=2;

if (moveright) image_angle -=2;

With the code as is, the player goes through the wall, however adding anything other than 0 for the X and Y positions in the move_and_collide will result in the player flying off screen. I have also tried the place_meeting code but with the player have separate movement controls for all axis I am having trouble. The player is a tank and I would like to keep the movement the way it is.

0 Comments
2024/11/01
20:25 UTC

2

I need help with my movement code

I wanted to make the movement like in the (old) Pokémon games where if you press right, you first only look at the right, and if you press right again only then you walk. So like that you can face each (4) directions, without moving. I tried lots of things, but I can't quiet figure it out, it's so close!

What I have now (part of it, I also have code for running and walking(if you "walk" against a wall))

if (input_x != 0 or input_y != 0) {

`if (!moving) and (!walking) and (!running) {`

	`//prefer X over Y`

	`if (input_x !=0) input_y = 0;`

	

	`//new position`

	`var _new_tile_x = to_tile(x) + input_x;`

	`var _new_tile_y = to_tile(y) + input_y;`



	`//collision`

	`var _col = collision(_new_tile_x, _new_tile_y);`

	

	`move_direction = point_direction(0, 0, input_x, input_y);`

		

	`if (!_col) and (!idle) {`		

		`target_x = to_room(_new_tile_x + 0.5);`

		`target_y = to_room(_new_tile_y + 0.5);`

	

		`if keyboard_check(vk_shift) {`

running = true;

		`}`

		`else {`

moving = true;

		`}`	

	`}`

	`else {`

		`move_direction = point_direction(0, 0, input_x, input_y);`	

		`walking = true;`

	`}`

`}`

}

//moving

if (moving) {

`set_state(states.walk);`



`var _distance = point_distance(x, y, target_x, target_y);`



`if (_distance > walk_speed) {`

	`x += sign(target_x - x) * walk_speed;`

	`y += sign(target_y - y) * walk_speed;`

	`steps += 1;`

	

	`move_direction = point_direction(x, y, target_x, target_y);`

`}`

`else {`

	`x = target_x;`

	`y = target_y;`

	

	`moving = false;`

`}`

}

1 Comment
2024/11/01
19:06 UTC

0

How do I make a game studio for free?

How do I have it so I can have a name I can use that is trademarked

4 Comments
2024/11/01
19:05 UTC

1

I need help with distancing objects when instantiated

My goal is to distance each box when created. This my create event code. It works kinda fine if there's only one or two neighbors. However, with three or more, it loops endlessly. I'm still a beginner and stuck with this problem. Help and advice is greatly appreciated.

var neighbor = ds_list_create()
radius = 120;
while true {
collision_circle_list(x, y, (radius/2), obj_box, false, true, neighbor, true)
if (!ds_list_empty(neighbor)) {
while point_distance(x,y, neighbor[| 0].x, neighbor[| 0].y) < (radius/2){
if neighbor[| 0].x > x {
x--
} else {
x++
}

if neighbor[| 0].y > y {
y--
} else {
y++
}
}
ds_list_clear(neighbor)
} else {
break;
}
ds_list_clear(neighbor)
}

ds_list_destroy(neighbor)
2 Comments
2024/11/01
16:14 UTC

4

Work In Progress Weekly

"Work In Progress Weekly"

You may post your game content in this weekly sticky post. Post your game/screenshots/video in here and please give feedback on other people's post as well.

Your game can be in any stage of development, from concept to ready-for-commercial release.

Upvote good feedback! "I liked it!" and "It sucks" is not useful feedback.

Try to leave feedback for at least one other game. If you are the first to comment, come back later to see if anyone else has.

Emphasize on describing what your game is about and what has changed from the last version if you post regularly.

*Posts of screenshots or videos showing off your game outside of this thread WILL BE DELETED if they do not conform to reddit's and /r/gamemaker's self-promotion guidelines.

17 Comments
2024/11/01
12:00 UTC

4

for anyone that want to learn how to normalize the vector of his game here is how

it is very simple when you know it let's start with making the input I use input for my movement to keep it simple but you can use whatever you want

var move_x = input_check("right") - input_check("left");
var move_y = input_check("down") - input_check("up");

now that we have the input we can normalize using this

var magnitude = sqrt(move_x * move_x + move_y * move_y);

now that is all it takes to normalize this is a very simple math sqrt 1 is 1 and sqrt 2 is 1.4 what we need

but now we need to move the player so we use this

if (magnitude > 0) {
    move_x /= magnitude;
    move_y /= magnitude;
}

x += move_x;
y += move_y;

and by doing that we get

var move_x = input_check("right") - input_check("left");
var move_y = input_check("down") - input_check("up");

var magnitude = sqrt(move_x * move_x + move_y * move_y);

if (magnitude > 0) {
    hspd /= magnitude;
    vspd /= magnitude;
}

x += hspd;
y += vspd;

if you want

x += hspd * spd;
y += vspd * spd;
4 Comments
2024/11/01
08:41 UTC

1

Chatterbox / Crochet audio help

I am trying to set up audio to play at certain points of dialouge (SFX). The way it is setup currently on crochet gives me an error on gamemaker (I show the error at the end of the video) When I put the "<<set $sound to "boom">>" on the first line like "<<set $sound to "Stop">>" was it plays the audio but then the other 2 dialogue options do not show up. Video Link (Youtube unlisted video)

4 Comments
2024/10/31
17:56 UTC

8

banned due to spam allegations!!

i had registered for the forum like an hour ago, checked like 2 threads being directed from google, so i didnt post a thread or even a post, yet i got the ban message "You have been banned for the following reason: Spam. Please contact the administrator if this was done in error.."
nothing i can do on the forum itself neither i can see a link to an administrator
anyway i know whats going on and how to fix this?

7 Comments
2024/10/31
13:04 UTC

1

One objects with two sprites with different side and learning about the start up animation for coding (I do not know how or can't find any tutorials to learn what I needed or wanted)

So I need help. I am a beginner code and cannot be able to find a way to code the start up ainmation and check if there is a better optimised way to code (it is in dire of checking by professional or advance and... some is used by AI since im a beginner ): )

Codes down here:

// Sprite Control
// Walking
// Sprite Handling
if (xspd > 0) {
sprite_index = walksprite; // Moving right
} else if (xspd < 0) {
sprite_index = walkspriteflip; // Moving left
} else {
// Determine which idle sprite to use based on last direction
if (sprite_index == walksprite) {
sprite_index = idlesprite; // Use idle sprite facing right
} else if (sprite_index == walkspriteflip) {
sprite_index = idlespriteflip; // Use idle sprite facing left
}}

// Handle jumping sprite
if (!onground) {
if (yspd < 0) {
sprite_index = Midairsprite; // Mid-air going up
} else if (yspd > 0) {
sprite_index = Downairsprite; // Mid-air going down
}}

// Variables
var is_startup_running = false;
var startup_duration = 0.5; // Duration in frames (e.g., 1 second at 60 FPS)
var startup_timer = 0;

// In Step Event
if (abs(xspd) >= movespd[1] && !is_startup_running) {
// When moving at or above running speed and not in startup phase, set the appropriate running sprite
if (xspd > 0) {
sprite_index = Startuprunsprite; // Normal running right
} else if (xspd < 0) {
sprite_index = StartuprunspriteFlip; // Normal running left (flipped sprite)
}
is_startup_running = true;
startup_timer = room_speed; // Reset timer to full duration
}
// Check if startup running has ended
if (is_startup_running && abs(xspd) < movespd[1]) {
if (startup_timer > 0) {
startup_timer -= room_speed;
} else {
is_startup_running = false;
sprite_index = runningsprite; // Switch to normal running sprite
}
}
// Draw Event (or wherever you draw the startup timer)
draw_text(room_width / 2, room_height / 2, "Startup Timer: " + string(startup_timer));
//masking
mask\_index = idlesprite;

Sprites down here:

https://drive.google.com/drive/folders/1lrqBxc94ACX_t3F9TMC4xnRPkM7itTP7?usp=sharing

Upvote1Downvote0Go to comments
So I need help. I am a beginner code and cannot be able to find a way to code the start up ainmation and checking if there is a better way to find to use two different sided sprite (it is in dire of checking by professional or advance and better way since ... some is used by since im a beginner ): )

Codes down here:

// Sprite Control
// Walking
// Sprite Handling
if (xspd > 0) {
sprite_index = walksprite; // Moving right
} else if (xspd < 0) {
sprite_index = walkspriteflip; // Moving left
} else {
// Determine which idle sprite to use based on last direction
if (sprite_index == walksprite) {
sprite_index = idlesprite; // Use idle sprite facing right
} else if (sprite_index == walkspriteflip) {
sprite_index = idlespriteflip; // Use idle sprite facing left
}}

// Handle jumping sprite
if (!onground) {
if (yspd < 0) {
sprite_index = Midairsprite; // Mid-air going up
} else if (yspd > 0) {
sprite_index = Downairsprite; // Mid-air going down
}}

// Variables
var is_startup_running = false;
var startup_duration = 0.5; // Duration in frames (e.g., 1 second at 60 FPS)
var startup_timer = 0;

// In Step Event
if (abs(xspd) >= movespd[1] && !is_startup_running) {
// When moving at or above running speed and not in startup phase, set the appropriate running sprite
if (xspd > 0) {
sprite_index = Startuprunsprite; // Normal running right
} else if (xspd < 0) {
sprite_index = StartuprunspriteFlip; // Normal running left (flipped sprite)
}
is_startup_running = true;
startup_timer = room_speed; // Reset timer to full duration
}
// Check if startup running has ended
if (is_startup_running && abs(xspd) < movespd[1]) {
if (startup_timer > 0) {
startup_timer -= room_speed;
} else {
is_startup_running = false;
sprite_index = runningsprite; // Switch to normal running sprite
}
}
// Draw Event (or wherever you draw the startup timer)
draw_text(room_width / 2, room_height / 2, "Startup Timer: " + string(startup_timer));
//masking
mask\_index = idlesprite;

Sprites down here:

https://drive.google.com/drive/folders/1lrqBxc94ACX_t3F9TMC4xnRPkM7itTP7?usp=sharing

2 Comments
2024/10/31
10:46 UTC

1

Restart Menu pop-up in GameMaker

I'm developing a game which I learned from 'How to make a Video game in 15 mins' by GameMaker's youtube channel.

But I'm stuck at one point, which is making a 'Restart pop-up menu' when the player loses all 3(dies) I made the obj_Menu with 'Restart and Exit' buttons, in room_Menu, that will load when player dies.

For Restart button I used room_restart() in hopes of loading the current level of the game. Then I tried using room_goto_previous, but that's loading the Level_2 which is places above the room_Menu.

Any or every help is appreciated. Thanks in advance.

#GameMaker #RestartButton

8 Comments
2024/10/31
09:32 UTC

1

Trying to learn Sequences in GameMaker!

Hi,

I found this tutorial https://www.youtube.com/watch?v=tqhpyUCYZ1s
But I wish if there are more detailed tutorial on sequences, the above is really good but still a bit difficult to understand maybe I'm dumb.

I can create a basic sequence like a cutscene and even create it on layer using scripts.
But I'm trying to learn to create similar big ship object with sequences. Is there any official GameMaker YT detailed sequences video tutorial!

Thanks and appreciate any help.

0 Comments
2024/10/31
06:56 UTC

3

Disabling mouse acceleration for first-person game

Hello all, I've been programming a simple 3D FPS game in Gamemaker Studio 2 and have noticed that I can't seem to disable mouse acceleration (i.e., the effect of having 'Enhance pointer precision' enabled in Windows settings) from affecting the cursor in game, which makes it difficult to aim if the player ever moves the mouse quickly.

I understand most 3D engines have an option to access raw input actions before they're modified by the OS, and was trying to find a similar option in the Gamemaker manual, but even using device_mouse_raw_x/y still factored in mouse acceleration.

I was initially changing the player's horizontal look angle each step with 'device_mouse_x(0) - window_get_width()/2', then tried changing it to 'device_mouse_raw_x(0) - window_get_width()/2' and also tried just using 'window_mouse_get_delta_x()' to get the cursor's change in x position each step. All of them work fine to have a functional 3D cursor, but none of them bypassed the mouse acceleration like other 3D games are able to; flicking the mouse quickly will always make the cursor move way further than it would without mouse acceleration enabled.

Is there a way to bypass it and access the true raw mouse inputs, or will I have to essentially program my own completely separate cursor from the device cursor? Any help or suggestions would be greatly appreciated!

4 Comments
2024/10/31
06:51 UTC

5

help with enemy ai

hello!
i need a little help with basic programming
basically i just want my enemy ai to stop bumping into walls and get stuck in them, so they can avoid the walls and keep pursuing the player

here's my code

if distance_to_object(obj_player)<=500{

direction= point_direction(x,y,obj_player.x,obj_player.y);

speed= 20;

if distance_to_object(obj_wall) <=50{

direction= point_direction(x,y,obj_wall.x, obj_wall.y)

speed=-15

direction= point_direction(x,y,obj_player.x,obj_player.y);

speed= 20;

}

4 Comments
2024/10/31
03:28 UTC

2

Can I run gamemaker/gamemaker 2 on steam deck?

Hey guys, I am a new game dev student, and was wondering if it is possible to use either of these softwares on a steam deck? My old gaming laptop is absolutely crapping the bed by now, only really used for schoolwork but I use a steam deck with a dock setup at home for more or less everything else, and its been an absolute blast to use. I would much prefer developping my own game projects on this device than having to use my windows 11 laptop for multiple reasons that boil down to practicality. When i looked on the steam page it did say that it was not compatible, but I kept thinking there might be a way to make it work correctly if I put my mind to it. Would love some inputs on this, thank you in advance!

13 Comments
2024/10/31
02:17 UTC

0

Collision event not working

i added a collision event betwin my bullet and my target, once the bullet hits the target the bullet plays its animation, once its anymation is over it spawns in a explosion object, the explosion object plays its animation in place with not gravity or movment to it.

my problem is that before i had added the collion event (was using place_meeting) everything worked fine, but now when i spawn the explosion, sometimes the explosion just does not start its animation and just fall until hitting the ground

2 Comments
2024/10/31
00:02 UTC

0

I want to create a 2D RPG, but is it possible to build a dialogue system without coding?

I think managing a dialogue system with code can be quite difficult, especially for games with a lot of dialogue. Are there any extensions or tools that can help with this?

14 Comments
2024/10/30
21:37 UTC

1

Pixel squishing when in windowed mode, my room and camera resolution are 480x270 and my viewport is 1920x1080. How do i fix this?

3 Comments
2024/10/30
17:00 UTC

1

How to find the corner point of a bounding box?

I'm trying to make a sonic game and need to find the corner of a bounding box for the precise collisions and slope/angle calculations. I have set my sprite's collision to "Rectangle with Rotation", but while it does function correctly, it returns incorrect values using the bbox read only functions, as if it's still a mask with no rotation. Does anybody have the solution?

10 Comments
2024/10/30
11:12 UTC

6

How do i make a fallout style speach system.

I want to make a open ended game but im stuck at how to impliment the speach options like in fallout/underrail. Do i just make a bunch of bool statements that activate if you choose a scertant option, and then those bool operators affect wich array the text is being taken from?

4 Comments
2024/10/30
09:35 UTC

1

Changing a Tileset's Mask

I have a tileset, and I want to have precise collisions with it, which I can do with place_meeting(). However, there some parts of the tileset that I would want to edit the collision mask for. It seems I either need to have it be a rectangle or be exactly the same shape as the tileset's sprite. I know how to edit the mask_index of an object, but a tilemap is a different system that I don't get.

4 Comments
2024/10/30
04:59 UTC

5

dose anyone know how to make the camera pan like this?

3 Comments
2024/10/30
03:11 UTC

65

I keep working on the level editor for more than 6 months. And I have some thoughts to share. Read the comments!

21 Comments
2024/10/30
02:36 UTC

4

how do i create a teleportation system?

i want the player to teleport back to their original place when passing a certain area

sorry for the bad font

4 Comments
2024/10/30
01:38 UTC

6

Create pickup items in GameMaker

1 Comment
2024/10/30
00:39 UTC

3

Can't find setting?

Hey, learning to code in Gamemaker. Made asteroids, now following this small tutorial https://youtu.be/0uo2_ytDgFI?t=131

"Used for 3D (Must be a power of 2)"

I never used the old version of GM and can't figure out where this option is :(

https://preview.redd.it/0803rnrpfrxd1.jpg?width=457&format=pjpg&auto=webp&s=59e2179d7e39b18da85d1b5749a54bac9e14d04b

5 Comments
2024/10/29
21:04 UTC

1

Need Help with GameMaker HTML5 Export - Pixel Art Looks Blurry

This is my first time coding and making a game, and I’ve been using GameMaker for it.

It's a pixel art game so the dimensions are pretty small—around 600px in width. I tried creating an executable to upload on itch.io, but I ran into a problem when using the HTML5 export.

When I play the HTML5 version of my game, the visuals look really weird—blurry, distorted, and not crisp like they do in the GameMaker preview. I was wondering if anyone else has run into this issue and how to fix it?

https://preview.redd.it/fokhcaqaqqxd1.png?width=1688&format=png&auto=webp&s=28c8dd53df0191f0c42e4aeef4ede084c32498be

2 Comments
2024/10/29
18:45 UTC

1

How am I able to make my camera zoom out more?

I have a perfectly working camera, however I would like it to zoom out a bit more. The issue is, when I set my view_width and view_height to 1 it's too far away, but when its 2 it's too close, and it has to be a full number (no 1.2's or 1.5's etc) Here's my cameras code.

Create:

view_width = 1920/2;

view_height = 1080/2;

window_scale = 3;

window_set_size(view_width*window_scale,view_height*window_scale);

alarm[0] = 1;

surface_resize(application_surface, view_width*window_scale, view_height*window_scale);

End Step:

#macro view view_camera[0]

camera_set_view_size(view, view_width, view_height);

if(instance_exists(objShiner))

{

var \_x = clamp(objShiner.x- view\_width/3, 0, room\_width-view\_width);

var \_y = clamp(objShiner.y-view\_height/3, 0, room\_height-view\_height);

camera\_set\_view\_pos(view, \_x, \_y);

}

Alarm 0:

window_center();

Room Start:

view_enabled = true;

view_visible[0] = true;

8 Comments
2024/10/29
14:01 UTC

1

Gamemaker stopwatch ussue

I tried making a stopwatch but its not printing, why.

Also I have a viewport maybe thats why.

Create:

minutes = 0;

seconds = 0;

mil = 0;

alarm[0] = 6

alarm0:

mil += 1

if mil == 10{

seconds += 1

mil = 0

}

if seconds == 60{

minutes += 1

seconds = 0

}

Draw:

draw_set_halign(fa_left)

draw_set_valign(fa_top)

var t = ""

t += string(minutes)

t += ":"

t += string(seconds)

t += "."

t += string(mil)

draw_text(5,5,t)

10 Comments
2024/10/29
10:03 UTC

Back To Top