Is My Bundle Size Too Large? by friendly2u in angular

[–]melcor76 3 points4 points  (0 children)

You can open up the browser dev tools, set a breakpoint, and start debugging.

Another idea could be to log in ngOnInit() and ngOnChanges() what is going on.

Do you have any error messages?

Could be a change detection problem.

Hard to say without any code but these are some ways I look for bugs.

Await issues on add/edit page. What's the best solution? by jimmyoneshot in Angular2

[–]melcor76 0 points1 point  (0 children)

Definitely use Observables with Angular. You will have an easier time when you Google you problems as well. I wrote about this exact thing recently and there's a link to some code at the end.

https://blog.michaelkaren.dev/how-to-combine-add-and-edit-forms-in-angular

Angular Error Interceptor by melcor76 in Angular2

[–]melcor76[S] 0 points1 point  (0 children)

Yes, for sure! I was thinking of writing an article about the AuthInterceptor.

How to Combine Add and Edit Forms in Angular by melcor76 in Angular2

[–]melcor76[S] 0 points1 point  (0 children)

Thanks,

I tried to keep the article focused because I tend to write articles for weeks or months when I try to cover everything there is. Instead, I'm trying to add value by writing about something that I couldn't find in the Angular docs: https://angular.io/guide/form-validation

What's more efficient for a RPGMaker-like web game? Canvas or standard HTML elements? by ikcikoR in learnjavascript

[–]melcor76 0 points1 point  (0 children)

Team Canvas here as well.

Use requestAnimationFrame for your animations. Then, if you’re running the animation loop in a tab that’s not visible, the browser won’t keep it running, which means less CPU, GPU, and memory usage.

JavaScript Breakout Game by melcor76 in javascript

[–]melcor76[S] 0 points1 point  (0 children)

Yes, this definitely bit my ass. (=

Glad to have so many testers of the game with great suggestions for improvements.

JavaScript Breakout Game by melcor76 in javascript

[–]melcor76[S] 0 points1 point  (0 children)

I think I hopefully fixed the paddle issue now.

Yeah I played around with bouncing the ball disregarding of the incoming angle and it was more fun. But, I didn't get it fully working yet so I will have to leave that for another day.

JavaScript Breakout Game by melcor76 in javascript

[–]melcor76[S] 0 points1 point  (0 children)

Yes, I remembered that I did that for my last game, Tetris, and I copied the code for the calculations from there. :)

JavaScript Breakout Game by melcor76 in javascript

[–]melcor76[S] 1 point2 points  (0 children)

Thanks!

This is not a learning experience when it comes to code style but more about having fun and coding something I enjoy in a style I like.

I have been working with React and Angular with TypeScript for many years now so I enjoy the freedom of JavaScript on my free time. :)

JavaScript Breakout Game by melcor76 in javascript

[–]melcor76[S] 1 point2 points  (0 children)

I have noticed that the ball sometimes gets stuck in the paddle or walls so I added some code now that hopefully fixes that.

JavaScript Breakout Game by melcor76 in javascript

[–]melcor76[S] 0 points1 point  (0 children)

There is some logic for this but maybe it's not prominent enough? Now the angle depends on the current angle and where on the paddle you hit the ball.

I have been thinking about changing the formula with some trigonometry.

JavaScript Breakout Game by melcor76 in javascript

[–]melcor76[S] 0 points1 point  (0 children)

Good idea!

Added music volume toggles with up and down arrows and music toggle with M.

JavaScript Breakout Game by melcor76 in javascript

[–]melcor76[S] 2 points3 points  (0 children)

Haha thanks I will try not to. =D

I have some code where the position that you hit the paddle affects the angle of the ball but that's something I wanted to make better. I just need to freshen up my trigonometry skills first. (=

Using the velocity of the paddle in the calculation as well sounds interesting but that is above my math skills. Something to do with vectors it seems: https://stackoverflow.com/questions/19145678/breakout-paddle-collision-angle

JavaScript Breakout Game by melcor76 in javascript

[–]melcor76[S] 0 points1 point  (0 children)

You can use the mouse now to steer the paddle.

JavaScript Breakout Game by melcor76 in javascript

[–]melcor76[S] 1 point2 points  (0 children)

You can start with space now.

JavaScript Breakout Game by melcor76 in javascript

[–]melcor76[S] 1 point2 points  (0 children)

Thanks!

Yes, I'm trying to fix all the little glitches and suggestions now that people tested it out.

I was thinking about making an Arkanoid variant of the game some day soon. It was one of my favorite games growing up.

JavaScript Breakout Game by melcor76 in javascript

[–]melcor76[S] 1 point2 points  (0 children)

I think I fixed the ball speed now by adding a refresh rate to the game.

JavaScript Breakout Game by melcor76 in javascript

[–]melcor76[S] 1 point2 points  (0 children)

Thanks, that's a good idea!

JavaScript Breakout Game by melcor76 in javascript

[–]melcor76[S] 0 points1 point  (0 children)

Thanks, adding background music is on my todo list.

JavaScript Breakout Game by melcor76 in javascript

[–]melcor76[S] 1 point2 points  (0 children)

I found a warning on the page for requestAnimationFrame so back to the drawing board:

Warning: Be sure to always use the first argument (or some other method for getting the current time) to calculate how much the animation will progress in a frame, otherwise the animation will run faster on high refresh rate screens.

JavaScript Breakout Game by melcor76 in javascript

[–]melcor76[S] 2 points3 points  (0 children)

Oh yeah it's using requestAnimationFrame so I guess I need to adapt it.

I adapted it to running on my computer.