C++/SDL2 RPG Platformer Tutorial for Beginners Part 8 | Dynamic Arrays

preview_player
Показать описание
This trusty C++ SDL2 tutorial will set you out on a quest to make a RPG type adventure game with the core game play mechanics being physics based 2D platforming. We'll go all the way from beginner to advanced in this tutorial, and by the end you should have a fine looking 2D platformer. This series will cover proper integration and time stepping, our own physics system, and all the lore that comes with game development tutorials. You won't need any prior knowledge of programming or physics, so hitch along for the ride, eh?

#codergopher #coding #programming
Рекомендации по теме
Комментарии
Автор

Marty is just a legend. These tutorials are nice and easy to understand while still being very knowledgable. Great work, man!

brandondp.
Автор

At 11:40, you can also do it with emplace_back() method like this -> entities.emplace_back(60, 60, grassTexture).
This way you basically skip the copying part of the push_back() method and instead call the constructor in place and generate new Entity in the back.
Makes your program just a little bit faster :) You probably knew about this already, but others might have not, also don't know if you say it in the next videos cus I haven't watched them yet. Great tutorial so far!

Asasyn
Автор

Following you for quite some time: your voice has been changed a lot. It's very pleasant to listen you, aspecially right now.
Thanks for your lessons!
~Russian viewer

sparkpresentmax
Автор

Just watched all the episodes so far. Excellent work man. The fact that all the videos contains tips to begginers was pretty awesome to me.

mateuschwarz
Автор

Yay, vek-tors! Good job on the music too. Sounds nice + not distracting to me. Cheers! :)

DarshanSenTheComposer
Автор

You're a real one Marty I will always support your channel

bandanaboii
Автор

I'm from Brazil, my english is... you know, but, i can understand almost everything you say, thanks for your tutorials, i came by PolyMars channel, this guy has a video called: "learning sdl2 in 48 hours", he mentioned you, then i came here to learn sdl, and it was the best decision.

msrobot_
Автор

Thanks for this tutorial. It helps me alot!
BTW I read mc van buck. It really is hilarious

amalbhandari
Автор

Your videos are awesome, but the background music is a bit distracting, Keep up the great work bro♥.

boultifnidhal
Автор

Your tutorials are awesome, things are easy to understand with you. Make more vids dude :>

payer
Автор

You can also iterate through the dynamic array and render everything using a normal for loop instead of for-each loop by using platforms.size() which preexists so you don't need to create one. Code-

for(int i = 0; i < platforms.size(); i++) {
win.render(platforms[i]);
}

timurmee
Автор

The reason it's called a vector comes from the Mathematical word "vector"(a quantity that has magnitude and direction by a directed line segment whose length represents the magnitude and whose orientation in space represents the direction broadly)
so in a way the C++ vector can go in two directions right(push_back/add element) and left(pop/remove element). It's kinda strange at first but when you imagine the C++ vector as a directed line with it's start as A and it's end as B it starts to make sense.

commandershepard
Автор

12:00 I thought you could only do this in Rust.... good to know

mrt_
Автор

Some of these comments 🤔. Well anyway, another good addition to the series! Keep it up.

DarkPlaysThings
Автор

you could have just pushed back an entity rvalue at the end instead of adding braces. Or better yet use emplace_back to construct it in place instead of making on the stack and then copying it to the heap

oskardeeream
Автор

Couldn't you just use an actual dynamic array or an array without a length specifier and then just static cast the length of the array to an integer variable?

HiddenBrick
Автор

Is there something that C++ is bad for?I mean, is there something specific that is better in something(like GUI's, AI, Games...., and that stuff) that C++? :) serious question.

chex
Автор

@codergopher
2:27 a vector is a concept in matrices and arrays, mathematically speaking. A scalar is just a single independent number, vector is defined as a row or column matrix(a column matrix, but also written as row using transpose), and finally, an array or a matrix has multiple rows and columns. Going by that, the library std::vector is quite accurately named. If i had seen that in high school i would have been confused too, because they teach this stuff in engg math.

MayankYadav-eheg
Автор

if you guys believe the vector name is confusing in english, here in Romania arrays are called vectors and actual vectors...well....dynamic vectors?

bogdanmilos
Автор

The 2 dislikes are people who cant get through the tutorial

MapleBaconator
join shbcf.ru