Destructible Tiles in Godot

Поделиться
HTML-код
  • Опубликовано: 15 сен 2024
  • In this tutorial I cover how to implement destructible tiles in your Godot 3.2 game by using collisions with projectiles and different tiles within your TileSet.
    Itch: legiongames.it...
    Twitter: / legiongames1
    Instagram: / legiongames1
    Newgrounds: legiongames.ne...

Комментарии • 21

  • @AmosDsouza
    @AmosDsouza 4 года назад +11

    Just what I needed, I'll be working on making a Mining Game soon so I needed to know more about tileMap. This will help a lot.
    I had a GDscript syntax question, Why do use use the colon symbol like
    >> var collision: KinematicCollision2D

    • @legiongames2400
      @legiongames2400  4 года назад +1

      Hey Amos! The colon defines what type the variable will be, so if you assign anything else to the variable it will give you a warning. Right now it's the only thing it does but in the future static types will improve performance. Godot 4 probably? Here's a doc link that explains it better: docs.godotengine.org/en/stable/getting_started/scripting/gdscript/static_typing.html

    • @AmosDsouza
      @AmosDsouza 4 года назад

      ​@@legiongames2400 Ohh I see now... So is it better to start defining the variable with their types from now on I guess. Thanks for the info.

  • @ludwigvanbeethoven6639
    @ludwigvanbeethoven6639 7 месяцев назад

    Thank you! Your explanation of normals helped a lot

  • @RG-yt6wn
    @RG-yt6wn 7 месяцев назад

    Awesome video! Thank you for sharing! This helped out a lot!

  • @darrinadams8639
    @darrinadams8639 2 года назад +1

    Well done. Nice Art too. I'm curious if there would be an advantage to just have send a signal, then have the tile map adjust itself. This way you could have different tiles change the way they change disconnected from the bullet. I wasn't sure if there is a speed hit with that though.

  • @guillaumeleformal5660
    @guillaumeleformal5660 4 года назад +1

    Cool vidéo thanks

  • @mrsentixy8196
    @mrsentixy8196 3 года назад +2

    Can you make a tutorial on how to make a placeable block?

  • @arrain4737
    @arrain4737 4 года назад +6

    Wow, more and more people use Godot. Is there a benefit over unity? Today i've watched about 3 gd tutorials although i've never used it :D

    • @guillaumeleformal5660
      @guillaumeleformal5660 4 года назад +6

      I've been using godot for a few months now and I can tell you that I learned a lot very quickly because godot is really easy to use.
      The interphase is simple, the gdscript is simple too.
      As it is quite young it is normal that there is less tutorials on yt.
      But the community is growing and it's nice.

    • @legiongames2400
      @legiongames2400  4 года назад +5

      LMAO, yes, join us! Muahahahahah. Like Guillaume said, Godot is a lot more intuitive than Unity, so the choice for me was mainly based on the fact that I loved how easy everything was to learn and implement. Also, it is arguably a better 2D engine than Unity because all of its 2D functionality is standalone and not built on top of 3D like it is in Unity. Since I knew I mainly wanted to do 2D in the beginning the choice was a little obvious. Right now Godot 3D is still worse than Unity but, again, still more intuitive and has been progressively getting more features over the years with the big one that's coming with the Godot 4.0 release in a bit which is going to drop Open GL as its main renderer in favour of Vulkan.

    • @ahmedlimam2241
      @ahmedlimam2241 4 года назад +3

      I never tho I'd be able to create games without going through learning C# and unity's overwhelming interface and since I am experienced in python, learning godot engine & features was all I had to do since GDscript is based of python, and as we all know coding in python/gdscript is really easy n the workflow is fun

  • @IsaacPeek
    @IsaacPeek 3 года назад +1

    So I'm trying to use this and via the output I see the colliding tile is being set to -1 however it's not being removed from the tileset nor can I get it to swap tiles...Any ideas?

    • @IsaacPeek
      @IsaacPeek 3 года назад +1

      world_to_map was not working for me using raycast in this manner. Did fix it though, had to rework how world_to_map was getting it's argument.

  • @ratazanablumenau5330
    @ratazanablumenau5330 2 года назад

    thanks :D

  • @talhkyosan
    @talhkyosan 3 года назад +1

    Hey dude your videos are awesome but i have a question. How can i make this with area2d?

    • @legiongames2400
      @legiongames2400  3 года назад +2

      I would probably just have a Node2D inside the area with its position slightly ahead so it would be inside the specific tile you collided with and you could just call world_to_map(node2d.position) to get the tile when the body entered signal gets triggered.

    • @talhkyosan
      @talhkyosan 3 года назад +1

      ​@@legiongames2400 whoa :O that was so smart. thanks a lot dude. i just subscribed to you.

  • @3333927
    @3333927 3 года назад

    How to add an initial speed after creating a new instance of the bullet?
    This code doesn't work for that:
    func SkillLoop():
    if Input.is_action_pressed("ui_shoot") and can_fire == true:
    can_fire = false
    var bullet_instance = bullet.instance()
    get_node("Cannon").rotation = get_angle_to(get_global_mouse_position()) + 1.57
    bullet_instance.position = get_node("Cannon/Rotate").get_global_position()
    bullet_instance.rotation = get_angle_to(get_global_mouse_position())
    if bullet_instance.rotation > -2.9 and bullet_instance.rotation < -0.2:
    get_parent().add_child(bullet_instance)
    yield(get_tree().create_timer(rate_of_fire), "timeout")
    can_fire = true

    • @3333927
      @3333927 3 года назад

      Well, got it on my own.
      I just had to add these lines after "bullet_instance.position = ..." :
      var dir = bullet_instance.position.direction_to(get_global_mouse_position())
      bullet_instance.velocity = Vector2(dir.x, dir.y)

  • @j2odev
    @j2odev Год назад +3

    Can you talk more quietly, I can almost hear you.