brotherRML
Member
Hi to all. forgive me but i don't find the issue in the block of script for "automatic movement" of instance in game. what i don't understand are :
1- the code are a basic code for movement that i have find on video tutorial online.
2- in a previous project of game for testing codes, this specific code don't exit issues.
3- if i change name of my variables with the built-in variable "speed" the code go good for an half of this complete cycle.
any suggestions?
1- the code are a basic code for movement that i have find on video tutorial online.
GML:
/*velocita*/ speed = calcola_velocita_orizzontale(orspeed,bonusvelocita, malusvelocita);
// show_debug_message("velocitàprima :"+string(velocita));
if place_meeting(x+speed, y, o_BaseMuro)
{
// show_debug_message("velocità :"+string(velocita));
while not place_meeting(x+speed, y, o_BaseMuro)
{
x = x + speed;
}
if (speed > 0)
{
speed = -speed;
// show_debug_message("velocitàoltre :"+string(velocita));
}
else speed = -speed;
}
if (speed !=0) image_xscale=sign(speed);
any suggestions?