I've been using something like:
Which works great, but now that I'm coding the last boss I need something different. I want the "enemy" too chase after the main character as a whole, but I'm treating the "whole" enemy as four different sprites (this is pretty much necessary for what I'm doing).
That makes the 4 "parts" of the last boss go on their own accord depending on where they are (an effect of BPL), which eventually makes all 4 "parts" go into one little 8x8 square, but I don't want that.
Basically all I want is to load the main characters sprite's axises and the
boss "part" axises and
IF main sprite X > boss part 1 X THEN boss part 1 X = boss part 1 X - 1
IF NOT THEN boss part 1 X = boss part 1 X + 1
and so on...
Naturally if the main sprite and the boss part are EQUAL TO on either axis it will cause the boss part to constantly switch position, but I want that so it's fine. That would make all the boss parts stay the same difference away from each other *unless* the main character went in the middle of the boss parts (which would then make the boss parts go into each other), I can live with this also, but if there's away around it I really don't want that to happen.
So basically I need some kind of routine to find the greater than...Is there a branch instruction for "greater than" cause I couldn't find one.
thanks
Code:
ldx S1_X
cpx S7_X
bpl incxE1
jmp nexte
incxE1:
inc S7_X
jmp endAI
nexte:
dec S7_X
cpx S7_X
bpl incxE1
jmp nexte
incxE1:
inc S7_X
jmp endAI
nexte:
dec S7_X
Which works great, but now that I'm coding the last boss I need something different. I want the "enemy" too chase after the main character as a whole, but I'm treating the "whole" enemy as four different sprites (this is pretty much necessary for what I'm doing).
That makes the 4 "parts" of the last boss go on their own accord depending on where they are (an effect of BPL), which eventually makes all 4 "parts" go into one little 8x8 square, but I don't want that.
Basically all I want is to load the main characters sprite's axises and the
boss "part" axises and
IF main sprite X > boss part 1 X THEN boss part 1 X = boss part 1 X - 1
IF NOT THEN boss part 1 X = boss part 1 X + 1
and so on...
Naturally if the main sprite and the boss part are EQUAL TO on either axis it will cause the boss part to constantly switch position, but I want that so it's fine. That would make all the boss parts stay the same difference away from each other *unless* the main character went in the middle of the boss parts (which would then make the boss parts go into each other), I can live with this also, but if there's away around it I really don't want that to happen.
So basically I need some kind of routine to find the greater than...Is there a branch instruction for "greater than" cause I couldn't find one.
thanks