Godot 3.0: Top-down Tank Battle - Part 1

  Рет қаралды 104,117

KidsCanCode

KidsCanCode

6 жыл бұрын

Welcome to a new tutorial series. Many of you have requested a full game tutorial, so I've chosen a top-down tank game. I have no idea how many parts this will be, but as we go we'll cover things like tilemaps, pathfinding, ai/behavior, and many other topics.
Note: If you're a complete beginner in Godot, you should start here first:
• Learning Godot 3.0: Yo...
Art by Kenney: kenney.nl/assets/topdown-tanks...
Follow the written version of the series here:
kidscancode.org/blog/2018/04/g...
Code for this part can be downloaded here:
github.com/kidscancode/topdow...
Support me on Patreon: / kidscancode

Пікірлер: 218
@alekseyabramov9259
@alekseyabramov9259 Жыл бұрын
Edit for Godot 4.0: for export use @export var Bullet: PackedScene @export var speed: int @export var rotation_speed: float @export var gun_cooldown: float @export var health: int
@yaybaby7984
@yaybaby7984 4 ай бұрын
You're a real one for this thank you.
@upyours2707
@upyours2707 6 жыл бұрын
New tutorial from senpai. The day starts good!
@Slaziel
@Slaziel 3 жыл бұрын
I'm here after the first game tutorial, and your videos are making me love godot! Thanks
@kidando
@kidando 6 жыл бұрын
Finally, a proper Godot tutorial. Good pace. Thanks for this.
@Kidscancode
@Kidscancode 6 жыл бұрын
Thanks!
@michaelthelen5297
@michaelthelen5297 6 жыл бұрын
Sooo good! Im super excited about this one... this was one of my favorite games on Atari back in the day.
@Oscar4u69
@Oscar4u69 4 жыл бұрын
this is one of the best tutorials that i've found, thank you so much 💜
@MsKocagoz
@MsKocagoz 6 жыл бұрын
This is exactly what I waiting for, thank you sir.
@RexN6
@RexN6 6 жыл бұрын
Thank you very much for this new tutorial, it's awesome.
@bagualexandrubogdan8768
@bagualexandrubogdan8768 3 жыл бұрын
Thanks ! Best godot tutorials ! I'm a web developer with 10 years of experience and I can tell you this that this tutorial are very useful due the lack of documentation/tutorials on main website. I'm waiting the book! Very good job thanks again!
@Bananeisafree
@Bananeisafree 6 жыл бұрын
This is a pretty damn good concept ! Thank your time and efforts !
@retrobeastgames
@retrobeastgames 6 жыл бұрын
Loving your tutorial series, you have excellent way of teaching, i also got my son to watch, as he loves computers, and he interested in making games. Thank you so much for your videos :o)
@lofinotion
@lofinotion 4 жыл бұрын
this is the best so far
@BastiaanOlij
@BastiaanOlij 6 жыл бұрын
I am looking forward to following this series :)
@2000saltydog81
@2000saltydog81 3 жыл бұрын
I'm a few years late to the party but I'm following along now. Thank you for the tutorial
@VEXHIGHLIGHTS
@VEXHIGHLIGHTS 3 жыл бұрын
THX SOOOOO MUCH!! I have been trying to find a good Tutorial but none and you gave me the BEST!
@YOSFP
@YOSFP 6 жыл бұрын
That Texture Region selector is super useful, never seen that before 🤯
@pixelrabbit261
@pixelrabbit261 4 жыл бұрын
It's another great series :) One thing I would like to see is a basic description in the titles for easy reference when looking back e.g. Godot 3.0 Top DOwn Tank Battle - Part 1 Basic Motion. That would make it perfect for me 99/100 at the moment ;)
@ftAnx
@ftAnx 4 жыл бұрын
Awesome tutorial. Thanks.
5 жыл бұрын
A guy that goes by the name of "Papai Game Maker" or "Papai Maker" here on KZbin created a PAID Godot 3.0 course on Udemy that is litterally your FREE tutorial translated to portuguese. I bought it and accidentally came across your original tutorial while looking up Tank sprites ...
@CleitonSilva-eh5bc
@CleitonSilva-eh5bc 5 жыл бұрын
Actually, the channel guy mentioned, got the content passed here and did a paid course in Portuguese. It's the same content, just changed the sprites used, but the structure is the same. = /
@sergiojunior9113
@sergiojunior9113 4 жыл бұрын
It's really true and I'm taking this course right now ... and it's just like your tutorial ... why didn't I find it before paying for the course ??? :((((
@Ardorstorm
@Ardorstorm 4 жыл бұрын
@@CleitonSilva-eh5bc yes that's literally what they said. That's not a fucking good thing, whoever made the paid course should get shut down.
@talanock
@talanock 4 жыл бұрын
what did this papai guy actually do? did he take this video and just talk over it in portuguese? or did he record his own tutorial with his own footage and just used this as a 'script.' One is straight up stealing, the other is just being lazy.
4 жыл бұрын
​@@talanock He downloaded all the source material for the course and made his own video reproducing the exact steps and everything but in portuguese. brazilian youtubers do that a lot and they call it "getting inspiration from other channels" but it's clear plagiarism. (and i'm brazilian)
@MisterBrown94
@MisterBrown94 6 жыл бұрын
Finally! I'm so excited! :D
@Huderlord
@Huderlord 6 жыл бұрын
I learned much more than i expected in this short video :O
@NeZversSounds
@NeZversSounds 5 жыл бұрын
My new favorite youtube channel
@ekowidodo6590
@ekowidodo6590 6 жыл бұрын
thank...i am wait for next tutorial sir...
@abdoelbassetmed7749
@abdoelbassetmed7749 6 жыл бұрын
U r the best man, I love ur videos💓، can't wait for the next one
@bakytkamchybekovichstndv1440
@bakytkamchybekovichstndv1440 6 жыл бұрын
I am rewatching this video again :)
@jaysanprogramming6818
@jaysanprogramming6818 5 жыл бұрын
I used 3.1beta3 to follow this and the exported variables showed only after I restarted Godot. In this video, I discovered the existence of Position2D node, the look_at function, and some basic inheriting techniques. Good job as always.
@Kidscancode
@Kidscancode 5 жыл бұрын
3.1 still has issues, so be aware you're going to have problems. I don't recommend it for learning, you're just likely to get frustrated.
@jaysanprogramming6818
@jaysanprogramming6818 5 жыл бұрын
@@Kidscancode I know, it's only for testing intent. If I struggle, I can still use the stable 3.0.
@avvvqvvv99
@avvvqvvv99 6 жыл бұрын
legend
@fossegutten6579
@fossegutten6579 6 жыл бұрын
It's happening!
@j.d.waterhouse4197
@j.d.waterhouse4197 6 жыл бұрын
Yay! A new game from Chris...Thanks Dude!
@renokurnia1285
@renokurnia1285 6 жыл бұрын
Awesome!
@pol3321
@pol3321 6 жыл бұрын
Tank you very much
@slumberstudio4757
@slumberstudio4757 6 жыл бұрын
make sure leave a like guys, cz this is gonna be awesome
@mylegguy8115
@mylegguy8115 5 жыл бұрын
at 8:51, when I select the area of the image it also takes the color of the background with the selected img. Help.
@bozo2466
@bozo2466 4 жыл бұрын
Tank you
@Rivali0us
@Rivali0us 6 жыл бұрын
More Please!!
@bagofwheat5713
@bagofwheat5713 4 жыл бұрын
thanks
@phantomito91
@phantomito91 3 жыл бұрын
For those of you who have everything perfect on the scripts and the tank still doesn't move, check at 15:48 if you have changed the value of the exported variables. You are welcome.
@planetquack123
@planetquack123 3 жыл бұрын
Thanks, I really needed this!
@serwizzart
@serwizzart 6 жыл бұрын
thanks alot for this one!
@superpig0831
@superpig0831 4 жыл бұрын
THNX
@VectoRaith
@VectoRaith Жыл бұрын
A question: The look_at() method is sure very convenient for fast-pacing action shooter because it provides instant rotation; But what if you need a "lagging turret" (turret that requires time to reach for aim) on such rotating body? I've tried rotating such turret but it always needed to be clamped on either x or y coordinate and end up really messed up.
@juanantoniobelmonte5530
@juanantoniobelmonte5530 6 жыл бұрын
Thanks for your complete tutorial. I'd like a special way to move the tank: if for example the body is 90 degrees and I push the left key, the body smoothing with no movement turn until 270 degrees and then go to the left. The same if it is looking at left y I push the right button. In your tutorial right and left keys only rotate and forward and back are producing the movement. Thanks and sorry for my bad English
@GameCarpenter
@GameCarpenter 2 жыл бұрын
Not sure I follow, but if you're looking for a stationary turret, like the classic game Paratrooper, you basically change which sprite you are rotating in the left and right checks (the turret rather than the body).
@programaths
@programaths 4 жыл бұрын
Hi, I gave the same presentation for Dojocon and I should have watched your videos. I'll make a Tank tutorial too, but focus on explaining Godot and bits of maths.
@Enchant3ddd
@Enchant3ddd 3 жыл бұрын
Could you make a tutorial that shows how to apply acceleration and deceleration to a tank ?
@MattHuisman
@MattHuisman 6 жыл бұрын
Tanks for this!! Woot
@Kidscancode
@Kidscancode 6 жыл бұрын
Oh no, the tank puns! :D
@nicklansbury3166
@nicklansbury3166 6 жыл бұрын
Actually you started it. At the beginning of the video you said 'The game can go in many different directions'. :D
@Slakimil
@Slakimil 4 жыл бұрын
thx
@brainfragment2975
@brainfragment2975 6 жыл бұрын
What if I wanted to use a controller? How would I set the muzzle rotation to the right analogue stick?
@Kidscancode
@Kidscancode 6 жыл бұрын
Have a look at docs.godotengine.org/en/latest/classes/class_input.html There's a `get_joy_axis()` method that will give you the analog stick values. You can snap the angle of the turret to the angle of the two axes, or you can use the method we use later in the tutorial to interpolate the turret's movement to the input direction.
@mylegguy8115
@mylegguy8115 5 жыл бұрын
Watching this before I have Godot downloaded
@MrLiquidxIce
@MrLiquidxIce 5 жыл бұрын
how did you learn to code like tht like steps should i take to get at your lvl
@seewhale8565
@seewhale8565 4 жыл бұрын
Hello, I am curious why you didn't create a "Main" scene at the beginning?
@aboelsoof301
@aboelsoof301 3 жыл бұрын
Thanks (that's the least I can say)
@j.d.waterhouse4197
@j.d.waterhouse4197 6 жыл бұрын
For beginners like myself, when you want to rotate any sprite sheet so things face right, just go to PXLR Editor online, and use 'Free Transform' to rotate it. It's Simple and easy!
@thepixelatedeclipse4876
@thepixelatedeclipse4876 5 жыл бұрын
Or just open it and hit rotate...
@Bianchi77
@Bianchi77 4 жыл бұрын
Good one...:)
@leonardoprestino5512
@leonardoprestino5512 5 жыл бұрын
how can i put the turret speed of the tank slower
@oakmars8062
@oakmars8062 4 жыл бұрын
Awesome tutorials! But I'm hoping to make a top down shooter game instead of a tank it's a character shooting enemies etc , is there a way to do that using these tutorials ? Any help is appreciated
@TheTenebraX23
@TheTenebraX23 4 жыл бұрын
Basically the same thing, change the sprites
@antoneyt
@antoneyt 3 жыл бұрын
It tells me I have 5 errors like the signal health changed is declaredbbutcnever emitted help me
@manikandanu2317
@manikandanu2317 2 жыл бұрын
Great tutorial thanks
@mugenmasters8564
@mugenmasters8564 Жыл бұрын
rotation isn't working
@Pspisripoff
@Pspisripoff 6 жыл бұрын
Awesooooome~!
@BrownieX001
@BrownieX001 6 жыл бұрын
Would you be able to show making mobile game and multiplayer through localhost server and client? Your tutorials are very helpful, thank you for all your work.
@Kidscancode
@Kidscancode 6 жыл бұрын
I'm considering adding multiplayer later on. As for mobile: I just added an exporting tutorial to the official docs: docs.godotengine.org/en/latest/getting_started/step_by_step/exporting.html
@s.u.h.6548
@s.u.h.6548 4 жыл бұрын
Hi! godot 3.1.1 is not letting me do the Extends kinematicBody2D. so I'm stuck, help or an update to this tutorial would be greatly apreciated, thank you!
@GameCarpenter
@GameCarpenter 2 жыл бұрын
Try KinematicBody2D... that is to say, watch out for capitalization. I failed to capitalize the D in 2D at least once.
@MattRose30000
@MattRose30000 6 жыл бұрын
How do you change the character in the editor that represents the indents? By default it looks like a >| but you have just a " which looks nicer imho.
@Kidscancode
@Kidscancode 6 жыл бұрын
I'm not sure what you mean. I haven't changed that from the defaults.
@MattRose30000
@MattRose30000 6 жыл бұрын
KidsCanCode hmmm maybe it's a Mac OS thing then, I'm on Windows. My Text Editor looks like this: i.imgur.com/qCEwQ62.png
@Kidscancode
@Kidscancode 6 жыл бұрын
That looks exactly the same to me. I have >| symbols too. Maybe it's just a combination of font size plus video scaling.
@MattRose30000
@MattRose30000 6 жыл бұрын
Yeah now I see it...
@aleksanderzajkowski8285
@aleksanderzajkowski8285 6 жыл бұрын
Like always I have some problems, this time: [Invalid set index 'wait_time' (on base: 'Timer') with value of type 'Nil'.] I typed everything like on the video.
@Kidscancode
@Kidscancode 6 жыл бұрын
I'm not doing as much hand-holding on this one, so if you haven't done the beginner game, you'll run into things like this. The error message tells you, it's trying to set wait_time equal to a non-value. Well, the code says use gun_cooldown, which is an exported variable. It won't have a value unless you click on the node and set the variable it in the Inspector.
@spootypoils
@spootypoils 6 жыл бұрын
Awesome! but I needed to set my speed to 5 (instead of 200) to work normally... did I missed something?
@Kidscancode
@Kidscancode 6 жыл бұрын
It sounds like you did. Check the player's control() code where you set the velocity.
@aidenthresher6470
@aidenthresher6470 4 жыл бұрын
I'm at 15:48 where we inherited the tank script to the new player script. I don't have any of those exported variables in my inspector? It just says "Script : Player.gd" and nothing else. EDIT: I saved and closed Godot then reopened it and everything was there where it was supposed to be. Now I have a new problem where my Tank Turret follows my mouse but its facing in the wrong direction? like its not pointed at my mouse its perpendicular with it. EDIT: I literally had to rotate the png I used for the sprite itself in a graphic editor.
@pablocalofatti3293
@pablocalofatti3293 5 жыл бұрын
hi, great tutorial, i had a problem whit mi code can you help me? i put export (float) var rotation_speed export (float) var gun_cooldown export (int) var health var velocity = Vector2() var can_shoot = true var alive = true func _ready(): $GunTimer.wait_time = gun_cooldown but when i try to test the tank this menssage apper invalid se index 'wait_time'(on base:null instance)with value of type null and i put the var export (float) var gun_cooldown but still apper the message
@chiefplankton8307
@chiefplankton8307 5 жыл бұрын
Instead of typing $GunTimer.wait_time Type - $Timer.wait_time Well.. it's kinda late to comment on this, but if anyone has the same issue, hope it helps.
@saurabhtembhurne2461
@saurabhtembhurne2461 6 жыл бұрын
Bro can you help in making 2d neon lights for platformer game in Godot, I'm trying but getting confused. Please help
@Kidscancode
@Kidscancode 6 жыл бұрын
Have you looked at the official demos? github.com/godotengine/godot-demo-projects There's a lighting one in there that might be enough to get you started. We'll probably tackle lights in this project at some point.
@ajgwapo1179
@ajgwapo1179 5 жыл бұрын
it says identifier not found: speed but I copied the script correctly?...any help?
@Kidscancode
@Kidscancode 5 жыл бұрын
Variables must be declared with "var". You seem not to have declared the "speed" variable. Check your code again.
@MoosesValley
@MoosesValley 5 жыл бұрын
Darn it. My tank does not move or turn. Been through the code multiple times and mine is exactly the same as yours. No compile errors. This is the danger with writing a fair amount of code and not doing any test runs until the end. Have added print() commands to my functions, and the player's control function is never being called. My player script inherits from tank, the paths are correct. Any ideas why is the player's control function is never being called ?
@MoosesValley
@MoosesValley 5 жыл бұрын
Ahh, found the problem. The player script wasn not wired up to the Player scene properly. Player -> Node -> Script and I had to re-load the Player.gd script to make it work. Haven't had to do this before. Wonder what I did wrong ... Anyway, working now. :)
@jasonylanan5038
@jasonylanan5038 6 жыл бұрын
Hello how can you make it an finish output like a app ?
@Kidscancode
@Kidscancode 6 жыл бұрын
I don't understand the question. What do you mean by "an finish output like a app"?
@Bianchi77
@Bianchi77 4 жыл бұрын
I got :"Script inherits from native type 'KinematicBody2D', so it can't be instanced in object of type: 'KinematicBody'" What do I miss ? Thanks
@Kidscancode
@Kidscancode 4 жыл бұрын
Looks like you tried to use a KinematicBody (3D) instead of a KinematicBody2D.
@Bianchi77
@Bianchi77 4 жыл бұрын
@@Kidscancode Ok, thanks, how can I change it ? I'm using Godot 3.1.1
@Bianchi77
@Bianchi77 4 жыл бұрын
Is it related with Project->Setting ?
@Bianchi77
@Bianchi77 4 жыл бұрын
@@Kidscancode Fix it==> change Tank =>change type to=>KinematicBody2D, it works now but on the far upper left corner....:).....not responding to keyboard yet, only to mouse for "Muzzle", I'll have a look and posted, anyway, thanks for the reply
@goldfoxlcp4216
@goldfoxlcp4216 5 жыл бұрын
I was wondering if you could explain some things to those who are still new to Godot (me). Why did you use a dollar sign when referencing to the timer (named GunTimer)? Why did you add the if statement just to return nothing? What is the control function? Sorry to ask so much, I'm just trying to understand as much of this tutorial as possible
@Kidscancode
@Kidscancode 5 жыл бұрын
This isn't really intended as a beginner tutorial. You should really start with the official docs step-by-step section: docs.godotengine.org/en/3.0/getting_started/step_by_step/index.html It has a first game project called "Dodge the Creeps", which I wrote, that explains the things you're asking about. I also made a video version of it if you prefer: kzbin.info/www/bejne/q4HSfX6HfJWao9k
@goldfoxlcp4216
@goldfoxlcp4216 5 жыл бұрын
Perfect! Thank you for the swift and helpful response ^-^
@ajgwapo1179
@ajgwapo1179 5 жыл бұрын
the player doesnt move smoothly it moves snappy and only moves whenever i tap right/left button not by long pressing it help
@Kidscancode
@Kidscancode 5 жыл бұрын
Did you use "is_action_just_pressed()" instead of "is_action_pressed()" ?
@ajgwapo1179
@ajgwapo1179 5 жыл бұрын
KidsCanCode thank you for answering....it worked
@insomeperson
@insomeperson 5 жыл бұрын
Hi @KidsCanCode, and anyone else reading this comment, may someone explain to me in detail what "rotated(rotation)" does? I can understand Vector2(speed, 0) but I don't understand how it's working with the "rotated(rotation)".
@Kidscancode
@Kidscancode 5 жыл бұрын
Vector2(speed, 0) points to the right (along the x-axis). We then need to rotate it to point in the direction the player is facing. "rotation" is the property of the body that records its facing direction.
@insomeperson
@insomeperson 5 жыл бұрын
@@Kidscancode Hi KidsCanCode, so sorry for the late response. Thanks so much for the explanation! Short and simple! You have great videos please keep up the good work :)
@rockmystyle
@rockmystyle 4 жыл бұрын
My gun doesnt follow the cursor, i tryed to rotate the guns sprite but it desnt help... how to fix it?
@mylegguy8115
@mylegguy8115 5 жыл бұрын
I don't know what I did but the tank does not move at run time. It only stands still but the turret does move with the mouse
@mylegguy8115
@mylegguy8115 5 жыл бұрын
@Charlie LO I figured it out. Double check make sure you have correctly named key binds/buttons in project settings by typing in their name in the upper bar. That's where my issue was.
@ThePixelitomedia
@ThePixelitomedia 4 жыл бұрын
Could you make a surviv.io clone with godot?
@pedropou888
@pedropou888 5 жыл бұрын
Why am I getting this ?? I did it as in the video step by step and this keeps appearing Invalid set index 'wait_time' (on base: 'Timer') with value of type 'Nil'.
@Kidscancode
@Kidscancode 5 жыл бұрын
You didn't assign a value to wait time in the Inspector, so it's "Nil".
@jsauerii
@jsauerii 5 жыл бұрын
Invalid set index 'wait_time' (on base: 'null instance') with value of type 'float'. I have spent 3 hours trying to find a spec of anything out of place from your tutorial above and notta. I have that variable as 0.4 and have even switched things out to no avail. Any ideas? 16 func _ready(): 17 $GunTimer.wait_time = gun_cooldown
@mylegguy8115
@mylegguy8115 5 жыл бұрын
You entered "Timer" when it is supposed to be the same as "GunTimer"
@mattgoodman2687
@mattgoodman2687 5 жыл бұрын
@@jsauerii it should say $Turret/GunTimer.wait_time = gun_cooldown
@TOEC
@TOEC 4 жыл бұрын
@@mylegguy8115 I ran into this problem and that was exactly the issue. Didn't notice he changed that in the setup of the base tank. Thanks.
@daveydark963
@daveydark963 5 жыл бұрын
I am using Godot 2(long story) and everything else seems nice but the turret looks 90 degree offset to the current mouse position.plz help,nothing on google😭
@Kidscancode
@Kidscancode 5 жыл бұрын
In Godot 2, the angle orientation was different. 0 degrees in Godot 3.0 points along the x-axis, while in 2.1, it points up (along the -y axis)
@KaiserKaddu
@KaiserKaddu 2 жыл бұрын
Hey there, everytime I try to test my player the game won't open. The output states this: --- Debugging process started --- --- Debugging process stopped ---
@askaranarbekov3145
@askaranarbekov3145 6 жыл бұрын
and why can not I start the stage until I designate the main scene?
@Kidscancode
@Kidscancode 6 жыл бұрын
You can play any scene by clicking the "Play Scene" button. I'm going to suggest that you stop following this tutorial and start with something more basic. I'm going to be showing how to put this game together, not how to code or use Godot's UI. You'll have a lot less trouble if you start here: docs.godotengine.org/en/latest/getting_started/step_by_step/index.html
@hacker2075
@hacker2075 4 жыл бұрын
The tank gun moves with the mouse but I cannot move the tank itself with wasd?
@pastuh
@pastuh 4 жыл бұрын
You forgot setup keys.. watch video start :)
@brandondp.23
@brandondp.23 3 жыл бұрын
Why is the variable "rot_dir" used? Can't you just do "rotation_degrees += rotation_speed?"
@diegomata1062
@diegomata1062 2 жыл бұрын
The turret is not looking at my mouse position and i dont know how to correct it please help (GOT IT)
@forgeflarion8362
@forgeflarion8362 5 жыл бұрын
for mine there is the issue on $GunTimer.wait_time = gun_cooldown I got: invalid set index 'wait_time' (on base: 'null instance') with value of type 'float'. can someone help?
@forgeflarion8362
@forgeflarion8362 5 жыл бұрын
nevermind, figured it out
@That1guygriff
@That1guygriff 5 жыл бұрын
What did you do to figure this out? I’m having trouble with the same thing. I have Gun Cooldown set to 0.4 in the Player inspector still nothing.
@franciscobocazbustos7204
@franciscobocazbustos7204 4 жыл бұрын
@@That1guygriff one of the fixes i found is to put the $Timer.wait_time = fire_speed outside ready( ) function i
@kingzeeb319
@kingzeeb319 4 жыл бұрын
So when the tank is moving backward, the left and right are reversed, how do I fix that?
@charliecasebolt5380
@charliecasebolt5380 3 жыл бұрын
I'm pretty sure that's just how the steering works (mine is the same)
@duysonnguyenbui496
@duysonnguyenbui496 3 жыл бұрын
@@charliecasebolt5380 ui_right => rot_dir -= 1 not rot_dir += 1
@Flomista9722
@Flomista9722 5 жыл бұрын
Hello i can't see the sprites when i launch the game but i see them in the viewport ... i don't understand why.
@Kidscancode
@Kidscancode 5 жыл бұрын
Likely something is wrong with your Camera settings and/or code.
@Flomista9722
@Flomista9722 5 жыл бұрын
Found the problem : rizesable in the config option in display-windows was not checked thank you for the tutorial it's a masterpiece for godot !
@jeffcato2297
@jeffcato2297 6 жыл бұрын
Great tutorial Thanks. Not sure why but my code wouldn't allow the tank to turn more than a degree in either direction until I moved the `var rot_dir = 0` outside of the `control` function in Player.gd. Strange to me that you didn't need to do that in your code for the tank to turn. hmmm.
@Kidscancode
@Kidscancode 6 жыл бұрын
Something else must be wrong. We set rot_dir to 0 each frame because we want it to be 0 if you're not pressing a key.
@jeffcato2297
@jeffcato2297 6 жыл бұрын
Yep - found the bug when I diff'd your code against mine... I was assigning the new rotation value to `rotation` instead of += ¯\_(°_o)_/¯
@Kidscancode
@Kidscancode 6 жыл бұрын
Glad you got it working!
@LordTamorrow
@LordTamorrow 5 жыл бұрын
Hello, my turret doesn't follow my Mouse. It turns, but not to the center of my Mouse Button. Can someone help me? PS: I rotated it in Godot.
@laurenzreinthaler2301
@laurenzreinthaler2301 5 жыл бұрын
You have to rotate it in a photo editing software
@nicos1819
@nicos1819 5 жыл бұрын
My tank stays in the upper left corner and cannot be moved with WASD. How can I change this?
@Kidscancode
@Kidscancode 5 жыл бұрын
You have to fix whatever is wrong. It's very hard to guess what it is. Maybe you have an error in your tank script. Maybe you didn't add the input actions.
@nicos1819
@nicos1819 5 жыл бұрын
@@Kidscancode Thanks for the tip. I actually forgot to add the input actions. Now the tank moves very well.
@rohan12arg
@rohan12arg 3 жыл бұрын
How to add the pics????
@TitlePending
@TitlePending 6 жыл бұрын
Nice, please add Multiplayer one V one at least :D
@BOT-fk9cg
@BOT-fk9cg 6 жыл бұрын
may be 3v3 on lan will also be cool (LAN)
@lincolnpepper816
@lincolnpepper816 6 жыл бұрын
Can you link to the assets in the description?
@Kidscancode
@Kidscancode 6 жыл бұрын
Done. :)
@lincolnpepper816
@lincolnpepper816 6 жыл бұрын
Thanks! Great tutorial as well, can't wait for the next episode.
@askaranarbekov3145
@askaranarbekov3145 6 жыл бұрын
Hello, I did it. but when I deleted the code in the general script and decided to reintroduce the code of your code into it, I got it Invalid set index 'wait_time' (on base: 'Timer') with value of type 'Nil'. before that the tank was working and moving, and when I decided to remove the code for fun, and again that code did not come out for me. I think the engine does not work well because it does not recognize the same code
@Kidscancode
@Kidscancode 6 жыл бұрын
If you cleared the script, you also removed any values you set in the Inspector. When you put it back, you didn't assign a value to the "wait_time" variable, which is what the error message says. You're new and don't know how everything works. This doesn't mean the engine doesn't work.
@askaranarbekov3145
@askaranarbekov3145 6 жыл бұрын
thanks, I'm really new, and I'm ashamed that I get you questions
@askaranarbekov3145
@askaranarbekov3145 6 жыл бұрын
I did everything as you said, worked, but the tank does not move to wash to help? why is it moving? The console does not issue errors
@GameCarpenter
@GameCarpenter 2 жыл бұрын
@@askaranarbekov3145 I know this is super old (and I'm not certain I understand), but if you lost the values you set in the inspector, you might have lost the speed value for the player as well, so it is moving 0 each second instead of 200 or whatever.
@abandoned7501
@abandoned7501 5 жыл бұрын
senpai...
@emmalolo7816
@emmalolo7816 Жыл бұрын
COMO RECORTO LOS SPRITES
@askaranarbekov3145
@askaranarbekov3145 6 жыл бұрын
Invalid call. Nonexistent function 'control' in base 'KinematicBody2D (Player.gd)'. help me pls
@Kidscancode
@Kidscancode 6 жыл бұрын
The control function is defined in the Tank.gd script, which the player and enemy tanks inherit from.
@askaranarbekov3145
@askaranarbekov3145 6 жыл бұрын
and how to fix it?
@Kidscancode
@Kidscancode 6 жыл бұрын
I have no idea. Maybe you didn't spell "control" right when you defined it. Maybe you're not inheriting the Tank script. There are many possibilities. Learning to find out what you've done wrong is a very important programming skill. Go through the tutorial again, look at the written version (linked in the description) and see where your code is incorrect. Please see my reply to your other comment re: starting with a more beginner-level project.
@mugenmasters8564
@mugenmasters8564 2 жыл бұрын
how to rotate turret with keyboard
@nathanchigs3366
@nathanchigs3366 3 жыл бұрын
what programming language does he use for the scripting?
@Kidscancode
@Kidscancode 3 жыл бұрын
Godot uses a scripting language called GDScript. I recommend starting with the "Getting Started" tutorial: docs.godotengine.org/en/stable/getting_started/step_by_step/index.html
@nathanchigs3366
@nathanchigs3366 3 жыл бұрын
@@Kidscancode Thank you!!!
@universesandboxer7405
@universesandboxer7405 Жыл бұрын
Getting error in tank scrpit
@ElenaDotNET
@ElenaDotNET 6 жыл бұрын
Rotated assets! raw.githubusercontent.com/kidscancode/topdown_tanks/master/assets/onlyObjects_retina_rotated.png
@universesandboxer7405
@universesandboxer7405 3 жыл бұрын
I cant make it , it shows errors all the time
Godot 3.0: Top-down Tank Battle - Part 2
15:11
KidsCanCode
Рет қаралды 35 М.
Top Down 2D Shooting in Godot
18:33
Code with Tom
Рет қаралды 82 М.
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 170 #shorts
00:27
Smart Sigma Kid #funny #sigma #comedy
00:25
CRAZY GREAPA
Рет қаралды 15 МЛН
🌊Насколько Глубокий Океан ? #shorts
00:42
Godot 3.0: Top-down Tank Battle - Part 3
18:47
KidsCanCode
Рет қаралды 31 М.
Getting Started with Screen Sizes in Godot 3
7:08
GDQuest
Рет қаралды 89 М.
Godot 3.0: Top-down Tank Battle - Part 4
17:45
KidsCanCode
Рет қаралды 35 М.
6 Tips to Better Organize your Godot Projects
11:39
GDQuest
Рет қаралды 133 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 3,9 МЛН
Godot 3.0: Top-down Tank Battle - Part 7
15:02
KidsCanCode
Рет қаралды 12 М.
Godot 3.0: Top-down Tank Battle - Part 6
16:34
KidsCanCode
Рет қаралды 14 М.
Using the Tileset Editor in Godot 3.1 (tutorial)
19:34
GDQuest
Рет қаралды 224 М.
How I made an Excellent Platformer
8:25
GoldenEvolution
Рет қаралды 259 М.
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 170 #shorts
00:27