I think this is the first time I have stopped the video at the beginning after knowing the name of the canvas topic and trying it by myself, and believe me, I was approx 90% done with this, and I am very happy for this. All credit goes to you, sir.
Sorry to hear :-( ... I've had like that in the past, and focusing on work (coding / research) was probably the good thing to do (keeps your mind off things) Hope things get better in the new year!
I created this drawTriangle function: function drawTriangle(ctx, block, x) { ctx.beginPath(); ctx.moveTo(block.left, block.bottom); ctx.lineTo(block.right, block.bottom); ctx.lineTo(x, block.top); ctx.fill(); }
Good! It can make the code shorter :-) But look at the function and think about someone seeing it for the first time and noticing the name 'drawTriangle' and those parameters, especially 'block' and 'x'. They will wonder "where is the triangle", "what is this block", and then spend a lot of time figuring stuff out. How could the function be made clearer?
Hello my dear teacher, you said that i coded 20 hours non stop how you do that? today i coded 3 hours non stop and I became really tired I was coding a basic snake game :)
I don't recommend coding for too long, uninterrupted... but to answer your question, coding relatively easy things (things that are familiar to you) will become easier and easier the more you code. At some point it becomes 'doing something fun'.
I am wondering you didn't use a for loop.
Oh, great idea! Then we could have a parameter to control how many blocks the tree has :-)
I think this is the first time I have stopped the video at the beginning after knowing the name of the canvas topic and trying it by myself, and believe me, I was approx 90% done with this, and I am very happy for this. All credit goes to you, sir.
Good for you :-)
Wonderful tree! I'm not having a great end to the year, but your videos always help keep my mind calm and my brain working. Thank you so much!
Sorry to hear :-(
... I've had like that in the past, and focusing on work (coding / research) was probably the good thing to do (keeps your mind off things)
Hope things get better in the new year!
I created this drawTriangle function:
function drawTriangle(ctx, block, x) {
ctx.beginPath();
ctx.moveTo(block.left, block.bottom);
ctx.lineTo(block.right, block.bottom);
ctx.lineTo(x, block.top);
ctx.fill();
}
Good! It can make the code shorter :-)
But look at the function and think about someone seeing it for the first time and noticing the name 'drawTriangle' and those parameters, especially 'block' and 'x'. They will wonder "where is the triangle", "what is this block", and then spend a lot of time figuring stuff out. How could the function be made clearer?
Oh noo, i'm late to the party! Plain and simple! But Radu why no function? 😁
:-)) I need to give you something to do, don't I? 🌲
@@Radu 😂
Hello my dear teacher, you said that i coded 20 hours non stop how you do that? today i coded 3 hours non stop and I became really tired I was coding a basic snake game :)
I don't recommend coding for too long, uninterrupted... but to answer your question, coding relatively easy things (things that are familiar to you) will become easier and easier the more you code. At some point it becomes 'doing something fun'.