[Godot Tutorial] Basic Breakout! [P4] Getters and Setters

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ต.ค. 2024
  • Edward's Flappy Bird Tutorials: • Godot Engine Tutorial ...
    GDScript Crash Course: docs.godotengin...
    Check out my popular GameMaker Book and GameMaker Courses: www.heartbeast.co
    Follow me on Twitch for GameMaker livestreams: / uheartbeast
    Follow my twitter: / uheartbeast
    Like my Facebook page: / heartbeast.studios
    Follow me on Tumblr: / uheartbeast
    GameMaker Tutorials on Reddit: / gamemakertutorials
    Thank you all so much for your support!

ความคิดเห็น • 122

  • @pete275
    @pete275 8 ปีที่แล้ว +24

    thanks for the shout out :D This series is pretty good
    A tip similar to the previous one: you can export a value with the number of points you get for breaking a brick in the brick scene, then use that to award the points on the ball script (score += body.points or whatever), which lets the level designer set the points for individual bricks (like the center brick could award more points, etc), or even create a scene for each type of brick with different number of points and other properties, then instance those around the level

    • @dangputerz
      @dangputerz 4 ปีที่แล้ว +1

      well there is lots of things you could add. you could make and level 2 and 3 brick that goes down a level when hit until gone. bricks that are unbreakable. add levels and make score = score + 5 * level ... etc etc

    • @ChrischoBoardgaming
      @ChrischoBoardgaming 4 ปีที่แล้ว

      @@dangputerz Or make bricks that spawn extras the player could pick up. I wonder if there's any feature no breakout-type game has ever implemented.

    • @jadkylan7774
      @jadkylan7774 3 ปีที่แล้ว

      i guess Im randomly asking but does any of you know of a method to log back into an instagram account??
      I somehow forgot my login password. I appreciate any assistance you can offer me!

    • @jadkylan7774
      @jadkylan7774 3 ปีที่แล้ว

      @Maximilian Gage i really appreciate your reply. I found the site through google and im waiting for the hacking stuff atm.
      Looks like it's gonna take quite some time so I will reply here later when my account password hopefully is recovered.

  • @juanandressierraquintero6776
    @juanandressierraquintero6776 9 หลายเดือนก่อน +2

    If godot does not recognize the setget you can try this:
    var score = 0: set = set_score
    It worked for me, the code for ball script, in the root part, make sure the "w" of the world script is capitalized if you did capitalize it. I got stuck for 15 minutes and the capital letter was the problem hahahaha. Have an awesome day.

    • @pudincho
      @pudincho 7 หลายเดือนก่อน

      happens, thank you for clarifying that :)

  • @stoianstelian33
    @stoianstelian33 8 ปีที่แล้ว +4

    i hope you will continue this series because you are doing these videos really well and i can actually learn from them, you're awesome :D

  • @rubbaband999
    @rubbaband999 8 ปีที่แล้ว +2

    Thank you so much for making all of these tutorials, for both Godot and GameMaker. You have been incredibly helpful!!!

  • @makebritaingreatagain2613
    @makebritaingreatagain2613 5 ปีที่แล้ว +6

    5:43 OK this is epic.

  • @FunNooberCodingForBeginners
    @FunNooberCodingForBeginners 3 ปีที่แล้ว +3

    It's crazy how much Godot has changed! Also good tutorial!

  • @brunosiffredi
    @brunosiffredi 4 ปีที่แล้ว +1

    I hope to see more Godot tutorials from you in the future. You are a great teacher.

  • @martingoodson1651
    @martingoodson1651 8 ปีที่แล้ว +3

    Thank you very much for producing such a fascinating series of videos. I look forward to seeing the next one :)

  • @0T5C
    @0T5C 8 ปีที่แล้ว +5

    I'd really love for you to extend an RPG tutorial as well for this, honestly because I can't really afford GameMaker.

  • @ashastra123
    @ashastra123 8 ปีที่แล้ว +4

    I hope you continue to make these, as there are very few Godot tutorials out there.

    • @ChrischoBoardgaming
      @ChrischoBoardgaming 4 ปีที่แล้ว

      I shudder to think how Godot'ing must have felt four years ago. Today, fortunately, there's good coverage on YT and some other sources.

    • @ashastra123
      @ashastra123 4 ปีที่แล้ว +1

      @@ChrischoBoardgaming lol it was so frustrating I gave up and went backt o unity. Nice to see that the community has grown though.

    • @ChrischoBoardgaming
      @ChrischoBoardgaming 4 ปีที่แล้ว +1

      @@ashastra123 It definitely has. Funny, I made the opposite experience when I started out with Unity and quite quickly felt something like "this tool is too smart for me or I am too dumb for it", which made me take a look at Godot :)

  • @sslaxx
    @sslaxx 8 ปีที่แล้ว +13

    A small suggestion: if you're talking about things in the documentation, it might be nice to show the documentation pages in question, please.

    • @uheartbeast
      @uheartbeast  8 ปีที่แล้ว +7

      Good feedback. I did link the page in the description but I'll see if I can show it in the video in the future.

    • @blankxx0009
      @blankxx0009 8 ปีที่แล้ว

      Will you be doing Godot videos on a weekly basis? (ex. one game maker video and one godot video per week)

    • @user-vt2wg8hr8b
      @user-vt2wg8hr8b 8 ปีที่แล้ว

      Hi Heart, I have a suggestion.
      The sprites for the rpg games, could you link them on your channel page?
      Also if you could add some more things to the sheet that would be wonderful, mixing sprites from different artists makes the world look weird.

  • @nobooodyere5017
    @nobooodyere5017 8 ปีที่แล้ว +16

    Just started learning godot myself for 2d work, just feels so nice to use. Think you! will you make more tutorials on godot?

    • @uheartbeast
      @uheartbeast  8 ปีที่แล้ว +13

      Yes :)

    • @nobooodyere5017
      @nobooodyere5017 8 ปีที่แล้ว +1

      Looking forward to them 😊 i enjoy your gamemaker tutorials but i just cant seem to feel gamemaker, so glad your looking into godot.

    • @gozen0
      @gozen0 8 ปีที่แล้ว +1

      +HeartBeast hi did you find my problem with the dialog and i email you :)

    • @sestalacto
      @sestalacto 8 ปีที่แล้ว +2

      we are waiting for more tutorial ben :D

    • @TheIzar21
      @TheIzar21 7 ปีที่แล้ว +2

      Still waiting ;)

  • @pb25801705
    @pb25801705 8 ปีที่แล้ว +2

    Dude you are the man, thank you so much for this tut, godot seems great I hope you will make some more videos about godot in the future
    subbed

  • @drexenmalthusian1514
    @drexenmalthusian1514 8 ปีที่แล้ว +1

    I know this is a very simple game but there are a few things I hope you could touch base on to show the underlying concepts:
    a) If you move the paddle to the far right or left of the view port the paddle does not collide until the middle point of the paddle instead of the edge of the paddle. How do you prevent this?
    b) Could you show how to limit the ball "spawn" to one?
    c) Could you show how to randomize the initial direction of the ball when you hit the mouse button? It currently always goes to the top right during the "serve"
    d) Could you make all the bricks respawn based on reaching 50 score increments? (Just to show how to add a string of events at score 50, 100, 150, 200 etc. maybe something like "if score / 50 == 1 + timesbricksrespawned then spawn bricks?
    e) Could you show how to scale the game to full screen?

  • @francescocicala1513
    @francescocicala1513 7 ปีที่แล้ว

    Hello, i'm watching these tutorial just now, but I'd like to clarify the "delta" issue withing the velocity. I'm totally new to Godot, but the problem doesn't depend on it or on GDScript... it's just physics.
    English is not my first language but I'll try to be clear: when an object with a velocity receives an impulse, it changes its velocity, so that if you want to calculate the final one you need to do the sum: initial_velocity + velocity_variation_given_by_the_impulse. The last one, in our case, is SPEEDUP.
    Delta doesn't participate to the equation. To be more technical, if you want to see delta in this equation you should write: initial_velocity + acceleration_during_the_impulse*delta, but here we're assuming 1) That the impulse has a duration equal to "delta"; 2) The acceleration is constant during the input.
    The point of all of this is that the equation doesn't need the "delta" term because of kinematic arguments :)
    Thank you for the tutorials, you helped me a lot!

  • @darrinhert9296
    @darrinhert9296 8 ปีที่แล้ว +2

    Hello! I'm pretty new to both GameMaker and Godot (have been following your tutorials to get going) -- and they are FANTASTIC. I'm much more familiar with Unity and as such, have a quick pointer that may or may not be a "thing" in Godot...
    Grabbing a reference to your root node inside the process loop is maybe better served in the startup code (even though you're only grabbing it if there's a collision with the "Bricks" group. It appears this is possible in Godot by using syntax something like the following (in the member variables section):
    onready var game_mgr = get_node("/root/World")
    Then, using this reference in your collision detection in the looping process section:
    game_mgr.score += 5
    Again, I don't know how expensive this is in Godot, but in Unity, you wouldn't want to grab a reference in your loop unless you absolutely had to (i.e. dynamically instanced objects). In your breaker tutorial, this wouldn't be a big deal, but in an instance where there are lots and lots of these reference searches going on, it could get problematic on performance.
    KEEP UP THE GREAT WORK!!! Hopefully people will support you by grabbing your Udemy courses as well!

    • @jefflhama
      @jefflhama 8 ปีที่แล้ว

      Wow, it worked here.
      var game_mgr = null
      func _ready():
      >game_mgr = get_node("/root/World")
      func _on_button_pressed():
      >game_mgr.score += 1
      func _on_button_2_pressed():
      >game_mgr.score -= 1
      ....
      Greater solution, and for a big project with many different objects for interact with the same variable, like life or points it's better.

  • @farhanabsar7905
    @farhanabsar7905 7 ปีที่แล้ว

    I think delta is useful for input events. Since the input lasts longer than one frame, several input processes are called one after another. So you need to tone the motion down with delta.

  • @momfus
    @momfus 8 ปีที่แล้ว +1

    Very usefull tutorials, i would like to see how to make a complete menu in godot, tree skill system, etc. Please make more tutorial about GODOT!

  • @lincolnpepper816
    @lincolnpepper816 6 ปีที่แล้ว +1

    I think a better way to do it is emit a signal whenever you hit a brick to the world node, and when the world node recieves the signal it updates the score label. Or if you can put a script in the score label and do it right there, but i'm not sure if you can.

  • @AlexanderWernerJr
    @AlexanderWernerJr ปีที่แล้ว

    Thanks very much for this great tutorial Benjamin, it's a fantastic introduction to the Godot engine. 👍👍👍

  • @rodrigovazquez420
    @rodrigovazquez420 7 ปีที่แล้ว

    we need moar MOAR godot's tutorials!!!

  • @syskrank304
    @syskrank304 8 ปีที่แล้ว +1

    Hi there and thank you for the tutorials. Are you planning to make more? If so, that would be great.

  • @tuckertcs
    @tuckertcs 8 ปีที่แล้ว +2

    will you be making lots of godot tutorials later on? any 3D?

  • @jpcrtube
    @jpcrtube 6 ปีที่แล้ว +3

    hi, this is a great suite of tutorials but is it finished? you do not show how to end the level if there is no tiles left, and how to go to another level then. thank you !!
    here's an attempt to destroy the ball if there is no bricks left (in godot 3 ), this is in the ball gd script :
    func _physics_process(delta):
    var bodies = get_colliding_bodies()
    for body in bodies:
    if body.is_in_group("Bricks"):
    get_node("/root/World").score += 5
    # code to remove the ball if the group "Bricks" is empty
    var nbInGroup = get_tree().get_nodes_in_group("Bricks").size()
    if nbInGroup

  • @supermegakat9881
    @supermegakat9881 8 ปีที่แล้ว +1

    Hello, Heartbeast what do you think about this idea, for your next RPG in gamemaker tutorial what if you did something on custom healthbars?

  • @負能量-x9u
    @負能量-x9u 8 ปีที่แล้ว

    very like your videos. teaching is so good.
    Even my english isn't good enough ,but i can understand what you are saying.

  • @amazingsparckman
    @amazingsparckman 7 ปีที่แล้ว

    woa I'm might make a tutorial on this engine lol seems more complex than le gamemaker.
    So what language does this use? is it the same as gamemaker? maybe i should watch first video first hahaha.

    • @thomashalsted1888
      @thomashalsted1888 7 ปีที่แล้ว

      Godot uses something quite similar to Python. Go read the Godot Docs...
      docs.godotengine.org/en/stable/reference/gdscript.html#doc-gdscript

    • @amazingsparckman
      @amazingsparckman 7 ปีที่แล้ว

      thanks i'll check it out

  • @PabloSanchez-th5em
    @PabloSanchez-th5em 8 ปีที่แล้ว

    Excellent!! excellent MR Anderson!!!

  • @torandebruijn2234
    @torandebruijn2234 8 ปีที่แล้ว

    Should really have more subs than this. Tutorials of very high quality, only $555,555 each!

  • @TheMrMiku
    @TheMrMiku 8 ปีที่แล้ว

    What is your view on unity, are you planning on making any videos or tutorials for unity or not? Would be really cool to see ;)

  • @pedro15522
    @pedro15522 8 ปีที่แล้ว +4

    Muito bom!!
    Continue fazendo tutoriais de Godot ^^

  • @stephendalton1331
    @stephendalton1331 8 ปีที่แล้ว

    Mr. HeartBeast Is there going to be another RPG tutorial?
    Also is it possible that you could do a tutorial on turn-based combat and random encounters because I cant find one anywhere?

  • @Gamesforus1
    @Gamesforus1 8 ปีที่แล้ว

    Hello Benjamin, I was wondering if you could do turn based combat like from pokemon, paper mario, and final fantasy.

  • @chris_gamedev
    @chris_gamedev 8 ปีที่แล้ว

    Amazing as always!

  • @SoySasha
    @SoySasha 5 ปีที่แล้ว

    hey! I am sorry this question might be really related more to Linear Algebra. But what does the ".lenght()" function does mathematically? I mean:
    When create the speed variable and set it to = get_linear_velocity() inside the if statement it outputs a vector (-199.749634, -200.250122) when the ball collides with the paddle. The .length() output at this moment is 282.842773.
    How does this function transform coordinates of the point where the ball collides with the paddle to a speed value?

    • @joshhallam2253
      @joshhallam2253 3 ปีที่แล้ว

      So the length of a vector has different names. The length is one, the norm is another, and the 2norm is another since it's a 2D vector, and the magnititude is another. The length of a vector is from Pythagorean's Theorem a^2 + b^2 = c^2, where a and b are the small sides of a right triangle and c is the long side, the hypotenuse. If you take the square root of both sides, you can see that sqrt(a^2 + b^2) = c. The hypotenuse here is the length of the vector so it is taking the square root of the x component of the vector, squared plus the square of the y component of the velocity. Velocity is a vector with x and y components, and speed is just a number, the size of the velocity vector. You'll notice that with this formula, speed is always positive, where the velocity can be negative. The squaring of each velocity component will make them both positive, Then you are adding two positive numbers and taking the square root of a positive number.

  • @calogiga
    @calogiga 6 ปีที่แล้ว

    Thanks for this tutorial. I learned a lot !

  • @nickmeadows9486
    @nickmeadows9486 8 ปีที่แล้ว

    thanks for all the videos man but, a while a go in your platformer ai tutorial you said you might upload a more elaborate version. if you could that would be great, cause im struggling to have my chase ai jump over blocks.

  • @diablotintamar
    @diablotintamar 8 ปีที่แล้ว

    you already helped me a lot to discover Godot (and game developing)
    so Thanks a lot !!! please keep doing this kind of tuto ( on Godot ;) ) it's realy helpfull (there is not so many tuto for this platform :/) ..... *sorry for my bad english ;p

  • @umbergames8376
    @umbergames8376 8 ปีที่แล้ว

    Great tutorial! However, if I rotate my mouse wheel or spam click, tons of balls come out. Can you make a short video showing how to limit the amount of balls the player can make? And perhaps how to connect levels, and how to make a game over screen?

  • @SergioFrias
    @SergioFrias 8 ปีที่แล้ว

    HeartBeast ,can you make a simple platformer in Godot?

  • @F4BON3
    @F4BON3 4 ปีที่แล้ว

    Thank you so much, this chapter helped me understand setget a little better. Still not super clear tho, if set_score function runs when we change the value of the variable, when would get_score run????

  • @floridosmarpepa8904
    @floridosmarpepa8904 8 ปีที่แล้ว

    Waiting for other videos :)

  • @AndrewBotish
    @AndrewBotish 8 ปีที่แล้ว

    Hey Benjamin could you make a tutorial showing us in game maker how to make a player (in a platformer) step up 1 block smoothly just like Terraria does. Mine currently does it but it's instant and I don't have much control over it.

  • @σαμ1
    @σαμ1 5 ปีที่แล้ว

    I watched this tutorial and as a part of my learning I did something like dxball were items give you abilities lost some time in Layers and masks but now I am ok.
    I wanted to ask, is it better to move the code which checks about the collisions with bricks for example to the signal function body_entered or keep it your way, I mean what is the main difference, thanks

  • @Abrexas90
    @Abrexas90 8 ปีที่แล้ว +4

    Would you prefer godot over GameMaker?
    If so, why or why not?
    Many thanks ^_^

    • @lincolngolladay
      @lincolngolladay 8 ปีที่แล้ว +1

      Very good question!

    • @Abrexas90
      @Abrexas90 8 ปีที่แล้ว

      Link G.
      Hoping for some very good answers =P
      Game Maker is amazing, imo. So far I've only seen the look of Godot, but I already like the interface a bit more than GM. But aesthetics only go so far... haha

    • @symix.
      @symix. 8 ปีที่แล้ว +1

      +Steven French look to real code skid nub

    • @sslaxx
      @sslaxx 8 ปีที่แล้ว +1

      It also depends on whether you like the language or not, the asset chain etc. Dunno much about assets management, but the language is a derivative of Python, which so far I find isn't so bad.

    • @Abrexas90
      @Abrexas90 8 ปีที่แล้ว

      MrDerpy
      Skid nub?
      I've coded in "real languages" plenty. I've made games in "real languages" too.
      I use GML because I enjoy the simplicity in working with 2D games.
      So... yeah, don't much care what you think, champ ^_^

  • @matteusmaximofelisberto4385
    @matteusmaximofelisberto4385 7 ปีที่แล้ว

    Do more about Godot PLEASE!!!!!!

  • @alberts6096
    @alberts6096 7 ปีที่แล้ว

    More Godot Videos!

  • @bluepower48
    @bluepower48 8 ปีที่แล้ว

    HeartBeast , I just downloaded GameMaker and it dosen't open and when it does is telling me then i have to register after I registered and it opens but it doesn't work and it's like a black window with on his top write Game Maker....Can you give me a tip please.

    • @henrique.campos
      @henrique.campos 8 ปีที่แล้ว

      Game Maker is paid, dude :/

    • @henrique.campos
      @henrique.campos 8 ปีที่แล้ว

      Aidan Schulmeister
      freemium* since it has all kinds of limitations

  • @netroik455
    @netroik455 8 ปีที่แล้ว +1

    Hey please more tutorials of Godot Engine

  • @memzen8101
    @memzen8101 7 ปีที่แล้ว

    GDScript Crash Course is here: docs.godotengine.org/en/latest/learning/scripting/gdscript/index.html

  • @Aydanxd
    @Aydanxd 5 ปีที่แล้ว

    also does anyone have a fix for when i play my game i fullscreen it and the blocks move to the left and the paddle wont go all the way to the right but it goes off of the screen to the left

  • @urusuru3710
    @urusuru3710 5 ปีที่แล้ว

    Thank you man!

  • @amaan5500
    @amaan5500 7 ปีที่แล้ว

    is godot a good engine i started using gamemaker studio 2 but i coudnt do much beacuse of the limitations can u make more tutorials like gamemaker and stuff

  • @afsincapan45
    @afsincapan45 8 ปีที่แล้ว

    yay another tutorial !

  • @3d_nahla289
    @3d_nahla289 4 ปีที่แล้ว

    please add tutorial about export game from GODOT to Xcode ??

  • @Aydanxd
    @Aydanxd 5 ปีที่แล้ว

    does someone know how to fix the issue where my ball wont bounce off of the paddle

  • @soma3582
    @soma3582 8 ปีที่แล้ว

    Hey HeartBeast can you me say good "Website"for Rescourses for "game skins"

  • @onusai
    @onusai 7 ปีที่แล้ว +1

    note to self 8:07

  • @greggygeorge8198
    @greggygeorge8198 4 ปีที่แล้ว

    How to make it so that you can only instance a ball when your ball have fall to the bottom?

    • @ChrischoBoardgaming
      @ChrischoBoardgaming 4 ปีที่แล้ว +1

      Well, use a variable that holds the amount of balls currently in the game. If the player tries to spawn a new one and the max allowed amount is already in the game, he doesn't get a new ball. Of course, you need to decrease that variables value by one if the ball ever drops out of the game area.

  • @theamzmusthaves
    @theamzmusthaves 7 ปีที่แล้ว

    hi im new to your channel i have tried it but my ball slows down every time it hits the paddle instead of speed up.

    • @harrison5161
      @harrison5161 7 ปีที่แล้ว

      You may have missed one of the delta's when you remove it. There are 2 so just scroll across and check

    • @jamesfilms_
      @jamesfilms_ 7 ปีที่แล้ว

      Yeah what he said ^

  • @danielaguirre5078
    @danielaguirre5078 7 ปีที่แล้ว

    so, you never gonna make another Godot tutorial? :/

  • @Jalecko
    @Jalecko 8 ปีที่แล้ว

    Do a tutorial on platformer knockback

  • @theM4R4T
    @theM4R4T 7 ปีที่แล้ว

    Will more Godot tutorials come?

  • @cadfoot568
    @cadfoot568 8 ปีที่แล้ว

    Unity on Quick Launch? I see you ;)

  • @vishalk1091
    @vishalk1091 7 ปีที่แล้ว

    how to export and finlize the game??

  • @carolkiryuu
    @carolkiryuu 6 ปีที่แล้ว

    The score code isn't working. I'm using Godot 2

  • @d-man4485
    @d-man4485 4 ปีที่แล้ว

    Help! my game freezes when the ball hits the brick (I finished the whole series) here is my code
    Ball.gd:
    extends RigidBody2D
    const SPEEDUP = 400
    const MAXSPEED = 30000
    func _ready():
    set_physics_process(true)

    func _physics_process(delta):
    var bodies = get_colliding_bodies()

    for body in bodies:
    if body.is_in_group("Bricks"):
    get_node("/root/World").score += 5
    body.queue_free()

    if body.get_name() == "Paddle":
    var speed = get_linear_velocity().length()
    var direction = get_position() - body.get_node("Anchor").get_global_position()
    var velocity = direction.normalized()*min(speed+SPEEDUP*delta, MAXSPEED*delta)
    set_linear_velocity(velocity)
    if get_position().y > get_viewport_rect().end.y:
    print(":(")
    queue_free()
    Score.gd:
    extends Label
    var score = 0 setget set_score
    func set_score(value):
    score = value
    get_node("Score").set_text("Score: "+str(score))
    If anyone can help please reply

    • @benjaminbrown1099
      @benjaminbrown1099 4 ปีที่แล้ว

      I'm new to Godot and I ran through the same issue. Based on what I found, Godot 3.2 wants you to be VERY SPECIFIC on where you access your get_node() functions. So you have to change your pathway on the World.gd script to:
      get_node("/root/World/Score").set_text("Score: "+str(score))
      and for the ball.gd script in the for loop to:
      get_node("/root/World/Score").score += 5
      I hope this helps. Let me know if you still have more issues :)

    • @d-man4485
      @d-man4485 4 ปีที่แล้ว

      Benjamin Brown Thanks I’ll go try that!

  • @MultiDarksamuses
    @MultiDarksamuses 7 ปีที่แล้ว

    Is this series dead or am I missing something?

  • @vishalk1091
    @vishalk1091 7 ปีที่แล้ว

    part 5 plzz

  • @mefistolhl
    @mefistolhl 8 ปีที่แล้ว

    Godot Engine is open source, all is for free ;)

  • @vizionthing
    @vizionthing 5 ปีที่แล้ว

    Now you have a working breakout clone - go watch th-cam.com/video/Fy0aCDmgnxg/w-d-xo.html its only 15 mins but should give you an injection of inspiration needed at this point in your journey.

  • @MrCrazeyBanana
    @MrCrazeyBanana 8 ปีที่แล้ว

    lol!

  • @JOETV12345
    @JOETV12345 8 ปีที่แล้ว +3

    WHERES GRAINWAR!

  • @NFSNOOB
    @NFSNOOB 5 ปีที่แล้ว

    wow skype..

  • @nickeq3819
    @nickeq3819 8 ปีที่แล้ว +1

    first