[LIVE] Code-It-Yourself! Sliding Block Puzzle Games

  Рет қаралды 57,746

javidx9

javidx9

Күн бұрын

Пікірлер: 85
@javidx9
@javidx9 4 жыл бұрын
A big thanks to those who donated during the stream - it really caught me by surprise :D
@mabroorahmad2182
@mabroorahmad2182 4 жыл бұрын
You are realy impressive. i wish i could copy paste your skills in my head.
@adammarkiewicz3375
@adammarkiewicz3375 4 жыл бұрын
Hi, I'm looking through content of your channel, great material, interesting to watch and very nicely presented. I haven't checked the code in the final version, but I've noticed you're using vector of unique_ptr to exploit polymorphism and that's absolutely fine, but you haven't done it immediately and later it skipped out of sight: if you want unique_ptr to do its work correctly, block should have virtual destructor declared. In your particular case this could just work, as you use only plain attributes that do not require their own destruction, which does not mean this is correct approach. This should be declared off the bat just when you decided such implementation. Thanks for the content you produce!
@benoitb.3679
@benoitb.3679 4 жыл бұрын
I really like this (edited) quote from 17:03 (ish): "Okay, it's difficult to master, I won't argue with that, but getting it working for you... when you're starting out programming, one of the first t things you'll realise is 'hang on, everything seems like hard work'. But after a while, it sorta clicks and you go 'well, this is actually making my life much easier'. And you'll start developing tools that help you. Once you've hit that point, you know it's for you; it's going to be what you need to do for the rest of your life."
@Edzward
@Edzward 4 жыл бұрын
4:37 I have fond memories of this! From the time I used to program DOS roguelike rpg games entirely from ASCII characters! Man, so much fun!
@benoitb.3679
@benoitb.3679 4 жыл бұрын
17:03 Genuinely my favourite perspective on programming. Clearly heartfelt given the nature of the situation and what you were doing. Thank you.
@robertszacki1628
@robertszacki1628 4 жыл бұрын
Thank you for this great video. Much helpful and great inspiration. What I wanted to note is that "Push()" method could be called "Pushable()", because it just returns true or false and as the "Move()" method is there. Also like your Block representation. As for Goals, It is possible to use two layers of Blocks to achieve Goals functionality (independent Blocks and Floors), which is similar solution to the one presented in your video. Like the idea behind Horizontal, Vertical and Countdown blocks. :)
@javidx9
@javidx9 4 жыл бұрын
Thanks Robert, yeah that's what I like about this approach - its highly extensible, and yes pushable() is much better XD
@akjir
@akjir 4 жыл бұрын
​@@javidx9 This was even a suggestion in chat, moments after you wrote it. (41:42 kariboo84 "pushable" naming ?) :-D
@return6005
@return6005 4 жыл бұрын
Reversing the direction (NORTH to SOUTH, EAST to WEST, etc) can be done by a xor with 0b10 (2) instead of adding 2 and mod 4 Block->Push(dirPush ^ 0b10)
@markpaterson2260
@markpaterson2260 4 жыл бұрын
Thanks for taking your time to do this even while you're so busy. It's much appreciated!
@BudgiePanic
@BudgiePanic 4 жыл бұрын
I made this exact game in my first year at university, or more precisely, an undo and redo move feature. It’s actually very surprising just how similar OLC Pixel game engine is, to what we used in first year programming to start learning the basics.
@fburton8
@fburton8 4 жыл бұрын
Delphi is still very useful from a practical point of view and still well supported. I have used it to create commercial software that interfaces with laboratory hardware and does real-time data acquisition and analysis. It's less appropriate for games programming because most of the useful libraries and frameworks are designed for use with C/C++ (although Delphi can call them). You can also embed Lua in Delphi programs, and call python code. love the near instant compiles/builds.
@JurajOravecSGOrava
@JurajOravecSGOrava 4 жыл бұрын
When you press INSERT key in most text editors you can overwrite the string for the "map".
@akjir
@akjir 4 жыл бұрын
"X. X. X. Excellent." He he. Like your videos. Entertaining and educational.
@csgowoes6319
@csgowoes6319 2 жыл бұрын
I did the timed tile like this, under the default: switch option: if (isdigit(tile)) { vLevel.emplace_back(std::make_unique((int)tile-48)); break; } Then I could put any digit 0-9 on the map and it would work. I know you said you were keeping it simple but I figured this was pretty simples, though I have a feeling there must be a less cheesy way to turn a string into its equivalent ascii integer!
@budman85
@budman85 4 жыл бұрын
Hi, when I tried compiling on Linux, I was getting no operator!=, in the header file you're missing these: bool operator == (const v2d_generic& rhs) const { return ( this->x == rhs.x && this->y == rhs.y ); } bool operator != (const v2d_generic& rhs) const { return !( this->x == rhs.x && this->y == rhs.y ); }
@javidx9
@javidx9 4 жыл бұрын
Hmmm. Good catch. I was using 2.07 in the video, so i guess its time to upload that to the repo.
@sewkokot
@sewkokot 4 жыл бұрын
@@javidx9 Another linux user and new follower of your channel :) Update the github repo to 2.07, please! You do great job, thank you :)
@bruno_kid_
@bruno_kid_ 4 жыл бұрын
thanks
@RetroCoderTV
@RetroCoderTV 4 жыл бұрын
Hi Javid. I've been watching your channel for years and recommending it. But I recently started up my own Assembly Language coding live on Twitch. Anyway, was going to make you a recommended channel on my KZbin and Twitch just thought I would let you know haha :D Keep up the quality work. I love all your videos
@M1SMR
@M1SMR 4 жыл бұрын
Hey javid, what do you think about the features added in the new C++ standards C++14/17/20? Do you think they improve the language or do you think they are unnecessary and complicate the language?
@laureven
@laureven 4 жыл бұрын
So looks like the next project will be to simulate Gravity and Space :)
@richardj.rustleshyman2026
@richardj.rustleshyman2026 4 жыл бұрын
Javid, perhaps in the future could you do a video on 2D elastic collision for balls and non axis-aligned walls?
@javidx9
@javidx9 4 жыл бұрын
Hi Richard - Already did, check out Programming Balls #2
@danielesquivel3155
@danielesquivel3155 4 жыл бұрын
yes ywy
@T3RRY_T3RR0R
@T3RRY_T3RR0R 2 жыл бұрын
Can't believe I've missed this video. Been meaning to make something like this with batch for a while.
@tiger12506
@tiger12506 4 жыл бұрын
A couple of thoughts: 1) Rather than nullptr empty blocks, create a block override that handles the do nothing situations. 2) The iterative approach to determining whether blocks can push looked pretty scary. I think the recursive approach would have been a lot cleaner. Also would tie in well with thought #1. Also, thinking in a more functional programming mode for a recursive approach would clean up all the random bools you had to add to make your iterative approach work. Interesting that without solid blocks on the level boarders, your code would wrap-around the pushing. 3) Copy/pasting the renderable argument into every DrawSelf function smells. Would have been better to leverage the fact you have a base class, block. i.e. block constructor takes renderable, stores in instance variable that the subclasses could access. 4) This was really cool, regardless. :)
@agent-33
@agent-33 2 жыл бұрын
This is awesome. I will try to code it in javascript. Good luck to me.
@mansirrabiu7412
@mansirrabiu7412 4 жыл бұрын
Thanks very much! I am dying for the networking video you promised in the rect collision video.
@javidx9
@javidx9 4 жыл бұрын
Promised??
@mansirrabiu7412
@mansirrabiu7412 4 жыл бұрын
Oh I am sorry sir! I re-watch the video and here comes the correct version of my words, ( I doff my hat sir, programmer like no other in the whole universe(atleast to me). I am dying for the networking video you tipped us(not promised) on in the rect. collision video. May God help you again and again in all your endeavours). Your biggest admirer: Mansir
@pierreyao7221
@pierreyao7221 4 жыл бұрын
Great work Javid
@isaiasdimitri4110
@isaiasdimitri4110 4 жыл бұрын
VCode: It cannot do this. David: Yes, it *does* ahhaha
@yhezelmabajen2627
@yhezelmabajen2627 7 ай бұрын
is this applicable on visual basic? i badly needed some source code to make as a reference in my school project, thanks!!!
@jayasribhattacharya2048
@jayasribhattacharya2048 4 жыл бұрын
I missed the live stream due to History class :-(
@tijani3141
@tijani3141 4 жыл бұрын
Class on a sunday
@jayasribhattacharya2048
@jayasribhattacharya2048 4 жыл бұрын
@@tijani3141 yeah our school is kinda wierd
@iProgramInCpp
@iProgramInCpp 4 жыл бұрын
In July?
@jayasribhattacharya2048
@jayasribhattacharya2048 4 жыл бұрын
@@iProgramInCpp yeah bro I am in India :-)
@iProgramInCpp
@iProgramInCpp 4 жыл бұрын
@@jayasribhattacharya2048 do you ever get summer vacation or something?
@iProgramInCpp
@iProgramInCpp 4 жыл бұрын
The std::unique_ptr removes the need for deleting stuff, as it's being done already, right?
@backwardspy
@backwardspy 4 жыл бұрын
Yes, unique_ptr frees the underlying memory for you when it is deleted, assigned a different pointer, or reset.
@iProgramInCpp
@iProgramInCpp 4 жыл бұрын
@@backwardspy nice
@ishc3ice
@ishc3ice 4 жыл бұрын
yes, same for shared_ptr
@KC-vq2ot
@KC-vq2ot 4 жыл бұрын
Javid, what are your thoughts on "best practices"? I started coding with Java, moved to C++ and Python in university, but use pure C for work. I am still learning and do (truly) professional stuff for less then a year with most of my expirience in small or personal projects. Code seems so much more clean, when you throw all that OOP/clean coder/never manage memory/whatever-best-practice-academia-farted-out-this-week garbage out the window. It is smaller because there are less then a million levels of abstractions, easier to understand because there are less dog-extends-table-because-it-has-four-legs gems and you can start developing a lot faster, because you don't need to spend a hundred years evaluating all the (theoretically) reusable components and passive agressive class hierarchy. I work nights as a bouncer, but that thing makes me want to cry. Also, I hope the guy who made unit testing a thing burns in hell. Don't get me wrong. I subscribe to the spirit (and not the letter) of SOLID and am big supporter of stuff like deep project planning so often ommited in methods like SCRUM. Being honest, I don't even know how people live(d) without polymorphism. It is such an obvious way of making games and other real time simulations. Overloading is also great and I really miss it. It is just that "best practices" seem perpendicular to common sense and fail to make case for themselves. With unit testing, if your functions are so complex that some non-obvious bugs emerge requiring unit testing to pinpoint them -- you failed as a person. If your function is actually complex (like a lot of graphics staff) you will need something of equal complexity to test it, defeating the purpose. With OOP, inheritance is just bad and "reusability" that gets shoehorned in because "don't repeat yourself" slowly corrupts whole project by adding unnecessary complexity via workarounds like factory pattern and inability to evolve code separately. All of them look good only next to some strawman code. Am I right to treat them more as general guidelines or are they called "best" for a reason that is not obvious unless you make something the size of "Witcher 3"?
@codeguppy
@codeguppy 3 жыл бұрын
You make C++ coding so fun ;-)
@russellabraham9208
@russellabraham9208 4 жыл бұрын
How long have you been programming? You have a lot of great knowledge thank you for sharing.
@8lb6ozbabyjsus
@8lb6ozbabyjsus 4 жыл бұрын
Don't you have a video of Arcus playing in the background?
@javidx9
@javidx9 4 жыл бұрын
I do. Arcus is great! Swag staaaaaaaaarrrrrrr! Its my 8bits of advice for new programmers video.
@8lb6ozbabyjsus
@8lb6ozbabyjsus 4 жыл бұрын
@@javidx9 thanks I was on his stream today and was talking to someone about seeing him on a video but I couldn't remember for the life of me what one!!
@bonus5804
@bonus5804 4 жыл бұрын
26:47 I am learning c++ and I don't understand why you captured everything in the lambda with '&', because I don't think you needed it, because the lambda doesn't use any external value ?
@Wosser1sProductions
@Wosser1sProductions 4 жыл бұрын
He used `(this->)vLevelSize.x` inside the lambda, which is from the scope of the lambda.
@ciaragarrity6425
@ciaragarrity6425 4 жыл бұрын
Big question: Is java slower than C, C# and C++? Java is easier to understand in my opinion and I wouldn't like it if my game was slow Thanks for your channel!
@javidx9
@javidx9 4 жыл бұрын
Hi Ciara, technically yes, java and c# are slower than c++, but it doesnt matter unless your project is large, complicated, resource intensive.
@ciaragarrity6425
@ciaragarrity6425 4 жыл бұрын
@@javidx9 oh well, whats the difference between C# and C++?
@akjir
@akjir 4 жыл бұрын
@@ciaragarrity6425 www.guru99.com/cpp-vs-c-sharp.html
@ciaragarrity6425
@ciaragarrity6425 4 жыл бұрын
@Aramis Razzaghipour hey i heard that Minecraft ported to consoles, they used Java as their programming language. They apparently converted its code into C. If, I did make a game in Java, would my hard work go to waste? Could I convert the code, and how? Thank you.
@streetfashiontv9149
@streetfashiontv9149 4 жыл бұрын
@@ciaragarrity6425 depends what platform your making it for. If its to deploy as a mobile app then no because Java is the official language of Android (although Kotlin is increasingly becoming popular). If your making a AAA title for console then C++ is the industry standard. Indie games for PC can be made in either although C#/C++ is the most common because these languages are indigenous to game engines like Unity and unreal engine.
@roamingcelt
@roamingcelt 3 жыл бұрын
Seeing that all blocks are the same size and the block size is global; why did you need to pass the block size in the DrawSelf?
@philtoa334
@philtoa334 4 жыл бұрын
So nice
@vitacell1
@vitacell1 4 жыл бұрын
javidx9 love your videos, those help me. Please more of those videos but written in C.
@_girnetix_
@_girnetix_ 3 жыл бұрын
Hi, can you make video about game timer with solution this problem for me? :)
@matttherat9533
@matttherat9533 4 жыл бұрын
javidx9 : using c++ to program . me : using Holy c .
@zystemd3172
@zystemd3172 4 жыл бұрын
Holly shit you made in 2 lines and some notes what i try to do since 2 month : some kind of polymorphisme. I am really a dickhead :(
@morball6668
@morball6668 4 жыл бұрын
I really wish we wouldnt be “learning” bloody scratch at school
@iteratedofficial
@iteratedofficial 4 жыл бұрын
Thankfully we have the internet :D
@puncherinokripperino2500
@puncherinokripperino2500 4 жыл бұрын
WE'LL DO IT LIVE! F*** IT!
@ZomB1986
@ZomB1986 4 жыл бұрын
Sokoban is a lazy spelling of Soukoban, Japanese for Warehouse Duty
@adamdux5216
@adamdux5216 4 жыл бұрын
nice
@RecycleBin0
@RecycleBin0 3 жыл бұрын
net yaroze pushy 2
@danielesquivel3155
@danielesquivel3155 4 жыл бұрын
Yo te amo uwu, tas hermoso. Sigue asi.
@banabana4691
@banabana4691 4 жыл бұрын
i coming
@vittorioromeo1
@vittorioromeo1 4 жыл бұрын
Good video! However, not a fan of the use of polymorphism here. For example, you could represent the blocks with a `std::variant` of all possible block types. You were forced to use dynamic allocation and introduced the complexity of dynamic memory management via `std::unique_ptr`, which I do not think is necessary for a simple game like this one.
@muhammadhaider5677
@muhammadhaider5677 4 жыл бұрын
Go watch his channel trailer.
@robertszacki1628
@robertszacki1628 4 жыл бұрын
From what I've seen the Blocks are constructed just once at the game beginning, and then they are just moving on the array, so I guess there's no overhead because of dynamic construction.
Code Review: Saving Sedit Platform Game
45:20
javidx9
Рет қаралды 30 М.
BIG PROJECT! Top Down City Based Car Crime Game #1
1:03:52
javidx9
Рет қаралды 112 М.
小路飞还不知道他把路飞给擦没有了 #路飞#海贼王
00:32
路飞与唐舞桐
Рет қаралды 76 МЛН
Quirky Quad Trees Part1: Static Spatial Acceleration
44:01
javidx9
Рет қаралды 70 М.
Harder Drive: Hard drives we didn't want or need
36:47
suckerpinch
Рет қаралды 1,7 МЛН
Reverse emulating the NES to give it SUPER POWERS!
22:21
suckerpinch
Рет қаралды 1 МЛН
"Hello, World" in 5 CURSED languages that no one should use
13:08
Dreams of Code
Рет қаралды 553 М.
olc::AllSorts - Text/Commands/Sounds/Jams
21:55
javidx9
Рет қаралды 32 М.
BIG PROJECT 2-in-1! Top Down City Based Car Crime Game #2
1:32:44
Forbidden C++
33:07
javidx9
Рет қаралды 1 МЛН
50K Live Code Party
2:11:51
javidx9
Рет қаралды 35 М.