Legacy GM issue with moving object

EZTALES

Member
hey yall,
I'm having an issue moving an object on the screen, for whatever reason it just doesn't want to move. I want it to move to a specific position when you enter my fight room and then I want it to move back when the fight is over. I'm using a draw_GUI for the code. could anyone help? the picture is down below. thanks!
Code:
DRAW_GUI
draw_sprite(sprite35,0,x,y);
draw_set_font(font_one);
draw_set_colour(c_white)
draw_text (32, 32, "HP:" + string(hp) + "/" + string(maxhp));
draw_text (32, 64, "STAMINA:" + string(stamina) + "/" + string(maxstamina));
draw_text (32, 96, "LEVEL:" + string(level));
if (room == rm_pause) && (room == rm_test_3) {
draw_sprite(sprite35,0,x,-500);
}
problem.PNG
 

EZTALES

Member
For one thing, this will draw the sprite outside the room, which may not be what you want to do. But where are you setting the x and y values?
I want to draw it right underneath the RAGE option, and even when I go into the room it doesn't move outside of the room. its almost like it's stuck there
 

Nidoking

Member
Well, see, you're doing this:
draw_sprite(sprite35,0,x,y);
and then you're doing this:
draw_sprite(sprite35,0,x,-500);
You're drawing the same sprite twice, once at x,y and once at x,-500. -500 is 500 pixels above the top of the room. And you still didn't answer my question: Where, meaning in what event, are you setting the x and y values? You haven't shown the code where you are telling it to draw the sprite anywhere else!
 

EZTALES

Member
Well, see, you're doing this:
draw_sprite(sprite35,0,x,y);
and then you're doing this:
draw_sprite(sprite35,0,x,-500);
You're drawing the same sprite twice, once at x,y and once at x,-500. -500 is 500 pixels above the top of the room. And you still didn't answer my question: Where, meaning in what event, are you setting the x and y values? You haven't shown the code where you are telling it to draw the sprite anywhere else!
OMG, your right! it looks like I haven't even written down that code, the problem is I don't know what to write to move the object.
 
If your drawing in the GUI with the X and Y values you may get strange results since the GUI and the room are two different sizes (though, not always, just depends). If you just put x += 1 in your code it may start moving things around. Try that, maybe it will give you a better understanding of what is going on.
 

EZTALES

Member
If your drawing in the GUI with the X and Y values you may get strange results since the GUI and the room are two different sizes (though, not always, just depends). If you just put x += 1 in your code it may start moving things around. Try that, maybe it will give you a better understanding of what is going on.
ill give it a try, thanks!
 

EZTALES

Member
If your drawing in the GUI with the X and Y values you may get strange results since the GUI and the room are two different sizes (though, not always, just depends). If you just put x += 1 in your code it may start moving things around. Try that, maybe it will give you a better understanding of what is going on.
all good! thanks for help man!
 
Top