Godot 3.0: Top-down Tank Battle - Part 1 - panicarts.com

Godot 3.0: Top-down Tank Battle – Part 1

Views: 91282
Like: 1611
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:

Art by Kenney:

Follow the written version of the series here:

Code for this part can be downloaded here:

Support me on Patreon:


  1. New tutorial from senpai. The day starts good!

  2. This is a pretty damn good concept !
    Thank your time and efforts !

  3. 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.

  4. Bro can you help in making 2d neon lights for platformer game in Godot, I'm trying but getting confused. Please help

  5. 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)

  6. I learned much more than i expected in this short video :O

  7. What if I wanted to use a controller? How would I set the muzzle rotation to the right analogue stick?

  8. Great tutorial! 😀 And yes, Use Pixel Snap gets rid of some annoying graphical glitches when you are using tile-maps, so make sure its on!

  9. Invalid call. Nonexistent function 'control' in base 'KinematicBody2D (Player.gd)'. help me pls

  10. and why can not I start the stage until I designate the main scene?

  11. 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

  12. 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!

  13. 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.

  14. 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.

  15. That Texture Region selector is super useful, never seen that before 🤯

  16. Hello how can you make it an finish output like a app ?

  17. hi, thanks for all the tutorials you done for us. would you like to suggest how to read the gdscript api?

  18. 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

  19. Finally, a proper Godot tutorial. Good pace. Thanks for this.

  20. I am rewatching this video again 🙂

  21. Hello Sir, We are students in France, we have created an online platform dedicated to students

    of the world, students are signing up on our site in order to follow courses, or to correspond with other students.

    We tried to browse your videos youtube, we find that the content is clear and comprehensive.

    So we decided to propose you to simply put your course in our platform.
    To be done, we would need your official agreement.

    Your courses on our platform will allow you to have many more views of course
    and make your youtube chanel known

    If you accept, we could just embed your youtube videos link .

    Wishing you good reception, cordially

    Our platform is in this adress :https://galatsii.com

  22. 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'.

  23. 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 <3

  24. the player doesnt move smoothly it moves snappy and only moves whenever i tap right/left button not by long pressing it help

  25. it says identifier not found: speed but I copied the script correctly?…any help?

  26. Hello i can't see the sprites when i launch the game but i see them in the viewport … i don't understand why.

  27. how did you learn to code like tht like steps should i take to get at your lvl

  28. 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?

  29. My tank stays in the upper left corner and cannot be moved with WASD. How can I change this?

  30. 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

  31. Hello!!!! My tank is not moving, if you could take a look in my code iam going to appreciate!

    this is the Tank.gd :
    extends KinematicBody2D

    signal health_changed
    signal dead

    export (PackedScene) var Bullet
    export (int) var speed
    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

    func control(delta):

    func _physics_process(delta):
    if not alive:

    and now Player.gd :

    extends "res://Tanks/Tank.gd"

    func control(delta):
    var rot_dir = 0
    if Input.is_action_pressed('turn_right'):
    rot_dir += 1
    if Input.is_action_pressed('turn_left'):
    rot_dir -= 1
    rotation += rotation_speed * rot_dir * delta
    velocity = Vector2()
    if Input.is_action_pressed('forward'):
    velocity = Vector2(speed, 0).rotated(rotation)
    if Input.is_action_pressed('backward'):
    velocity = Vector2(-speed/2, 0).rotated(rotation)

  32. Watching this before I have Godot downloaded

  33. 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)".

  34. at 8:51, when I select the area of the image it also takes the color of the background with the selected img. Help.

  35. 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

  36. Why is only my turret moving and my tank isnt?

  37. 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😭

Leave a Reply

Your email address will not be published.