Комментарии:
lol, because I've answered this 200 times now, please ensure you have unicode enabled for your compiler. In VS, that's Project Properties -> General -> Character Set.
ОтветитьI dread to imagine what operator overloading and template shenanigans are inside the std library to make '50ms' a valid numerical constant. It is easier to type than std::chrono::milliseconds(50) I guess.
Edit : it seems like there's an operator""ms which does it. How wonderfully devious.
constexpr std::chrono::milliseconds operator""ms(unsigned long long ms)
{
return std::chrono::milliseconds(ms);
}
I've tried to run the whole code not seeing the video. The code doesn't run. It gives a error " 'BOOL WriteConsoleOutputCharacterA(HANDLE,LPCSTR,DWORD,COORD,LPDWORD)': não é possível converter um argumento 2 de 'wchar_t *' em 'LPCSTR'"
Should I continue?
This video puts me to shame because the methods I used are a lot bigger code and simpler for me to understand. At the same time, I was trying to add a lot more features than just a basic console demo and so that’s how I ended up with 30 kilobytes of code.
Ответить5 minutes in and you are showing the exact formula I used in my Tetris game. In my case it was a[x+y*width]
ОтветитьNot sure if anyone else ran into this issue, but I had to change `WriteConsoleOutputCharacter(...)` to `WriteConsoleOutputCharacterW(...)` the original one was throwing conversion errors for w_chart and LPCSTRs
ОтветитьHey i did it myself! Im a good programmer 😎
Ответитьplease take a look, there is much eleganter way of this game. it was written on Python.
It needs only a few lines of code:
from games import tetrisgame as t
t.playmode("hard")
t.start()
if ThereIsNoHumor
ThereIsNoHummor=False
Thank you! I can't help but modify the code that you shared.😁
ОтветитьHello! I have an issue where the console will still read user input even thought the game is running!
For example, if I press Z to rotate the piece a couple of times and then exit the program, the console will have zzzzzzzzz written in it.
How can I fix this?
Thanks for the amazing tutorial btw
What does that L in front of the string literal mean? That the literal is to be taken as a string of unicode chars?
ОтветитьMy favorite part of the video was when he said: "it's coding time," and proceeded to code all over the place.
Ответить6 Years Later and You Still Reply to Comments, how admirable. thank you for your hard work. I plan to follow most of the "Do-It-Yourself" Series because I want to try and make a 3D Voxel Game with c++ and think they would help.
Ответитьa lot of unnecessary bullshit
ОтветитьMy code doesn't work in any way. I have been searching for more than 4 hours :(
It runs on my visual studio, but it does not show nothing, it doesn't open no screen
I’m so curious how can the Tetris pieces be draw as a shape 4x4 the Field too how can the program draw it out to be the shape like that I don’t mean replacing the 0-9 with those # or A character I mean the Tetris shape 4x4 and the level shape 18x12
ОтветитьWhy can't anyone explain buffer overrun problem...
ОтветитьIs there a specific version (posix?) of MinGW on windows that this works with? I'm kinda new to C/C++ on windows and can't get the sample from github to compile.
ОтветитьI want to research this . what is it called ? screen[(y + 2)*nScreenWidth + (x + 2)] = L" ABCDEFG=#"[pField[y*nFieldWidth + x]];
ОтветитьNice one! I used for rotation another approach. To rotate any position (x, y) around center (0, 0) you can use formula x = y; y = -1 for CW rotation, and x = - y; y = x for CCW.
ОтветитьI did a code along to this, and got it working! What a thrill! I had a lot of fun. I like coding along while you are explaining things so I get a feel of how it works. Some of it made my brain numb but I suppose it's just part of learning. Great video! Thanks for making it, I learned a lot, especially about handles to the console window, cool stuff!
ОтветитьWhen i finish c++ tutorial i found, i will surely watch some videos. I dont see tutorials, i see challanges that will improve my c++ skills. I will try to make programs from each video and during the making of it i will try to watch as little as possible of these videos. At the end of each challange i will compare my result to yours, it will be fun.
Ответитьim coding on mac and can't include windows.h, is there any alternative or what should i do with this problem?
Ответитьjavidx9 and his discord mods hate transpeople, always singling me out and being absolutely nasty to me! Going to report his server until this treatment is fixed.
ОтветитьThis guy is legendary, so inspiring!
ОтветитьFor years now I this channels thumbnails and I say to myself... One day... I will pick up the remanents of my failed programmer ass, and start doing these tutorials. because thats the kind of programming i always wanted to do
ОтветитьVery interesting sir
Ответитьimplementing this in C on my 6502 homebrew, I got a NES controller and LCD working but I'm too dumb to know how tetris works so this is helpful :3
Ответитьthanks to you now i am able to resolve 3d array into 1d array also:
using
f(x,y,z)=index
f(x,y,z)=width*y*depth+x*depth+z
i dont know whether someone has found this formula before..
but i just found this formula and i am so happy with this..
i found this formula by trying to draw 3d array as a cube and just try and error what will happen if...
and then i found this formula..
maybe god helps me with this thank to god
and also thank to you because you showed how to resolve 2d into 1d array
current had been following the video for 12 mins.
im stuck with the test compile the program. the program successfully compiled but cant run (incompatible version) and when im compiling using other compiler, it throws a lot of errors such as 'byte is ambiguous'.
i was beginner on C++.
anyone ever had this problem before ?
I am wondering if it is possible to compile this on the linux command line easily(like changing a few lines) or would parts of the program have to be rewritten completely?
ОтветитьI've been looking for a fellow like you for months. Thank you for your content it'll help me rise from a basic understanding of programming to a practical tangible experience I've been looking for.
Ответитьafter 34th minute, I get a bug. When I start the program, a shape appears with letters A. Then the shape goes down second by second. When it reaches out the base, then 4 rows with "equal signs" like this "=" appears. For the second shape with is fulled with G letters, same problem occurs. When the shape reaches out to the base and there will be no space to go down, 4 rows "=" signs appears and then these "=" signs disappears. How can I solve this bug? Thanks.
Ответитьhello
javidx9
I am walking through a c++ course right now and planning to walk through all your "code it yourself video" afterward is this playlist good for programming and c++ in general or the information is mostly for gaming .
Thank you very much!
Javidx9, I just want you to know, you are a Giga-chad (that's a compliment) for actually managing to make your own NES emulator, and coding tetris from scratch using friggin' C++.
One day I hope I can make my own game engine.
do an update using ncurses to be crossplatform. for the gotxy function of cursor printing
ОтветитьDidn't work for me with the settings provided however if I increase the screen width to 120 it works great!
ОтветитьWhy are you still using windows? Should all developers be using macOS by this time?
ОтветитьMr, i am stuck while trying to program tetris in olcPixelGameEngine could you make a video on how to do it..
i only manage to make square shape and "I" shape asset..
and make it fall down on its own..
(because that part is taught in the tutorial section in the wiki tab in Github)
for other assets i failed to even draw it in its initial position..
its very challenging for me since you have to move the asset down automatically with that unsymmetry shape..
drawing is solely on nested for loop..
one loop for x coordinate and another for y coordinate..
i tried to draw based on boolean array..
but seems that would need more and more explicit programming
(and i tried to avoid that)
because for example my asset is 20 pixels wide and 20 pixels height
i dont know what mathematic to apply..
can some one help?