I'm looking for the code to my RTS game in everywhere but I didn't found it
you know how we choose object is near with our mouse ???
that's the familiar problem in RTS game !!
and I will show the right code !
for objectwhateveryounamedin in step event
if mouse_check_button_pressed(mb_left) and global.put = true {
if position_meeting(mouse_x,mouse_y,cursor_sprite) and collision_point(x,y,object16,true,true) {
global.put = id;
}
}
if mouse_check_button_released(mb_left) {
global.put = true;
}and for objectcontrolroom //if global.grabbed holds an instance id
if(global.put !=true){
//embed code inside that instance
with(global.put){
//to move that instance to the mouse's position
x=mouse_x;
y=mouse_y;
}
}and that's it ! I found my own code haha !











