/r/gamemaker
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.
Content that does not follow the subreddit guidelines is subject to deletion, so please become familiar with them.
/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.
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. |
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
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.
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;`
`}`
}
How do I have it so I can have a name I can use that is trademarked
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)
"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.
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;
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)
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?
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
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
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.
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!
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;
}
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!
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
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?
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?
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?
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.
i want the player to teleport back to their original place when passing a certain area
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 :(
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?
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;
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)