Spaceship Game (Remix)

(remixed from Spaceship Game, by oscar robinson) by jacob-otw
See Code Download Embed
The orignial is by oscar robinson.
What I've remixed:
I've rework the asteroids to work on clones instead of 4 sprites, this will make adjustments in the future easier.
The primary thing I added was refreshrate based speeds, I'd assume MR.robinson made the code on a 60hz display, the problem happens when the code is run on a setup with a higher refreshrate display. Because of how SNAP! works, the code will run faster when the refreshrate of the monitor is higher (unless the turbo mode is enabled) which means that on a 144hz display the asteroids will fly towards the player at 2.4 times the speed they would fly on a 60hz display. My sultions is to to a 1 second test on program lauch which increaments a varible by 1 until 1 second has passed, after that the current value is stored in "RefreshRate" as a number, this code can be found on the Stage-sprite. Any time I want to match the speed across displays I simply write (Value)*(60/RefeshRate)
Example= -5*(60/144) will cause the astoids to fly the same distance on a 144hz display as it does on a 60hz in 1 second.
This way the value that is enjoyable on a 60hz display will also be enjoyable on higher or lower refreshrates. 

Use W, A, and up and down arrows to move the spaceship. Click to shoot. Avoid asteriods. Collecting life heart gives you health. There will be a boss fight when you have 20 points. Kill the boss to beat the game! Have fun playing!! :)

Created January 5, 2022

Last updated January 5, 2022

Published January 5, 2022