You make great and nice tutorials. I finally found a KZbinr that shows me how to program in C++. I just wanted to say thanks to you. Keep going with this!!
@hellomynameisorange28609 жыл бұрын
Thanks dude! I love your tutorials, you've gotten me into C++.
@ElderMoro3 жыл бұрын
This guy is freakin amazing.
@karshtharyani42536 жыл бұрын
The random direction won’t change unless you add randomise() to the code, right? That’s why you got 6 twice. When you re-ran the program you got a 5 because it was a new seed. Am I correct?
@justanotherfangirl23984 жыл бұрын
Just do #include time.h at the start then put srand(time(NULL)) above direction = (eDir)((rand() % 6) + 1);
@justanotherfangirl23984 жыл бұрын
except that goes into negatives wtf
@anonymousmask38237 жыл бұрын
I love creating games on c++ Thxx for all the videos
@calvinmillett8 жыл бұрын
Hey, im having a problem when i try to build the program it gives me an error for the class cBall. The exact error is ( 'cBall::Move': non-standard syntax; use '&' to create a pointer to member )
@viktornikolov15703 жыл бұрын
I really like the opening to the video. Great content as well. I hope you will have some time to do more in the future. Cheers.
@jorgeolguin32745 жыл бұрын
how did i get negatives ex: ball [-1,-1][2] ? did i do it right ? it successfully built but i thought the numbers would only be 1-6?
@farahhawani55307 жыл бұрын
why my program didnt recognise eDir? is it in C++ coding or not?
@farahhawani55307 жыл бұрын
Puneet Verma okay thank you..!!
@leenahjune Жыл бұрын
I have a question..when i code direction =(eDir)((rand()%6)+1) It show error...compiler say 'rand' not declare in this scope
@erlindamecate3 жыл бұрын
bro this helps my mom is impressed ty bro she proud of me
@samuelshtefanio50298 жыл бұрын
I had a question to ask; what did you use to start the project? There are a whole bunch of .net options that are available but they don't seem to fit my needs for making a game like this. Help please!
@NVitanovic8 жыл бұрын
In the newer versions of Visual Studio >2013 Visual C++ is not included by default. When installing the Visual Studio make sure you have checked that option. Then go to Other Languages -> Visual C++ -> Empty project.
@randall.o89955 жыл бұрын
can anyone explain to me how the friend function works at line 62 to 64 ? thanks in advance.
@Nguyenthao-oj9ku2 жыл бұрын
very late, maybe you do not need this information anymore: friend to access x and y that are private members of a class.and he uses an overridden operator, in this case,
@codergirl15188 жыл бұрын
Excellent tutorial, exactly what I was looking for!!
@daemon46838 жыл бұрын
So I'm a Java guy, and I see this and I'm just like "what the fuck...?"
@LuRybz8 жыл бұрын
java tries to simplify things by describing the code (more verbose) c++ tries to simplify things reducing code. That's how I feel about them.
@daemon46838 жыл бұрын
lucas pinto I prefer more the verbose path.
@ad0ns3718 жыл бұрын
C++ is far more direct. Just like lucas pointed out . Also Java is more close to natural language than C++ even tough they both are high language and Python is too.
@billhosh91658 жыл бұрын
You are not a "java guy", but a guy who knows shit about programming. Except it and do not hide behind the excuses.
@BananaNerd-guzaboo7 жыл бұрын
Accept* And don't call me a grammar nazi because if you're going to give out criticism you've got to be able to take it. :)
@immanuelsiburian21356 жыл бұрын
you are great. THAK YOU. keep going on sir
@seanmccain14507 жыл бұрын
#include using namespace std; enum eDir {STOP = 0, Left = 1, UpLeft = 2, DOWNLEFT =3, RIGHT = 4, UPRIGHT = 5, DOWNRIGHT = 6}; class cBall { private: int x, y; int originalX, originalY; eDir direction; public: cBall(int posX, int posY) { originalX = posX; originalY = posY; x = posX; y = posY; direction = STOP; } void Reset() { x = originalX; y = originalY; direction = STOP; } void changeDirection(eDir d) { direction = d; } void randomDirection() { direction = (eDir)((rand() % 6) + 1); } inline int getX() { return x; } inline int getY() { return y; } inline eDir getDirection() { return direction } void Move() { switch (direction) { case STOP: break; case LEFT: x--; break; case RIGHT: x++; break; case UPLEFT: x--; y++; break; case DOWNLEFT: x--; y++; break; case UPRIGHT: x++; y--; break; case DOWNRIGHT: x++; y++; break; default: break; } } friend ostream & operator
@camranh_royal6 жыл бұрын
zan q!
@Dexter101x6 жыл бұрын
Have you got a video which states where you start off from? Like, because I am a beginner with Visual Studio
@paranomal29624 жыл бұрын
Bro your intro song is from "mein Bizeps brennt" hahaha
@hienvu59088 ай бұрын
mong a ra video nữa đi ạ huhu
@narahs228 жыл бұрын
Did you get your directions wrong? For example I thought DownRight should be x++,y--. and when you run the code at the end it says the dir'n is DownRight but it goes UpRight from (0,0) to (1,1)
@willway12348 жыл бұрын
When you go down, the y co-ord increases.
@shahmirkhan94818 жыл бұрын
but why does the y co-ord increase when we go down? it must decrease right!!!
@modoamodoq1688 жыл бұрын
Because the way your screen is drawn, you screen draws from the top left pixel down to the bottom right, instead of saying that all the Y coordinates are negative, they just have them going positive instead. That is why the y co-ord is increasing as it goes down instead of decreasing.
@kavindukokila15433 жыл бұрын
I have an error:no matching function for call to'cBall::randomDirection()' what is it? Plz help
@Darksassy8 жыл бұрын
Can someone help me understand what this function does...and what inline int gety() { return y; } , is used for please. Thanks friend ostream & operator
@ParsaTaba4 жыл бұрын
I dunno bro
@alaaalmhsery7189 жыл бұрын
why my rand() need to include #include and your not?
@alaaalmhsery7189 жыл бұрын
+alaa almhsery im working on code blocks by the way
@vibecheck41214 жыл бұрын
Can i make this with Dev C++?
@zelo_s67078 жыл бұрын
Please help Im using Xcode on Mac and Im using conio.h , but it says error, file not found! Please Help Me.
@mariusvon63646 жыл бұрын
Hi, i had the error while trying starting the "application" "C1010" then i done the steps what microsoft says and then i have two more errors after the second try starting i had two more errors "LNK2019" and "LNK1120" can you help me please?? rgds, marius
@francistabora15805 жыл бұрын
Great tutorial, thanks a lot ☻.
@crimsonwolf75797 жыл бұрын
¨how do you get the boxed in - at lign for im still new to coding
@dhjslabxdhdj31526 жыл бұрын
I program with ubuntu and I do not have the library conio.h, how can I install it (I do not have an ide)
@Nguyenthao-oj9ku2 жыл бұрын
rand() does not give us a random, I tried to repeat the program many times, and the direction still is 6
@edriantiburana6 жыл бұрын
I get this errors : Error 1 error C2614: 'cPaddle' : illegal member initialization: 'cPaddle' is not a base or member 3 IntelliSense: "cPaddle" is not a nonstatic data member or base class of class "cPaddle" please help. I'm new in programming.
@ehgh7246 жыл бұрын
hi - tnx for tutorial - i want to write a breakout game in c++ but i don't know how i can ,actually i don't know how to start, so i watched this tutorial. i want to know how i can use this tutorial and change it to a brakout game?
@omgitzzaaronn57888 жыл бұрын
i get this error: 'return': cannot convert from 'int' to 'std::ostream &'
@piyush97057 жыл бұрын
if its a function check if uve used '()'after it.. that's when I usually get that error
@classim37155 жыл бұрын
You should return o letter I not zero bro if you had int function you return a like like 0 like int main(); but with ostream I you should return the letter o;
@alexwashbach33155 жыл бұрын
i copied it exactly and got about 40 errors.
@jaideepsinghjeji84445 жыл бұрын
How?
@akazecik7 жыл бұрын
Aren't functions defined inside a class inline by default?
@johnniegilkerson4724 Жыл бұрын
Your code does not work fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "pch.h"' to your source? 1>C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets(486,5): error MSB4181: The "CompileXaml"
@mihai98is776 жыл бұрын
I have a problem. my application tells me that "rand" was not declared in this scope plese help me
@faceloltv25946 жыл бұрын
#include use this then it is working
@electromobilegadget53008 жыл бұрын
What is the game of the software that you are using to create this game?
@electromobilegadget53008 жыл бұрын
Thank you :)
@HeldrikBoldhart8 жыл бұрын
You can do this exact code in Notepad++ using C++ as the language, correct?
@Lou_0b18 жыл бұрын
Correct.
@tomiikunxd8 жыл бұрын
you can, but you'd need to compile with which Notepadd++ does not include
@LostDarkKingEU9 жыл бұрын
Hey man i keep getting all kinds of errors when trying to run the code. even if i copy the full code listed in the discription. had the same problem with the snake game. tryed typing it over step by step but does't work. please HELP!
@alaaalmhsery7189 жыл бұрын
niels-yvo grummel i think that you have to sour what your typing cos its work
@LostDarkKingEU9 жыл бұрын
+alaa almhsery not saying it's the code but asking why is doest work on my pc
@NVitanovic9 жыл бұрын
+niels-yvo grummel Please provide the error that you get.
@LostDarkKingEU9 жыл бұрын
+NVitanovic Here are some prt screen of my errors and a text file of the code i wrote. www.mediafire.com/folder/9rt66iwbeab8f//C%2B%2B%20Errors%20Ping%20Pong
@obx44549 жыл бұрын
how new are you to programming? some of these errors are baby mistage errors. for the undeclared identifier you misplaced some brackets or used x and y before declaring them take a look at your code logically
@tyru28 жыл бұрын
what project type is that
@seanmccain14507 жыл бұрын
Im having a problem apparently rand is not declared in the scope
@showallmemes62687 жыл бұрын
I get an error when I do direction = (eDir)((rand() % 6) + 1); it says that "rand" was not declared in this scope
@Mister_Gerbelle7 жыл бұрын
did u forget #include "inustd.h"
@johnshalenko25517 жыл бұрын
Could you explain which kind of application this is?
@NVitanovic7 жыл бұрын
It's a C++ application. If you are interested in which template in visual studio did I use, it's an Empty project, with added source file named main.cpp. Check out my first C++ Hello World tutorial for more info.
@johnshalenko25517 жыл бұрын
NVitanovic No need, I figured it out through just watching, decent tutorial by the way.
@daveygrean37985 жыл бұрын
help it wont run, says cant locate iostream? do i need to download it from somewhere?
@daveygrean37985 жыл бұрын
im using turbo c++
@daveygrean37985 жыл бұрын
i just pasted the source code into turbo?
@yaboitroy89704 жыл бұрын
turbo c++ works horribly for most code, visual studio is much better
@edurd1218 жыл бұрын
Excuse me but my code like only stays for like 1.500 milliseconds and then it closes
@vicc.81358 жыл бұрын
+Eduardo Bourget might want to try adding system(''pause''); return 0; at the end of your code if your using visual studio as an idea
@vicc.81358 жыл бұрын
ide*
@адекватникошмар8 жыл бұрын
will this work if i do this on notepad ?
@NVitanovic8 жыл бұрын
It will work, if you compile it later properly.
@адекватникошмар8 жыл бұрын
Aj probacu
@Muzzycal8 жыл бұрын
jel ti uspelo brate :D
@usama579266 жыл бұрын
you are great
@LopogaX7 жыл бұрын
C++ Primer plus rather than c++ primer?
@matt1927 жыл бұрын
Why this? error: 'rand' was not declared in this scope
@Karukami17 жыл бұрын
add #include at the start
@nunocabrita72385 жыл бұрын
@@Karukami1 I can't find stdlib.h Help please
@charity29472 жыл бұрын
@@nunocabrita7238 bruh ya answered after 2 years wow.
@hodgsontetteh40586 жыл бұрын
boy do u sound sound like my Prof from ccny......Professor Amir
@manriqueiriarte82687 жыл бұрын
can someone explain to me why down left he uses y++ and up left he uses y--?
@elliot82755 жыл бұрын
y-- refers to the fact of the position of the object other wise it will be high or to low, (remember in scratch when you tried to code and when you tapped forward and left or right it will only go one or the other) this prevents this
@classim37155 жыл бұрын
Someone just explain that the initial position (0;0) is not center that why if it was center then your logic is right but image the initial position on the top or or bottom it will different direction
@jeffreychen65917 жыл бұрын
#include using namespace std int main() { cout
@Mister_Gerbelle7 жыл бұрын
use unity or unrealengine if u wanna get into c++ game development or use opengl
@Hazzardous20054 жыл бұрын
you forgot a semicolon
@peterbiswalo38965 жыл бұрын
THis didn't work at all
@quantamzero79197 жыл бұрын
can that source code page look any more sketchy lmao
@camranh_royal6 жыл бұрын
up is y++ not y--...down should be y--...
@yh_hat_trick4916 жыл бұрын
In certain graphics API's, 0,0 it at the top right Some 0,0 is in the middle. Some have it at the bottom left
@rachitvasudeva75384 жыл бұрын
bro, in 2D games, the default cartesian system goes like this: right: +X left : -X up: -Y down: +Y
@atlantic_love4 жыл бұрын
Try writing code before poo poo 'ing the basics of computer programming.
@LuRybz8 жыл бұрын
Code: pastebin.com/VXkJzGCb
@jonathankoivuneva64667 жыл бұрын
thank
@Jiangyou6664 жыл бұрын
cool
@seanmccain14507 жыл бұрын
my coding so far
@mihaelaafloroaie85156 жыл бұрын
9:58 *DEFAULT MUSIC STARTS PLAYING*
@mishalavik45956 жыл бұрын
👍
@Ventinky4 жыл бұрын
bruh what project type? (ik i commented after 4 years)
@radulescustefan45324 жыл бұрын
@xxxjacob2 official idk. I use code blocks(console application). I have some problems when i writed the code so i decided to copy paste it from the link in the description but it sends me on porno sites. Could u please help me get the code?
@atlantic_love4 жыл бұрын
Can hardly hear you.
@seanmccain14507 жыл бұрын
Downloading visual studio 2017 to get the features that are used in this video lol im smart
@JohnJigsaw4207 жыл бұрын
Bruh slow down. I can't keep up fast enough to understand what's going on lol
@cd67377 жыл бұрын
You gotta see part one and all the other ones leading up to this one in that case
@parmstrong6 жыл бұрын
Try pausing the video.
@seanmccain14507 жыл бұрын
whoops wrong part.
@alacastersoi82657 жыл бұрын
Honestly this formatting make me want to jump off a bridge. why did he use enumeration and there are so many needed functions. Use vectors. Like slope vx/vy you know basic algebra.