Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#ActualServant of the Lord

Posted 01 August 2013 - 10:43 AM

And once you've mastered C++, and have the official and secretive gold C++ guru medal around your neck, you code like this:

if(keyboard_check(vk_left))  x -= 5;
if(keyboard_check(vk_right)) x += 5;
if(keyboard_check(vk_up))    y -= 5;
if(keyboard_check(vk_down))  y += 5;

 .

 .

Seriously though, incase the original poster isn't joking, both those are commonly used syntaxes, and some professionals advocate for one, and some professionals advocate for another, and neither is necessarily superior than the other. I use the former "bad" example, or else the syntax I posted here. There are a dozen threads on GameDev.net debating the merits of each one if you want to learn more. Also, this would be called "coding style", not "syntax". Both of those share the same "syntax", but use different "styles".


#3Servant of the Lord

Posted 01 August 2013 - 10:43 AM

And once you've mastered C++, and have the official and secretive gold C++ guru medal around your neck, you code like this:

if(keyboard_check(vk_left))  x -= 5;
if(keyboard_check(vk_right)) x += 5;
if(keyboard_check(vk_up))    y -= 5;
if(keyboard_check(vk_down))  y += 5;

Seriously though, incase the original poster isn't joking, both those are commonly used syntaxes, and some professionals advocate for one, and some professionals advocate for another, and neither is necessarily superior than the other. I use the former "bad" example, or else the syntax I posted here. There are a dozen threads on GameDev.net debating the merits of each one if you want to learn more. Also, this would be called "coding style", not "syntax". Both of those share the same "syntax", but use different "styles".


#2Servant of the Lord

Posted 01 August 2013 - 10:42 AM

And once you've mastered C++, and got the gold C++ guru medal around your neck, it looks like this:

if(keyboard_check(vk_left))  x -= 5;
if(keyboard_check(vk_right)) x += 5;
if(keyboard_check(vk_up))    y -= 5;
if(keyboard_check(vk_down))  y += 5;

Seriously though, incase the original poster isn't joking, both those are commonly used syntaxes, and some professionals advocate for one, and some professionals advocate for another, and neither is necessarily superior than the other. I use the former "bad" example, or else the syntax I posted here. There are a dozen threads on GameDev.net debating the merits of each one if you want to learn more. Also, this would be called "coding style", not "syntax". Both of those share the same "syntax", but use different "styles".


#1Servant of the Lord

Posted 01 August 2013 - 10:39 AM

And once you've mastered C++, and got the gold C++ guru medal around your neck, it looks like this:

if(keyboard_check(vk_left))  x -= 5;
if(keyboard_check(vk_right)) x += 5;
if(keyboard_check(vk_up))    y -= 5;
if(keyboard_check(vk_down))  y += 5;

Seriously though, incase the original poster isn't joking, both those are commonly used syntaxes, and some professionals advocate for one, and some professionals advocate for another, and neither is necessarily superior than the other. I use the former "bad" example, or else the syntax I posted here. There are a dozen threads on GameDev.net debating the merits of each one if you want to learn more. Also, this would be called "coding style", not "syntax". Both of those share the same "syntax", but use different "styles".


PARTNERS