Mark Andrade

astro clash covere tile. It says Astro clash blue on dark blue with the hero icon showing.

More Playback Timing Issues

Today I worked on adding a progressive difficulty. It’s pretty simple and I like it. Makes this little game more fun and replay-able.

There was some weird timing issues on the playback of this game in particular that the other games didn’t encounter. Took awhile to figure it out.

When small asteroids were spawned during playback they could be a fraction out of sync.

This would cause either the wrong rock colliding with the bullet or it was missed even though during debugging it looked like the bullet overlapped the rock.

I’m spawning the small rocks in the collision callback function of the big rock. I tired setting a flag to spawn in the update() function but when I did, it was off by a frame.

What ended up working was setting setTimeout() for 1 millisecond and calling the small asteroid spawn function from that.

Added particle effects and sound. Then tested for awhile.

Game feels ready to go. Going to look at it with fresh eyes tomorrow.