rem * New bad guy direction x (left/right) newbaddx temp5=rand : if temp5<128 then goto leftrightcheck goto rightleftcheck leftrightcheck temp5=badplayfx-1 : if !pfread(temp5,badplayfy) then goto badguygoleft temp5=badplayfx+2 : if !pfread(temp5,badplayfy) then goto badguygoright goto movebaddone rightleftcheck temp5=badplayfx+2 : if !pfread(temp5,badplayfy) then goto badguygoright temp5=badplayfx-1 : if !pfread(temp5,badplayfy) then goto badguygoleft goto movebaddone
So he won't always choose one direction first, I randomly have him look left first, then right if necessary or right first, then left if necessary. As you can see, there are redundant lines. Is there some big brain way of doing the same thing with less code? Anything I can think of to get rid of the redundant lines uses more code than what I already have there.
If you need to see it in action, here is a demo that contains the code:
http://www.atariage....s...t&p=1590593














