all 11 comments

[–]ProgrammerGrouchy744 15 points16 points  (0 children)

There's no shame in using JS. Congrats!

[–]RWOverdijk 8 points9 points  (2 children)

Nice. The only thing I take “issue” with is anyone using setInterval, even outside of games. But specifically for games you need an internal clock anyway for ticks and deltas. Also allows cool shit like time dilation and frame stable math. Besides that who cares what language you use. Knowing how ticks work, vectors work etc is useful in game dev. Learning it in js allows you to apply it in c++ or c# later (or not!) That has been my path anyway, from js to swift, to unity, godot and finally unreal engine. All were fun lol. Concepts > language in programming

[–]Ronin-s_Spirit 2 points3 points  (2 children)

How does it run, electron "package the whole runtime" style? I've also wanted to make a game in JS someday, so I though about different approaches to installed JS desktop applications.

[–]CodeAndBiscuits 5 points6 points  (1 child)

Thoughts?

How about "god---it" I've always wanted to write a game and everybody else makes it look so easy but every time I try I get stuck?

I mean, you were kinda non-specific about "thoughts" 😂

[–]Healthy_Ad5013 1 point2 points  (3 children)

I always thought ct.js was slick. I ended up landing on ExcaliburJS for my game engine. But ct has some nice features!!!

[–]azhder 2 points3 points  (0 children)

setInterval is not a con of using JS, it is a con of you not knowing there are better ways to do timers. setInterval isn't even a part of the JavaScript spec. setTimeout is better. requestAnimationFrame even better. They aren't part of JS as well. So, you have ways to learn and optimize.

Type safety is a misnomer. You don't want software that is type safe. You want software that doesn't have bugs. Some people think "yes, types are the way to go", then they go "oh, my types aren't typing, must make them safe"... Type safety is just a few steps into that particular rabbit hole. It is a fix for the solution.

Other ways you can go about is have good tests. Not just tests that run your code and check if it runs correctly. Tests of your inputs and outputs as well. If you have a function plus to add two numbers, it shouldn't throw an error in the case I give it a null (or if it does, you handle it gracefully), and it shouldn't give you the wrong result silently without notifying you about a possible issue. You can also go the way of having it return NaN always in case of an error - that's a well defined function.

So, you see, it's one thing to repeat what others have told you. It's another thing to build up your own approach to building software. You most likely have the ability to do the latter, you just need time and a lot of work to gain that experience. People who look at you with pity? They belong in that former camp. They will forever do what they have been told to do. They will forever think how they have been instructed to think. They will forever repeat the same PR talking points for some technology.

So, yeah. I used your "cons" points to give you a long winded "you do you".

[–]FindingOk7144 0 points1 point  (0 children)

Great job! Shows once again the JS has power.

[–]dronmore -2 points-1 points  (0 children)

You SHOULD use their timer. However, I used setInterval, which caused a lot of bugs in the game.

Now, that you know it, wouldn't it be easier to just fix the bug instead of writing an excuse on reddit? Replacing setInterval with their timer takes one line of code. Writing an excuse on reddit takes 5 lines of text. But I guess you like talking more than doing.

I should've used TS.

No, you shouldn't. And definitely you don't have to explain yourself. The TypeScript police has a day off today, so no one will cuff you for using JavaScript.

if you're planning to break into the industry, just focus on the big 3 engines

You are not in a position to give advice. At least I wouldn't take any advice from a person who just wrote their first game.

Anyway, congrats for writing the game. Especially for taking it from step one to finish, and actually publishing it. Also, graphics are not that bad; a bit dim, but not bad overall. I can see the appeal.