c++ - How can I get the enemies to move? -


Hello I'm trying to move the enemies left and right, as they are sliding backwards and I know that this can be done with the following code:

  slide + = slide_iCar; If (abs (slides)> 30) slide_incr = -slide_incr;   

However this is no use for me because I need to set a boolean, so I can cycle through the frame when the enemy is getting correct or left Can i

Ive tried follow-up code with no luck:

  if (abdomen)  30) {eSlide_incr = -eSlide_incr; }   

How can I apply it but any thoughts? Thank you

If you are sliding forward or backward, then you want to keep the hysteresis status. Try mixing the abs () function, try something on the lines of the boundary being checked:

  islide + eslide_icaster; If (stomach (eslied)> = 30) {eSlide_incr = -eSlide_incr; }    

Comments