W
Wild_West
Guest
well so much for me thinking I'd gotten all the basics down lol
But yeah I don't know why this isn't working and I'm only asking since I've tried everything else but my Bat enemy isn't responding to it's creation code variable check.
I just want to change whether they fly side to side or up and down based on a variable defined in the creation code of the room editor. You know when you place an object in the room and right-click it to go into creation code.
This is The code in the bat's step event (since for some reason defining the setup in create event doesn't work, like I saw in a tutorial, may have been an outdated version of GM , don't remember)
But yeah anyway, the bat with the Y axis flight pattern isn't moving in both the Y directions just whatever the first value is. If I take it out then the bat moves to the left like the one with the X axis value which it shouldn't be since nothing is telling it to.
In Create
image_speed = .3;
speed = 3;
in Step
//X axis flight pattern
if(flight_pattern == "X axis") and (direction = 0) and (x > xstart + 400)
{
direction = 180;
image_xscale = -image_xscale;
}
if(flight_pattern == "X axis") and (direction = 180) and (x < xstart - 400)
{
direction = 0;
image_xscale = -image_xscale;
}
//Y axis flight pattern
if(flight_pattern == "Y axis") and (direction = 90) and (y < ystart - 200)
{
direction = 270;
image_xscale = -image_xscale;
}
if(flight_pattern == "Y axis") and (direction = 270) and (y > ystart + 200)
{
direction = 90;
image_xscale = -image_xscale;
}
and then just set the flight_pattern X or Y in the creation code after I place the in the room right? Any idea what I'm not seeing that I screwed up because I've done more complex than this with creation code before and it worked fine.
But yeah I don't know why this isn't working and I'm only asking since I've tried everything else but my Bat enemy isn't responding to it's creation code variable check.
I just want to change whether they fly side to side or up and down based on a variable defined in the creation code of the room editor. You know when you place an object in the room and right-click it to go into creation code.
This is The code in the bat's step event (since for some reason defining the setup in create event doesn't work, like I saw in a tutorial, may have been an outdated version of GM , don't remember)
But yeah anyway, the bat with the Y axis flight pattern isn't moving in both the Y directions just whatever the first value is. If I take it out then the bat moves to the left like the one with the X axis value which it shouldn't be since nothing is telling it to.
In Create
image_speed = .3;
speed = 3;
in Step
//X axis flight pattern
if(flight_pattern == "X axis") and (direction = 0) and (x > xstart + 400)
{
direction = 180;
image_xscale = -image_xscale;
}
if(flight_pattern == "X axis") and (direction = 180) and (x < xstart - 400)
{
direction = 0;
image_xscale = -image_xscale;
}
//Y axis flight pattern
if(flight_pattern == "Y axis") and (direction = 90) and (y < ystart - 200)
{
direction = 270;
image_xscale = -image_xscale;
}
if(flight_pattern == "Y axis") and (direction = 270) and (y > ystart + 200)
{
direction = 90;
image_xscale = -image_xscale;
}
and then just set the flight_pattern X or Y in the creation code after I place the in the room right? Any idea what I'm not seeing that I screwed up because I've done more complex than this with creation code before and it worked fine.