Ok thanks, that works

One thing though - if I fire while moving the character, the character jolts a bit. How can I get rid of this? Also, without two lines of code, the player carries on moving unless you press a key to slow it down. My question is can you write these two lines of code shorter with some kind of 'or' thing?
if (!key_cuu) movement = 0;
if (!key_cud) movement = 0;