My Java Script learning journey

Thanks for all your help @WoofWoof and @AlexK! I don’t think I understand everything but after a bit of practice I will be able to do it. Also I will be coding another plat former but with only java tomorrow! I will look at my former code and manually type it in. Hopefully this will help with memorization.

Question: Should I look at Java script tutorials like videos, or code academy, and if so any recommendations?

1 Like

Videos and tutorials outside of MakeCode might be useful, but you’d have to figure out how to apply those skills back into the environment. Some things, like variables and loops, are universal. Some things, though, will be specific to the programming environment. For example, unless you’re learning specifically about MakeCode Arcade, you won’t learn any of the JavaScript syntax for sprites.

I’m building out a skillmap for MakeCode Arcade’s Flying Duck, and it will include JavaScript and Python tracks. Should have that ready on Monday for y’all to try.

For those of you who want a sneak peek, this is the game that we will build:

2 Likes

CABYABARA! It’s soooooooo cute! :smiling_face_with_three_hearts:

2 Likes

GASP A MakeCode JAVA SCRIPT SKILL MAP? I can’t wait to complete it! this will be so helpful!!!

2 Likes

A sneak peek at the skillmaps. The first level for all three languages are ready.

I’m thinking the skillmaps will have four levels. Have fun!

4 Likes

Yes!! I am starting now! Thank you @AlexK

But I came across an issue:

it doesn’t tell you how to add physics to a sprite, it just tells you to add it. I almost always had to switch my code to blocks previously if I wanted to add physics to my sprite. How can I do this?

Also funny story: I saw this being used in the code { } and yelled; ¨ Juicy Brackets!!! ¨ aloud, and now I can’t stop calling them that.

2 Likes

Use the hint (light bulb) at the bottom of the tutorial page to see the code.

Note: I’ve also added a new help box on that step that reminds you to use the editor’s auto-complete feature to your advantage.

3 Likes

Thanks @AlexK, almost finished it now! I think I might try and complete it multiple times too, so I can commit it to memory.

2 Likes

Write it in code, please. Not sure exactly what you’re describing.

1 Like

Uh. never mind. I think I was typing nonsense. I don’t think I could have done much with the info anyways. How do you write in code, by the way?

2 Likes

Responding to your deleted post, @Ima.notarobot, in text, the editor rarely cares about new lines. There are many things you can do in one line that would take a much longer (vertically) amount of blocks. While the editor often automatically handles this for you, you’ll often see code examples with the semicolon “;” character after each line. This is because many programmers are simply used to doing that after every line because certain languages don’t automatically separate code using new lines and you need to tell it where each line ends with a semicolon. In JavaScript, you don’t even need to place a new line if you use a semicolon! You could write everything on one line if you really wanted to, though I do believe everyone reading your code would have a heart attack!

You could also be talking about the “? :” thing…

The other thing you could be talking about is the kinda “? :” thing. This is one of my favorite things in written code! It works like this:
var = num == 5 ? 2 : 6
In this example, the “var” variable will end up being the result of this mini if statement. The “num == 5” part is the condition. Then comes the question mark, and the thing after the question mark is the result if the condition is true, and the thing after the colon is the result if the condition is false! So, in this example, if the variable num == 5, then “var” will be 2, and otherwise it will be 6. I absolutely love this feature, because it removes a lot of unnecessary “if then…” lines. Something to note is that I usually would write it as var = (num == 5) ? 2 : 5 because it makes it easier for me personally to read. Parentheses are really nice for visually separating out logic sections, even if technically they wouldn’t be needed.

3 Likes

To be more precise, I needed you to provide an example written in code – i.e., written in JavaScript. I didn’t know what you were trying to describe, and since you probably were thinking of a particular piece of code … just post the code rather than try to describe it.

And, agreed, Woof Woof, the ternary operator is one of my favorites!

2 Likes

Ha! I forgot what they were called, thanks! And yeah, @Ima.notarobot if you ever need help understanding a section of code, I’ll gladly scribble like crazy all over a screenshot you send or explain/comment out a piece of code. Me and AlexK really love to see people getting into written programming!

Oh, and to “write in code” I think you mean the code insert effect. That is done with one of these little back ticks ` and then another at the other end of the line. Or you can use 3 in a row like ``` to make a whole block of code like that until you write them again.

3 Likes

Thanks! I am also attempting to code a plat former only in java, might take a bit I think I can do it. I will update you if I need some help.

2 Likes

OK, I have something to admit. I haven’t really been practicing java script recently. The issue: To much fun with makecode. :sweat_smile: I have been coding some really cool projects in blocks, and I am full of inspiration/spark… But just a small apology because, I did say that I would try and post daily.

2 Likes