Racers API

I'm extremely proud to present to everyone: Racers API! (I know, I know. I need a better name.) It's heavily based on SpaceTraders. You go around racing for money and try to buy the best car. (Not much of an objective, I know. I'll be adding to the game later.) So far, you can buy 10 cars (as of 1/3/2021), not including the car that you start off with: Honda Civic. The list includes real cars and their latest top speeds. The faster your car and the more challenging the race, the bigger the bounty for winning as well as losing. You can play through Snap!: Snap! Build Your Own Blocks, or you can make your own requests through any other coding language that is capable of making URL requests (I'll be making documentation for that soon!). Please provide feedback as well as bug reports! Even small things like spelling mistakes! And if you have a request for a car to be added, please let me know! I'll be adding cars myself too! Let me know what you think!

How do I get a key?

Are you using Snap! blocks, or are you going to make a script and do it programmatically (with another language that is)?

I've added the external application code to Github! Readable here:GitHub - billyBob456/Racers-API

Blocks.

So, using the Snap! the project I gave, use the start block with a username. The project will keep track of your key for you. But if you need it, it's stored in the "key" variable.

After using race once it stopped working.

And now my key is invalid.

One sec. I'm trying to replicate the error.

So which blocks did you run in order? If you can't remember the order, just tell me the blocks.

  1. start
  2. account
  3. races available
  4. current car
  5. [view] race (num) [8] from [races available]
  6. [select] race (num) [8] from [races available]
  7. race
  8. race
  9. reload (after saving key)
  10. login (with correct key)

Ok. I think I know what happened and I think I fixed it. Try again.

On top of the bug, that @joecooldoo found. I've also changed the view race block. Before, every time you view a race it would give you a different generated race. And then if you selected a race, it would be a different race because it generates a new race. Now it stores the race you viewed in a variable called 'tempRaceKey' and if you decide to select that race, it will set the actual race key to that variable. If you want to view another race, it will refresh the 'tempRaceKey' with the new race key.

How do I save the api key?

untitled script pic

It's in the key variable.

What were the steps you took to get that error?

I've added the "buy car" block! You can now purchase cars once you have enough money!

Let me know if anyone wants cheat blocks (to make your own cars (with custom name and speed), set your money to a custom amount, and more)!

No. lol