Тёмный

How To Make A Game #6 : Implement Tilemap's : C++ And SDL2 Tutorial 

Let's Make Games
Подписаться 15 тыс.
Просмотров 91 тыс.
50% 1

Опубликовано:

 

12 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 123   
@poupdujour
@poupdujour 4 года назад
I totally agree about the need to see the results of your work from time to time to maintain interest. Seeing the characters and tile maps implemented even though they are simple really keeps the drive going. This series has been great, thanks for your contribution.
@Eldermanable
@Eldermanable 3 года назад
Sir, you're the best ressource for SDL2 I've found. Even if i'm french, this is much easier to understand than most of french tutorials. Thanks you !
@jonayedmohiuddin538
@jonayedmohiuddin538 Год назад
totally agree,..best resource
@kaczok61
@kaczok61 7 лет назад
This is the best tutorial of SDL I have seen on the internet. Ty very much :)
@CarlBirch
@CarlBirch 7 лет назад
Joker DDZ no problem, just glad people are enjoying them :)
@kaczok61
@kaczok61 7 лет назад
My first steps in SDL I tried to do with LazyFoo tutorial. When I was watching all youtube tutorials I had feeling dat everybody learns from him how to programm with SDL. Is it true in your case ??? Sorry for my english. Its not my native language.
@CarlBirch
@CarlBirch 7 лет назад
+Joker DDZ yeah, lazy foo was one of the first tutorials I read when I was learning it. The main issue I found with SDL tutorials was the lack of context, so that’s what I’m going for here :)
@kaczok61
@kaczok61 7 лет назад
Exactly ! I had the same problem. I knew how to render some textures, make key input but how to link everything and make game. Dat was main problem and I think u gonna solve this problem. Do what u do . Great job :)
@justaar4036
@justaar4036 6 лет назад
I second that. Needed it so bad for a uni assignment and everything he covers, covers the criteria for my assignment. Pure live saver.
@masakrs
@masakrs 5 лет назад
Why didnt I watch your videos when I was making a project for a job interview.....But hands down, best tutorial on SDL and C++ I have seen on RU-vid. Period.
@domagojhamzic9892
@domagojhamzic9892 4 года назад
Funny coincidence, Currently, I'm making a project for a job interview :')
@TamakoYT
@TamakoYT 3 года назад
@@domagojhamzic9892 which programming job requires such projects?
@benjamindusunceli9461
@benjamindusunceli9461 3 месяца назад
@@TamakoYT it is for job in graphics engineering like 3D engine or something
@TamakoYT
@TamakoYT 3 месяца назад
@@benjamindusunceli9461 oh I see, ty!
@pierodelgado5805
@pierodelgado5805 7 месяцев назад
For those who their map isnt rendering. For me, the problem was assigning the values of x y w h to source and destination. I changed it to: rectSource = { 0, 0, 32 ,32 }; rectDestination = { 0, 0, 32 ,32 }; (I changed the variables names) And it worked just fine.
@freemotion21
@freemotion21 4 месяца назад
🫡 thanks mate
@xedvap
@xedvap 4 года назад
Man these tutorials are great, they are easy to understand. I have to make a game in C for Uni Project with server and client, but i had never used any graphics libraries and these tutorials are the best.
@soumyajeet7809
@soumyajeet7809 3 года назад
Instead of zeroing the whole array like that you could you something like this: int lvl1[20][25] = { 0 }; or you could use memset() function: memset(lvl1, 0, sizeof(lvl1)); or finally by using dynamic allocation with the help of vectors: vector lvl1(20, vector(25, 0)); Great tutorials regardless. Thank you for these!
@soumyajeet7809
@soumyajeet7809 3 года назад
@@gari1633 Yeah I actually saw that later! I thought he was gonna use something like a map parser to fetch the tile values instead of manually entering them. Regardless, I decided to leave the comment since it could be helpful for those who don't know these ways!
@soumyajeet7809
@soumyajeet7809 3 года назад
Also, on a side note I was wondering where did he disappear? I mean, the last video uploaded was 3 yrs ago!! Any idea/news? I really liked his way of explaining things.
@atifaomer9543
@atifaomer9543 3 года назад
I started watching your tutorial series because codergopher left his... anyone came from there? Like this
@teduy2823
@teduy2823 4 года назад
oh! Carl got a haircut! :)
@domagojhamzic9892
@domagojhamzic9892 4 года назад
The first thing that I noticed :')
@boxhatboys635
@boxhatboys635 7 лет назад
I was just getting more into game programming and this videos are really good keep up the good work
@CarlBirch
@CarlBirch 7 лет назад
+BoxHatBoys thanks!
@coderopes2983
@coderopes2983 7 лет назад
pls visit my chanel for games in c,c++ without graphics
@hehekrazy4901
@hehekrazy4901 11 месяцев назад
im having a problem getting the tiles to render on the map. i have made the water, dirt, and grass tiles and set up the code exactly like you did but for some reason i can not seem to get the tiles to load onto the map. my whole screen is white instead. any idea what i need to look for to fix this?
@dominatingwind
@dominatingwind Год назад
I reviewed my code multiple times, and it is exactly like yours, yet nothing new happens when I debug. the background is all white. Dunno if I can continue the playlist without completing this lesson first.. Edit: fixed it for me. Make sure you have the "
@blinkonline1
@blinkonline1 3 года назад
Hey, I was near quitting the series at video 2. Im working on windows in VS and was confused from using os in your video and had some errors loading SDL_Image. In the end it worked and now im really a fan of your stuff. Its logical, in small steps and really motivating. Thanks for this.
@TheLeontheking
@TheLeontheking 6 лет назад
love the flow of the series, makes it really easy to follow along! :)
@lupinedreamexpress
@lupinedreamexpress 5 лет назад
Useful tutorials there where some problems I saw but you seemed to have fixed them in multiple iterations. Its really helped carry me along in learning how to work with the libsdl2 library.
@benjahnz
@benjahnz 6 месяцев назад
Really enjoying this. Thanks for taking your time.
@GaryOakPR
@GaryOakPR 3 года назад
I get a message saying "free(): invalid pointer)" after closing the window, but otherwise the program works perfectly. This seems to point towards memory leak issues. Any tips? Do I need to deallocate the 2D array in the destructor function?
@vladyslavostrovskyi9180
@vladyslavostrovskyi9180 Год назад
this is the best course I've ever seen
@Fukiyel
@Fukiyel 7 лет назад
Thank you for your videos ^^ Say, i'm pretty new to C++, but i was wondering, we are using several times some "new", but never some "delete", doesn't it create memory leaks ?
@idknuttin
@idknuttin 7 лет назад
yes it does create memory leaks, whenever you use "new" go to the clean function in the game class and delete whatever you created.
@TheLordoftheDarkness
@TheLordoftheDarkness 4 года назад
@@VarianteMobile This seems interesting. Did he make a video about it ? Otherwise can you link me to anything about this ?
@DungNguyenVan-og2ld
@DungNguyenVan-og2ld 5 лет назад
you can choice int lev1[20][25] = {0} will be faster
@greg77389
@greg77389 2 года назад
I noticed you've been declaring new instances of objects but you haven't been deleting them on cleanup. Won't this cause memory leaks?
@AnteP-dx4my
@AnteP-dx4my Год назад
" If you have only one .exe file that uses the allocated memory, the memory will be automatically deallocated when the program terminates, so you may not need to explicitly use delete. "
@greg77389
@greg77389 Год назад
@@AnteP-dx4my That's only if the program terminates normally.
@benjaminstorey6124
@benjaminstorey6124 Год назад
I'm currently 3 days into learning C++ and this series is awesome, even I can follow along. I have run into a snag here though. I followed each instruction (i watched the video twice to make sure) and when I run the program I still get a white background. I tested each png by replacing player.png and they all work. I made sure to include map->draw(); in the render function in Game.cpp so it's not that either. Basically there is no map and I have no idea why. Help please
@---hz1vi
@---hz1vi Год назад
Well ik this was made 5 years ago but I've read all the comments and none of them have helped so far and my code as far as i can tell is the same so this is my last ditch effort for a solution. I have used "std::cout" to test each part of my code and make sure all the for loops are running correctly and to verify that my array is being set to 0 and that it is 20 by 25. Yet when i run it the back round is still white. I have made sure that the textures are the right size (i did this by putting their names into the player draw statement and it draws them correctly) So i honestly don't know whats wrong. Any suggestions would be greatly appreciated.
@Solo6R
@Solo6R 6 лет назад
Why are you dynamically allocating (heap allocated) all your game objects like player, and map? I don't see a reason to make them pointers, just create them on the stack
@GuppyFacesAreCute
@GuppyFacesAreCute 3 года назад
mate you're teaching me so much, thank you!
@Destroyer19941995
@Destroyer19941995 6 лет назад
Man your videos are awesome
@CarlBirch
@CarlBirch 6 лет назад
GoldSpark thank you 😊
@Destroyer19941995
@Destroyer19941995 6 лет назад
Let's Make Games Yesterday I was watching them from 12AM to 7AM hahaha .. and kinda got stuck on ECS because of the new keywords .. Is instead of using ECS good to use Binary tree??
@lonotalonota5779
@lonotalonota5779 3 года назад
>int lvl1[20][25]={ 0 }; Works to create a huge 0 field as well
@tomiivaswort6921
@tomiivaswort6921 3 года назад
I've got a problem: When I started with testing the code, It only had loaded the first row. I changed it bit, and now it isn't loading anymore. Can someone help?
@Apebek
@Apebek 5 лет назад
can someone explain how games make use of different rooms? for exemple supermetroid? Is the whole world one big tilemap or is every room a single tilemap that gets loaded when you go through a door? If room 1 is a tilemap and room 2 is a tilemap then you would need to map all door transitions in your code? Like door A in room 1 brings you to door A in room 2 en door B in room 1 brings you to door A in room 3? And if it were one big fat tilemap you would only have to change the camera position to a different section of the total map? What is more efficient?
@octopro8937
@octopro8937 Год назад
FOR ANYONE GETTING NO ERRORS BUT THE TILEMAP NOT LOADING MAKE SURE THAT THE SPRITE IS THE RESOLUTION OF 32X32 OTHERWISE IT WON'T WORK RIGHT
@1337Frygg
@1337Frygg 7 лет назад
Why you dont use tileset (1 png for all texture) ?
@CarlBirch
@CarlBirch 7 лет назад
Fry GG I will be in the next tilemap video, I need to do a video on creating the tile set image, then another on loading the various textures from the same atlas by moving the srcRect around the image. I am keeping the implementation simple then as we continue, making the system more robust as we will be loading maps from an external level file
@Commonfiend
@Commonfiend 9 месяцев назад
Thanks again for another lesson. I was wondering about if you have any kind of copyright on this code? After I finish this tutorial series I want to make a different kind of game, a playing card game. But I think it would help to base my game on the structure of this game engine.
6 лет назад
Is it possible to get the whole source code? Thank you
@e_cleaver
@e_cleaver 6 лет назад
I'm kind of lazy and did not fell like writing out all the 0 and 1. Used a for loop and if statements.
@vladlungu2806
@vladlungu2806 6 лет назад
Really nice! Keep up the good work!
@SotraEngine4
@SotraEngine4 11 месяцев назад
At 21:19 isn't it smarter to type dest.w than 32?
@dr.velious5411
@dr.velious5411 3 года назад
It's starting to come together now, my art is bad tho, I'm using the blur tool to cover for the fact that I just don't feel like doing pixelart right now.
@nalt5146
@nalt5146 Год назад
I was nearly going insane because i couldnt get this part to work, and them i saw it, i placed a "dest.y" instead of "dest.h", so i was not defining the height of the destination rectangle, no error was given, i even placed some couts in the switch that would tell me what and where something was being placed just to be sure that was working. My worst enemy is my typos and my eyesight, great tutorial.
@richardpullen6053
@richardpullen6053 6 лет назад
Fresh trim
@FFDEV
@FFDEV 2 года назад
when I click debug it just compiles forever and never opens after this tutorial
@kaankarakoc7680
@kaankarakoc7680 Год назад
my tilemap runs once in tenth try why is not working always?
@FlavourlessLife
@FlavourlessLife 6 лет назад
I dunno... the use of a global renderer variable seems kind of sloppy?..
@iqwrjwqioprwjriopqrjpqowir
@iqwrjwqioprwjriopqrjpqowir 4 года назад
If there's only 1 renderer and it's probably scoped (graphics::renderer or graphics_renderer) I don't really see the problem of it
@derpz_
@derpz_ Год назад
thats the thing, you use static members so that other classes can share it
@jefferymonfort9516
@jefferymonfort9516 4 года назад
My water is not rendering, even though I have no errors... If I put my player texture in as "water" it renders that but not the separate water texture I made
@Puella91vanna
@Puella91vanna 4 года назад
I have the same problem and I can't find a reason why...
@narref4317
@narref4317 4 года назад
Kinda late, but check if your water texture has the same image resolution as your player, if it doesn't then that's the problem 'cause in the gameObject class you have srcRect.h and srcRect.w set to fit your player but not to fit your water, just change the resolution passing it as a parameter and it'll be fine :)
@micropocari1604
@micropocari1604 5 лет назад
off topic: were you filming this at 2 am?
@pickleman2972
@pickleman2972 5 лет назад
dedication
@NateNo
@NateNo 6 лет назад
nice haircut
@RagnarD3
@RagnarD3 3 года назад
Loooooooking gooooood my man. wp wp wp
@sqraploote6173
@sqraploote6173 5 лет назад
This didn't work quite perfectly for me: SDL_Renderer* Game::renderer = nullptr; ...had Code::Blocks giving me the following: error: 'nullptr' was not declared in this scope After some Stack Overflow'ing, I changed "nullptr" to "0" and got it working just fine. Is 0 an okay substitute?
@patrykostasz8975
@patrykostasz8975 5 лет назад
'nullptr' is a keyword used for pointer initialization in c++11. You probably don't have compiler flag set to c++11. As for your question. Yes, 0 is a good substitiute. By using 0 you are reffering to part of memory with address 0 which is correct. You can use name NULL as well which under the hood is defined like this: #define NULL 0
@alvarolopezgarcia3939
@alvarolopezgarcia3939 3 года назад
Any idea why random numbers appear on my lvl1 2D array??
@TheYakakaka
@TheYakakaka 3 года назад
Most likely you did not assigned zero to those values or somewhere you are assigning values to the array. I numbered the columns so id be sure that all 20x25 are properly filled. int lvl1[20][25] = { // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 { 1, 1, 1, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //0 { 1, 1, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //1 { 1, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //2 { 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //3 { 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //4 { 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //5 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //6 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //7 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //8 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //9 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //10 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //11 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //12 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //13 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //14 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //15 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //16 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //17 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //18 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} //19 };
@GoblinArmyInYourWalls
@GoblinArmyInYourWalls 7 лет назад
Are you to (or can you) create an in game map editor? Something that saves directly to an external file for later reading?
@CarlBirch
@CarlBirch 7 лет назад
+Chris Mcpherson Hi, yes I will be using pyxel edit for the art, which you can export a csv file which I will then be parsing ;)
@GoblinArmyInYourWalls
@GoblinArmyInYourWalls 7 лет назад
Well, I was thinking more along the lines of an editor built within the engine. Also, an in game editor has much more potential than just for maps. Say, for an entity that is supposed to walk from one place to another repeatedly, instead of hardcoding that data, you could create within the editor 'path points' for it to follow. Ultimately, this is your series, albeit, as a fan, this is a feature I would love to see you teach. Edit: I now realize you could easily just implement that very feature without the need for an in game editor
@CarlBirch
@CarlBirch 7 лет назад
Chris Mcpherson I can do that in the future, not really something I’m considering for the near future, though would be a great thing to teach
@GoblinArmyInYourWalls
@GoblinArmyInYourWalls 7 лет назад
The only reason I suggested it is because that software costs, and creating an in game editor would keep your series on a track to cost nothing. Unless, that is, you know of a free software that can edit .csv
@Stuartcat2
@Stuartcat2 6 лет назад
Fresh haircut btw.
@brianmaingi8542
@brianmaingi8542 2 года назад
My tile maps aren't showing could there be an explanation
@dominatingwind
@dominatingwind Год назад
Same, for me, background still white. Did you fix it?
@Solo6R
@Solo6R 7 лет назад
So we can't use more standard resolutions like 1920 x 1080, or 1280 x 1024? 800 x 640 is a pretty weird resolution....
@CarlBirch
@CarlBirch 7 лет назад
+GunnDawg we will be making it full screen in a future episode, and automatically drawing the correct size and scale when we start dealing with moving the character past the screen. Those values were picked as they don’t cover the whole screen as I’m recording (console output) and they divide nicely by 32.
@loomex5896
@loomex5896 7 лет назад
good video
@CarlBirch
@CarlBirch 7 лет назад
+Taktik thanks
@CarlBirch
@CarlBirch 7 лет назад
+Taktik thanks
@coderopes2983
@coderopes2983 7 лет назад
pls visit my chanel for games in c,c++ without graphics
@APaleDot
@APaleDot 6 лет назад
Why does he need to do the double for loop when he loads the map? Like, the input array is 20x25 and the member array is also 20x25. So, can't he just replace the array directly? Map::LoadMap(int arr[20][25]) { map = arr; } Basically, just replacing the pointer to the start of the array.
@petertarany2313
@petertarany2313 5 лет назад
I think its because if u do what u said, u can change your source array when u change your map. At the current state, it doesnt really matter though, but i think its for future stuff, or just something like good practise
@simonlovec5570
@simonlovec5570 4 года назад
It throws out this error for me: 1>Map.obj : error LNK2019: unresolved external symbol "public: static void __cdecl TextureManager::Draw(struct SDL_Texture *,struct SDL_Rect,struct SDL_Rect)" (?Draw@TextureManager@@SAXPAUSDL_Texture@@USDL_Rect@@1@Z) referenced in function "public: void __thiscall Map::DrawMap(void)" (?DrawMap@Map@@QAEXXZ) 1>D:\OneDrive\Other\cpp\Dev\BirchEngine - Game Loop\bin\Win32\Debug\BirchEngine.exe : fatal error LNK1120: 1 unresolved externals 1>Done building project "BirchEngine.vcxproj" -- FAILED.
@majklavzar9057
@majklavzar9057 4 года назад
Hey, did you ever figureout what was wrong? I'm getting the same error
@xdeathcon
@xdeathcon 3 года назад
@@majklavzar9057 I finally figured out the source of this. It's caused by defining the function Draw just like that, instead of TextureManager::Draw in TextureManager.cpp. No idea if you guys figured it out or not, but hopefully this helps someone else who ran into this problem.
@sticksuicide230
@sticksuicide230 4 года назад
I know I'm commenting on this a bit late, but I had one question regarding the "global" renderer variable you created to be used between classes: For example - To allow other classes to use this renderer variable, you included "Game.h" in the TextureManager class, and included "TextureManager.h" in the Game class. Since they are including each other, will this cause performance issues? Is there a neater way of doing this, since you only require the renderer variable from the Game class?
@hydra1346
@hydra1346 4 года назад
i didn't use the global renderer since it is rather sloppy to have global variables in general
@vinaciotm
@vinaciotm 6 лет назад
Please, up next videos Thanks a lot
@Coffeemancer
@Coffeemancer 6 лет назад
Why does my player guy move much faster than this video? I have the frame limiter code in
@idknuttin
@idknuttin 7 лет назад
If you wanted to code all of this in one cpp file how would you do it since the you need gameobject before game in order to create player in void init in the game class and you need game class created in order to pass game::renderer in the void render function in gameobject?
@CarlBirch
@CarlBirch 7 лет назад
idknuttin you can make the player etc global. And use forward declarations for any classes that you haven’t defined yet. Curious as to why you would want it in one massive file?
@idknuttin
@idknuttin 7 лет назад
I was just wondering how it would work but I usually do use different files.
@CarlBirch
@CarlBirch 7 лет назад
idknuttin fair enough :)
@misterpoof3197
@misterpoof3197 4 года назад
niiiiiiice !!!!!
@jairoacosta8940
@jairoacosta8940 6 лет назад
thank you
@denisflavius5365
@denisflavius5365 6 лет назад
Why when I compile the map does not occur?
@CarlBirch
@CarlBirch 6 лет назад
If you could send me your code to my Facebook page I’ll have a look :) you can find the link on my channel home page
@denisflavius5365
@denisflavius5365 6 лет назад
I send my code from Map.cpp and Map.h in private
@semihmasat
@semihmasat 5 лет назад
@@dolphinplaygames3106 what was the solution? It doesn't show up but i don't get any error either
@Puella91vanna
@Puella91vanna 4 года назад
@@semihmasat I am stuck on the same problem :-(
@dominatingwind
@dominatingwind Год назад
@denisflavius5365 so? what was the fix?
@alexs2195
@alexs2195 4 года назад
why not use a pointer to pass the map array to the map in loadmap?
@blufrog9546
@blufrog9546 3 года назад
yeah, thought the same, the loop is useless, could have just assigned it
@tlekbalkai
@tlekbalkai 5 лет назад
nice haircut!
@AndiBLEH
@AndiBLEH 6 лет назад
Aaaahhhh I'm having a lot of fun but I find myself just typing out what you have and not really understanding it all. I couldn't delete all this code and retype it is what I'm saying...sooooo I'm not learning.... :(
@ecssiah
@ecssiah 6 лет назад
After each lesson, start modifying what he's done in your own copy. When you force yourself to change and add things, you'll start understanding it better. Then return to the original for the next lesson.
@catalinul5700
@catalinul5700 5 лет назад
The previous answer was great. You need to practice a lot to be able to do it on your own.First of all, understand the structure he uses for its game and how all things work together. You really need to start with small projects, for example, snake, tetris and from there on you can build bigger projects.That's what I do and that's what everybody does.
@Arillaxe
@Arillaxe Год назад
SDL_Grass xD
@michaelerbaturakis2435
@michaelerbaturakis2435 5 лет назад
WHY []25[20]
@12isaac00
@12isaac00 4 года назад
To fill the screen, 25*32 (the resolution of his tiles) is 800 (the width of his window), 20*32 is 640, that's also why he changed the 600 height he had at the begining to 640.
Далее