Make a Tower Defense Game in Godot | Part 2 - Towers & Script Inheritance

  Рет қаралды 24,913

Game Development Center

Game Development Center

Күн бұрын

Пікірлер: 83
@GameDevelopmentCenter
@GameDevelopmentCenter 3 жыл бұрын
All the tutorials I made are free. All the tutorials I will make will be free. Support this vision by joining the YT member club, or with a pledge on Patreon: kzbin.infojoin www.patreon.com/gamedevelopmentcenter
@goodshowmanythanks
@goodshowmanythanks 3 жыл бұрын
I've watched every available popular Godot tutorial that others have made and I have to say I'm really appreciating the small stuff you go into. For example, explaining that scripts have different functionality depending on whether they're extending 'node' or 'node2d'. Other people would have assumed the person watching already knew that, but even three weeks into learning Godot I haven't seen this explained anywhere else. Knowing that this functionality is part of Godot gives me the ability to troubleshoot much better, as I can infer that other areas of GDScript work like this too. Absolutely stellar content, you're able to work quickly but nothing feels left out.
@GameDevelopmentCenter
@GameDevelopmentCenter 3 жыл бұрын
Thx Esago! It is difficult at times to assume what a viewer knows and doesn't know. Trying my best to keep the tutorials friendly for anyway without making them to lengthy for others. Glad the work is appreciated!
@Tylerl128
@Tylerl128 Жыл бұрын
@@GameDevelopmentCenter You really have an awesome way of explaining how it works without making it too confusing. Most tutorials I watch I don't think id be able to re create what i just watched without going back over the video. After watching yours though, I feel like I know what I'm doing.
@andresgrimminck8674
@andresgrimminck8674 2 жыл бұрын
I was going with some tutorials before finding this one, and kept doing okay on Godot. But after these tutorials you really have helped me a lot to understand everything and also good practices! Thanks!
@GameDevelopmentCenter
@GameDevelopmentCenter 2 жыл бұрын
Great to hear!
@josephguilder685
@josephguilder685 3 жыл бұрын
My son wants to be a game developer and as a unity guy, I said I would go through a series with him. We are both enjoying this series and we only do ten minutes a night. Great stuff and keep up the hard work. Patreon?
@GameDevelopmentCenter
@GameDevelopmentCenter 3 жыл бұрын
That's so cool Joseph :) Glad my tutorials are helping and sounds like a great farther and son activity you got going on there :) I have a Patreon and a KZbin member program, both links are in the video description :) Thx!
@DaBlues903
@DaBlues903 2 жыл бұрын
Really enjoying this series. I've been coding with Unity and its great but Godot really simplifies the game creation process. The structure was weird at first but after these videos its actually an extremely powerful tool!
@GameDevelopmentCenter
@GameDevelopmentCenter 2 жыл бұрын
Great to hear! I have used Unity for 3,5 years myself, and yes! When I got used to Godot things have been so much faster!
@slafdev6418
@slafdev6418 2 жыл бұрын
what a nice pedagogic way to explain things. For a beginner like me, this is pure gold. Keen to see all your other videos.
@GameDevelopmentCenter
@GameDevelopmentCenter 2 жыл бұрын
Awesome, thank you!
@stick7913
@stick7913 2 жыл бұрын
Thanks for this, you're really good at explaining all the steps
@hotcrossbun26
@hotcrossbun26 Жыл бұрын
amazing videos honestly. caveat I have a background in python and am familiar with OOP but your vids are so clear and so informative. really appreciate it
@fireforge5927
@fireforge5927 3 жыл бұрын
Thanks for the great tutorials! At 16:48 where you do get_node("Turret"), you can also do $Turret which does the same thing
@GameDevelopmentCenter
@GameDevelopmentCenter 3 жыл бұрын
I know, and I never use it
@Cyax84
@Cyax84 2 жыл бұрын
this tutorial is so good, eady to follow nice examples...best I have seen for Godot and makes so much fun. Thanks!
@GameDevelopmentCenter
@GameDevelopmentCenter 2 жыл бұрын
Happy to hear that!
@franciscodeodato7622
@franciscodeodato7622 Жыл бұрын
Its amazing when things works... thanks for the tutorial
@leonardopeixoto7013
@leonardopeixoto7013 3 жыл бұрын
this inheritance of scripts made my life so much easier. i was actuallu doing copy and paste turrent scripts.
@GameDevelopmentCenter
@GameDevelopmentCenter 3 жыл бұрын
Yup, we will be using it extensively in the series :)
@danielhaup599
@danielhaup599 3 жыл бұрын
This is beautiful
@GameDevelopmentCenter
@GameDevelopmentCenter 3 жыл бұрын
Thx Daniel
@morganp7238
@morganp7238 3 ай бұрын
Pity this is not for Godot 4.2.2, particularly the tilesets and tilemaps. Anyway, great effort. Thank you very much. You got a new sub. Good karma to you.
@Hawkknight88
@Hawkknight88 2 жыл бұрын
Still loving the tutorial - thank you!
@gutzimmumdo4910
@gutzimmumdo4910 2 жыл бұрын
i dont get the inheritance used as in the video, what is the point if u still have to copy and paste the path to each scene, how is that diferent from copy-paste the code? Shouldnt the scenes in "Turrets" (Lets say, if i create a new scene in the "Turrets" node) automatically inherit from any script in "Turrets"? Great tutorials anyways thanks.
@GameDevelopmentCenter
@GameDevelopmentCenter 2 жыл бұрын
1 line vs multiple lines, or I don't understand your question
@yashwanthsrini
@yashwanthsrini 3 жыл бұрын
Awesome video. Thanks.
@paulsmart4672
@paulsmart4672 Жыл бұрын
Fumbling away at Godot with no idea how to use it is incredibly frustrating, Superabundant options and settings and capabilities and I can't make any of them do anything. Following along with a tutorial from someone who really knows what they're doing in Godot is a real eye opener, though. It's shocking what can come together with a bit of clicking and a couple lines of code.
@randomdood5095
@randomdood5095 3 жыл бұрын
When I scripted it, the right side of the turret is turning to look at the cursor, not the front of the turret, may you help me fix that?
@GameDevelopmentCenter
@GameDevelopmentCenter 3 жыл бұрын
We haven't coded turret movement in yet apart from looking at the cursor for demonstration purposes. The tutorial for enemies is just out, over the next couple of episodes we will make the turret turn to the enemy. And look in a single direction when building :)
@randomdood5095
@randomdood5095 3 жыл бұрын
ok ty :)
@captain_t0rch688
@captain_t0rch688 3 жыл бұрын
Почему ты не используешь class_name? Так проще указывать, от какого класса наследован класс. / Why aren't you using class_name? This makes it easier to indicate which class the class inherits from.
@SpyrosSolda
@SpyrosSolda 3 жыл бұрын
Yes , having class_name = Turret and then using extends Turret seems more logical. Also I think it's better to use onready var turret := $Turret instead of get_node()
@CROXoDyLE
@CROXoDyLE 3 жыл бұрын
I came across one issue that may just be my own fault, but the barrel of the tank is not following my cursor exactly as intended with get_global_mouse_position(). It is offset like 90 degrees. I read a bunch of forums and cannot seem to understand why. im thinking it could possibly be the way i imported the sprites. I was wondering if anyone else came across this issue? please let me know thank you! p.s. Love this series!
@GameDevelopmentCenter
@GameDevelopmentCenter 3 жыл бұрын
The barrel of your tank, or the barrel of your tower? We rotated the sprites before import. If you didn't a 90 degree offset is expected to occur
@CROXoDyLE
@CROXoDyLE 3 жыл бұрын
@@GameDevelopmentCenter that was it! Thank you!!!!
@NetherMorne
@NetherMorne 2 жыл бұрын
I don't know if this was an updat or not but when i tried to extend the path (20:30) it would give me an error saying the string was invalid if I put the path inside * I fixed it by using " instead
@sampling666
@sampling666 3 ай бұрын
cant finde the Node Position2D in the catual version
@avianscience1395
@avianscience1395 2 жыл бұрын
I've copied the code for the teir 1 turret exactly and it says "the method turn isnt declared in the current class" and wont run
@GameDevelopmentCenter
@GameDevelopmentCenter 2 жыл бұрын
It is a computer, it doesn't feel, smell, see, think or decide. So the first step to fixing a bug is if you get a different outcome than what you see in the video. You did not do exactly the same. I help people fix bugs on Discord, feel free to join :)
@TheSuikoEnjoyer
@TheSuikoEnjoyer 3 жыл бұрын
I was wondering if it was possible to create custom nodes, or node templates to be exact and then inherit from those? As in 'parentTurret' which would have 2 sprites, a muzzle etc and then just use it as a template for other nodes?
@GameDevelopmentCenter
@GameDevelopmentCenter 3 жыл бұрын
It is possible to have a default turret scene and load the sprites and set the muzzles through code. You would store a dictionary with all that information and reference it when the tower has to come into the game. So yes, absolutely possible, but it has no place in a beginner tutorial :)
@johnnyxp64
@johnnyxp64 2 жыл бұрын
hi, at 20:50 while you create a new "script" you could use the "Inherit" property and click the folder icon and point the Turrets script so that it makes the new one and puts the inherit code on top by it self. Isnt this the exact same result?
@GameDevelopmentCenter
@GameDevelopmentCenter 2 жыл бұрын
Probably is, never used it though
@gingershrimpale
@gingershrimpale Жыл бұрын
I did almost everything like in videos (only differences that i did not turn images and i made a map with different road) but when i try to play the scene godot shows me only a grey screen( Also it asks for underscore before delta in phys_proc, should it be like that?
@gingershrimpale
@gingershrimpale Жыл бұрын
Oh never mind i just pushed wrong button
@kanati
@kanati 2 жыл бұрын
I *think* maybe you have some explorer extension that lets you rotate right from the context menu because I totally do not have that. I do have "convert image" which allows you to do a lot of things including that rotation though so it was simple enough to use that. But I have never seen that "rotate right" option in any install of windows 10 that I've been on (and I manage hundreds of PCs across multiple companies). Perhaps it's something you have to enable somewhere?
@GameDevelopmentCenter
@GameDevelopmentCenter 2 жыл бұрын
I don't know. I googled it before using this option in the tutorial, and Google said it is totally standard from Windows 10
@OrdinaryLatvian
@OrdinaryLatvian 2 жыл бұрын
@@GameDevelopmentCenter For the record, I'm using the regular Windows 10 file explorer and the option was there. Great tutorial, by the way. You're a good teacher. :)
@asmodeusz28
@asmodeusz28 3 жыл бұрын
Would it be possible to attach the same script to both the turrets, as an alternative to extending the script?
@GameDevelopmentCenter
@GameDevelopmentCenter 3 жыл бұрын
Not impossible I believe although that isn't going to give us the flexability we need in future tuturials.
@speed2cz
@speed2cz 3 жыл бұрын
Is extending the script better than setting the Turrets as a class, and inheriting the new custom class?
@GameDevelopmentCenter
@GameDevelopmentCenter 3 жыл бұрын
I don't think there is much difference. For something that has pretty much one use, like in this case, I usually extend the script. If it works more like a tool, that I may export to other projects, I make it a class. Do what has your preference :)
@ukrsolid
@ukrsolid 3 жыл бұрын
Nice!
@orthodoxcaveman5819
@orthodoxcaveman5819 3 жыл бұрын
I got stuck here, always having the following error when using play scene: ' get_node: (Node not found: "Turrets" (relative to "/root/Map1/Turrets/GunT1")'. Anyone else having the same problem?
@GameDevelopmentCenter
@GameDevelopmentCenter 3 жыл бұрын
Post a screenshot of the error and your node tree in the Discord (linked in the video description) and we will get that sorted in no-time :)
@DimtriPortilla
@DimtriPortilla Жыл бұрын
I edited the picture the item still points up in godot no matter what photo edited thing I use
@Edel99
@Edel99 3 жыл бұрын
Would it be a good idea to set the physics fps higher to accommodate monitors with higher refresh rates: 144+ ? Thanks for the great tutorial.
@liam99c
@liam99c 3 жыл бұрын
No, if you want smooth movements then you should use func _process(), which calls the function every frame. Using a higher physics fps will make smoother movements but will slow down the game if any more computationally difficult things, like physics, are called on func _physics_process().
@Edel99
@Edel99 3 жыл бұрын
@@liam99c yes but in Godot we use the physicsbody2D nodes which are supposed to run in physics_process(). If you wanted to make smooth movement using kinematicbody2D how would you accommodate higher refresh rates?
@randomdood5095
@randomdood5095 3 жыл бұрын
Amazing. :)
@GameDevelopmentCenter
@GameDevelopmentCenter 3 жыл бұрын
Thanks!
@Kelenn35
@Kelenn35 Жыл бұрын
1:28 I can't find the Position2D child node in Godot 4. Can anyone help me please ?
@-Solenya
@-Solenya Жыл бұрын
It's now called Marker2D
@jocaznatabla5668
@jocaznatabla5668 Жыл бұрын
the new version of godot doesnt have "Position2D" like you did in 4:37
@jocaznatabla5668
@jocaznatabla5668 Жыл бұрын
was it Mark2D?
@wowi3814
@wowi3814 Жыл бұрын
It is now called marker2D
@venturex8441
@venturex8441 3 жыл бұрын
when comes the next part?
@GameDevelopmentCenter
@GameDevelopmentCenter 3 жыл бұрын
It was supposed to be Sunday, but my neighbours had a party for their son. The recordings were horrible :rofl: I have to rerecord, trying to get this done over the next two days and release on Wednesday.
@codecomedytv1998
@codecomedytv1998 3 жыл бұрын
me: Godot 4 wen? Godot: 🤷‍♀️ me: ok stefan, you have enough time to make this 3D multiplayer
@captain_t0rch688
@captain_t0rch688 3 жыл бұрын
Is it multiplayer?O_o
@codecomedytv1998
@codecomedytv1998 3 жыл бұрын
It can be if we make it 🤓
@GameDevelopmentCenter
@GameDevelopmentCenter 3 жыл бұрын
Hahaha, I'm already doing multiplayer, blockchain NFT Tower Defense in the live stream ;)
@captain_t0rch688
@captain_t0rch688 3 жыл бұрын
@@GameDevelopmentCenter oh, really? Where? Give me a link, if you have saved live stream
@codecomedytv1998
@codecomedytv1998 3 жыл бұрын
Yes, link please. Ste-fans can make NFTs together
@Bepis-man
@Bepis-man 2 жыл бұрын
all my tower's dependencies were lost and my game doesnt work now ive gotta restart😕
@Bepis-man
@Bepis-man 2 жыл бұрын
this did not go well for me
@GameDevelopmentCenter
@GameDevelopmentCenter 2 жыл бұрын
Join the Discord so we can help you :)
@luanlemes9799
@luanlemes9799 3 жыл бұрын
i see that you cut your hair.....nice man taking care of your self i see (offtopic is important change my mind)
@GameDevelopmentCenter
@GameDevelopmentCenter 3 жыл бұрын
Always!
Make a Tower Defense Game in Godot | Part 3 - Main Menu & Scene Switching
24:53
Game Development Center
Рет қаралды 21 М.
Make a Tower Defense Game in Godot | Part 1 - Creating the Map
20:29
Game Development Center
Рет қаралды 36 М.
Новый уровень твоей сосиски
00:33
Кушать Хочу
Рет қаралды 3,8 МЛН
АЗАРТНИК 4 |СЕЗОН 2 Серия
31:45
Inter Production
Рет қаралды 1 МЛН
POV: Your kids ask to play the claw machine
00:20
Hungry FAM
Рет қаралды 14 МЛН
What Makes Tower Defence Games Good?
21:31
RealityEscape
Рет қаралды 1,2 МЛН
How To Fail At Tower Defense Games
3:27
Artindi
Рет қаралды 87 М.
Using Composition to Make More Scalable Games in Godot
10:13
Firebelley Games
Рет қаралды 227 М.
Stop Getting Lost: Make Cognitive Maps, Not Levels
26:27
Make Your Own Raycaster Part 1
16:52
3DSage
Рет қаралды 421 М.
Godot 4.1 Tower Defense Tutorial - Part 01 (Random Path Generation)
56:34
I went through ALL Unreal Engine Plugins, here is what I found
36:35
Godot 3D Particles Introduction | Arcane Bolt | Godot Particles Series #1
20:51
Game Development Center
Рет қаралды 25 М.