   (C++)Platformer help needed...
  So, I just started programming C++ a couple days ago, and I'm trying to make an object jump and land correctly in a platformer style. This is what I have so far:--------------------------------------------------------------------------------//boxAvert1 is x//boxAvert2 is y//CboxA is a bool//Scr_H is the screen heightif(boxAvert2!=Scr_H){  gCboxA=1;  boxAvert2+=2; }    else if(gCboxA=Scr_H){gCboxA=0;}    if(gCboxA=1&&key[KEY_UP])    {    boxAvert2-=4;    }    if(key[KEY_LEFT])    {    --boxAvert1;    }    if(key[KEY_RIGHT])    {    ++boxAvert1;    } -------------------------------------------------------------------------------When I run this, the object falls and lands at the bottom of the screen. When ask for it to jump, it will go up properly, but it won't stop untill I release the key.Can somebody tell me what's wrong with my program? Or show me a working one?   
Quote:Original post by X19OV1//boxAvert1 is x//boxAvert2 is y//CboxA is a bool//Scr_H is the screen heightif(boxAvert2!=Scr_H){  gCboxA=1;  boxAvert2+=2; }    else if(gCboxA=Scr_H){gCboxA=0;}    if (gCboxA == 1 && key[KEY_UP])    {    boxAvert2-=4;    }    if(key[KEY_LEFT])    {    --boxAvert1;    }    if(key[KEY_RIGHT])    {    ++boxAvert1;    } The change made above (in bold) will probably help.Other than that, it's hard to tell exactly what you're trying to do (or maybe I'm too lazy to figure it out [grin])   ;  First off, if you are new to C++ programming you aren't going to be able to accomplish much until you actually learn the language.  Trying to do so is like trying to write a novel in a language you only know a few words in.Second, I really don't think anyone is going to be able to help you unless you provide more context with your question.  What you've posted is a just fragment of some code.  In order to give you more help, more of the code needs to be seen. Otherwise, what could someone say about it?   ;  hallucinogenic,Thank you, I forgot about the equivalence operator. ^^guyver32,I do think you are right, being that I was unclear and that I'm very new to this. I'll try to be more descriptive next time. :)