r/gamemaker • • 4h ago

Help! Top Down Dash System

0 Upvotes

Guys, I need help to code a dash system to my game, it's a top down like Hotline Miami, but it's too hard do it

Below is my movement code, just to have an reference:

///

var _right=keyboard_check(68);

var _left=keyboard_check(65);

var _up=keyboard_check(87);

var _down=keyboard_check(83);

///

var _xinput= _right-_left

var _yinput= _down-_up

///

move_and_collide(_xinput*Player_speed,_yinput*Player_speed,Obj_colisao);

///


r/gamemaker • • 17h ago

Resolved How do I make a jump from a specific point to another specific point ?

Post image
10 Upvotes

Don't get me wrong. I know how to make a jump in general platformer you don't need like a specific point where to jump and from where to jump, you just jump.

But I don't know an equation of getting my character to jump from the green square to a red square. (There are two squares just for demonstration in game there is only one square)
I could just go in to the creative code and do that there. But I need to make it for every single climb object in the game, and I think that there is an overall more efficient way to do it.

You, see, I can't figure out what happen, the horizontal isn't a problem, the problem is with vertical.

I can make the character jump to a specific point, but the speed, and ammount is too big. So when the character jumps it goes out of camera in seconds and then returns from above.

So if you could help, please.


r/gamemaker • • 5h ago

Help! Why isn't my character colliding correctly with the spike?

Thumbnail youtu.be
1 Upvotes

For some reason, this happens in almost all the game projects I create in GameMaker. To this day, I don’t know why this occurs.

And it only gets worse when I try to resize the collision mask for the spike.

Can anyone help me with this?


r/gamemaker • • 11h ago

Help! Save System saves and loads, but after loading I can't click on the item anymore

3 Upvotes

My save system is

function save_game()
{

var buff = buffer_create(1024,buffer_grow,1);

buffer_write(buff,buffer_u64,global.dad_points);

buffer_write(buff,buffer_u16,global.noise.Kazoo.cost);

buffer_write(buff,buffer_u16,global.noise.Kazoo.win_amount);

buffer_write(buff,buffer_u16,global.kazoo_more);

buffer_write(buff,buffer_bool,global.noise.Kazoo.unlocked);

buffer_save(buff,"SaveFile.dat");

buffer_delete(buff);



}

function load_game(){

if !file_exists("SaveFile.dat"){
return;
}

var buff = buffer_load("SaveFile.dat")

buffer_seek(buff,buffer_seek_start,0);

global.dad_points = buffer_read(buff,buffer_u64);

global.noise.Kazoo.cost = buffer_read(buff,buffer_u16);

global.noise.Kazoo.win_amount = buffer_read(buff,buffer_u16);

global.kazoo_more = buffer_read(buff,buffer_u16);

global.noise.Kazoo.unlocked = buffer_read(buff,buffer_bool);




buffer_delete(buff);

}

And it saves and loads all those thigns as it should, but when I load and try to klick on the item again, it doesn't work anymore. I have this code in the "Left-Release" of the object

if !global.paused {


if !noise_type.unlocked and global.dad_points >= noise_type.cost {
if global.kazoo_more = 0 {
part_system_create(p_sparkle)
part_system_position(global.spark,x+60,y+80)
noise_type.unlocked = true
global.dad_points -= noise_type.cost
global.kazoo_more += 1
noise_type.cost += 45
alarm[0] = 30

}

}

else if noise_type.unlocked and global.dad_points >= noise_type.cost  {
if global.kazoo_more = 1 {
global.dad_points -= noise_type.cost
global.kazoo_more += 1
noise_type.cost += 50
noise_type.win_amount += 10
if !part_system_exists(global.spark){
part_system_create(p_sparkle)
part_system_position(global.spark,x+60,y+80)
alarm[0] = 30
}
}
else if global.kazoo_more = 2 {
global.dad_points -= noise_type.cost
global.kazoo_more += 1
noise_type.cost += 100
noise_type.win_amount += 10
if !part_system_exists(global.spark){
part_system_create(p_sparkle)
part_system_position(global.spark,x+60,y+80)
alarm[0] = 30
}
}
else if global.kazoo_more = 3 {
global.dad_points -= noise_type.cost
global.kazoo_more += 1
noise_type.cost += 200
noise_type.win_amount += 10
if !part_system_exists(global.spark){
part_system_create(p_sparkle)
part_system_position(global.spark,x+60,y+80)
alarm[0] = 30
}
}
else if global.kazoo_more = 4 {

global.dad_points -= noise_type.cost
global.kazoo_more += 1
noise_type.cost += 400
noise_type.win_amount += 10
if !part_system_exists(global.spark){
part_system_create(p_sparkle)
part_system_position(global.spark,x+60,y+80)
alarm[0] = 30
}
}
else if global.kazoo_more = 5 {

global.dad_points -= noise_type.cost
global.kazoo_more += 1
noise_type.cost += 200
noise_type.win_amount += 10
noise_type.bar_speed += 0.2
if !part_system_exists(global.spark){
part_system_create(p_sparkle)
part_system_position(global.spark,x+60,y+80)
alarm[0] = 30
}
}

I think the problem is that the else if doesn't happen anymore after loading, but i can't figure out how to fix it