d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Quick Question About C++ Symbols And Their Meaning
Add Reply New Topic New Poll
Member
Posts: 10,162
Joined: Mar 19 2006
Gold: 764.00
Apr 26 2015 04:59am
So im trying to teach myself how to code video games (day 3, woo! lol)

Ive spend about 20 hours so far watching tutorials online, simple coding for 2D games and coding in Eclipse to better familiarize myself with general c++ coding

Im writing notes on every new symbol or short hand I see used, but theres a few symbols and words I cant figure out yet

What is the difference between "///" and "//" at the beginning of a line. Im pretty sure // is for like foot notes, Ive seen a few tutorials of game coding where they put almost anything they want after // but /// is usually more specific.
"ord" - in this case used before designating a keystroke. is it short for like order? or ordinance? or is it just a shorthand without meaning, but representing a function?
"vk" is one I can kind of half-guess as view key? not sure exactly though, and without knowing exactly, I cant effectively use it to make my own game
"()" at the end of some lines, usually the first line after "///"
"{ }" at first I thought this was for like the body of a command, but none of the videos use it for all commands, but they all sprinkle it randomly (well, randomly to me, Im positive it isnt just random) throughout their code
"var" I think this is just variable?

I have an example below of a direct code from one of the videos teaching me how to make the camera in a video game (in this case an RTS) pan using WASD or the arrows.

Every symbol except { } that I am curious about is in it

Code
///scr_move_view()

//get keyboard inputs
var right = keyboard_check(vk_right) || keyboard_check(ord('D'));
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Apr 26 2015 07:21am
you might wanna start out with a more classical tutorial first, then do a video game tutorial. just a suggestion.

i took a class in college where we'd use C to write games for the Gameboy advanced. we used simulators, but some people bought something to let them play it on a real GBA. we made things like frogger and space invaders and such. you can find notes on how to do it online if you're interested.

This post was edited by carteblanche on Apr 26 2015 07:35am
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll