   hi need help with my scrolling beat em up
  i was wondering how would i get their y values, so that if its like equal to the heros y plane and if over -20 abit and +20 so that when i punch i can have a range between them any ideas. So basically i need that if our y planes r close i dont want heroy=enemy. Also i was wondering how do i get that enenmy behaviour they do with those games thanks in advance lol   
  DO you have any more information for us? What language are you using?If you're using c++ you could do something like:if(player.y > enemy.y -20 && player.y < enemy.y +20){  //code for hurting the enemy}If I understand you correctly. Note that this doesn't check Xs or whether the player is punching or not. Theres no real way to help you if you aren't more specific.Oh, and using correct punctuation are capitilizing letters can help the read-ability or your posts.   ;  you dont know how to get the y values?i cant believe you wrote the game with y values and cant find out how to get them.I guess youre the only person who should know how to get them.Give us some code (or some understandable sentence) or nobody can help you. :/   ;  i do know if u read it, i said i don't want something like hero.y=enenmy.y, i am thinking more like z values or something which i haven't created properly, i am using a directx wrapper in c++: here is some of my codefor(int i=0; i<NUM_BIKERS; i++){D3DXVECTOR2 yPos;yPos.y = (biker.posy-kenJab.posy);float newZ = sqrt(yPos.y*yPos.y);//if((collide.PPSpriteCollision(&biker.sprBiker[biker.curSprite],&kenJab.sprKenJab[kenJab.curSprite])&&(newZ<=10)&&(biker[0].isAlive)&&(kenJab.isAlive))){biker.speed=-5;}else {biker.speed=6;}so i wanted a more better way of doing it, :(;  Perhaps if you took a little longer thinking out your posts people wouldn't have such a hard time figuring out what you want. From your first post alone I didn't have the slightest idea what half of what you were saying meant. If english isn't your first language that's perfectly understandable, but that makes it more important that you use real words and as well formed sentences as you know how to.Anyways, on to your problem. From your code post I think what you're trying to do is: see if biker is close to kenJab. If it is, change the bikers speed to -5, otherwise change it to 6.So, the first thing I see is you're getting newZ (you probably should use something other than "z" as z typically denotes depth, not distance), by squaring ypos.y and then taking the square root. Look up the abs command instead (absolute).The second thing is, your if statement checks if they collide, then checks if they're within 10 of each other on the y axis... this is repetitive: If they collide then they're going to be withing 10 on the y axis. If they don't collide they're probably not going to be within 10 on the y axis. So, unless you have sprites that are less than 10 high (assuming y is up and down), you can drop everything to do with newZ and just leave the collide.PPSpriteCollision and the .isAlive checks.What I think you're trying to do is make the enemy bounce back if it hits you? In that case, you could probably drop the .isAlive's as well, since if you're about to destroy the enemy it doesn't matter what it's next movement would be - since it'll be gone anyways. And if the enemy destroys you, the enemy would still bounce back after hitting you.Sorry if I'm not understanding correctly.