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

Godot 3.0: Top-down Tank Battle – Part 1

KidsCanCode
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:

50 Comments

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

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

  3. how can i put the turret speed of the tank slower

  4. A guy that goes by the name of "Papai Game Maker" or "Papai Maker" here on Youtube 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 …

  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 ?

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

  7. I got :"Script inherits from native type 'KinematicBody2D', so it can't be instanced in object of type: 'KinematicBody'"
    What do I miss ?
    Thanks

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

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

  10. The tank gun moves with the mouse but I cannot move the tank itself with wasd?

  11. Hey folk, if someone can help me, I would appreciate a lot, here are my doubts:

    – my player doens't stop moving when I release the key,
    – ("forward") and ("back") doesn't work too.

    Here are my codes:

    KINEMATICBODY.gd (just like the Tank.gd)———————————————————————————–
    extends KinematicBody2D

    signal health_changed
    signal death

    var motion = Vector2()
    var can_attack = true
    var can_defend = true
    var alive = true

    export(float) var attack_cooldown
    export(float) var defend_cooldown
    export(int) var health
    export(int) var speed

    func _ready():
    $Attack_Timer.wait_time = attack_cooldown
    $Defend_Timer.wait_time = defend_cooldown

    func control(delta):
    pass

    func _physics_process(delta):
    if not alive:
    return
    control(delta)
    move_and_slide(motion)

    PLAYER.gd———————————————————————————-

    extends "res://Player/KinematicBody.gd"

    func control(delta):
    $".".look_at(get_global_mouse_position())
    if Input.is_action_pressed("ui_up"):
    motion.y = -speed
    if Input.is_action_pressed("ui_down"):
    motion.y = speed
    if Input.is_action_pressed("ui_right"):
    motion.x = speed
    if Input.is_action_pressed("ui_left"):
    motion.x = -speed

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

  13. Hello, I am curious why you didn't create a "Main" scene at the beginning?

  14. So when the tank is moving backward, the left and right are reversed, how do I fix that?

  15. this is one of the best tutorials that i've found, thank you so much 💜

  16. My tank can turn to the left, but not the right, and doesn't move foreward or back, and the turret is looking 90 degrees offset from the mouse I think, lol

  17. My gun doesnt follow the cursor, i tryed to rotate the guns sprite but it desnt help… how to fix it?

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

  19. I'm a few years late to the party but I'm following along now. Thank you for the tutorial

  20. THX SOOOOO MUCH!! I have been trying to find a good Tutorial but none and you gave me the BEST!

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

  22. what programming language does he use for the scripting?

  23. It tells me I have 5 errors like the signal health changed is declaredbbutcnever emitted help me

  24. I'm here after the first game tutorial, and your videos are making me love godot! Thanks

  25. My tureet is facing 90 degresa from the mouse pointer

  26. Why is the variable "rot_dir" used? Can't you just do "rotation_degrees += rotation_speed?"

  27. I cant make it , it shows errors all the time

  28. So bore you wasted my 2hrs time!!!!!

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

  30. Could you make a tutorial that shows how to apply acceleration and deceleration to a tank ?

  31. Hey there, everytime I try to test my player the game won't open. The output states this:

    — Debugging process started —

    — Debugging process stopped —

  32. The turret is not looking at my mouse position and i dont know how to correct it please help (GOT IT)

  33. Explaining what you're doing is not the same as teaching. This is not a tutorial.

Leave a Reply

Your email address will not be published.