F
ferds814
Guest
Code:
with(oplayer){
//lots of script//
/*movement and the rotate function//
inst = global.markers[0];
mp_potential_step_object(inst.x,inst.y,spd,oCparent);
show_debug_message("direction: "+string(direction)+" angle: "+string(image_angle));
*/ extra code//
/*final in script//
image_angle = direction;
*/
}
Here is my full code on player movement inside a player object in another game, plus pic
Code:
///move
if global.Drive == 0{
if place_meeting(x,y,collisionP_obj){
y-=2;
direction += 30;
if device_mouse_check_button(0,mb_left){
y-=2
}
}
if device_mouse_check_button(0,mb_left){
mp_potential_step(mouse_x,mouse_y,3,solid);
image_speed = 0.33
//direction = point_direction(x,y,mouse_x,mouse_y);
}
if device_mouse_check_button(0,mb_right){
mp_potential_step(mouse_x,mouse_y,6,solid);
image_speed = 0.66
//direction = point_direction(x,y,mouse_x,mouse_y);
}
if !device_mouse_check_button(0,mb_left) and !device_mouse_check_button(0,mb_right){
image_speed = 0;
}
image_angle = direction
}
so i am having trouble getting my sprite in gamemaker to rotate. well all of them really. they turn fine in my other projects but in this one i just cant seem to get my "box" to turn.
**EDIT** thanks to obscene i realized i had used a draw event in my object/s. all is back on track now
Last edited by a moderator: