How to use console to test my game

I’m not sure how to use console to use my game for testing. I need to try the upgrades to see if they work.

https://replit.com/@BluebayStudios/Ples-nerd

What about using the Developer tools in the Webview? The Console is there.
P.S. I love the game!

Yes, but i’m not sure what to run in the console.

Thanks!

You can use console.log() to print to the Console.
What do you want to use it for?

1 Like

Depends what you’re trying to do. It’s just like running JavaScript, but you have to know what you want to do. You’re trying to test the upgrades? Then break down the function for your upgrade. Does it require a certain score? If so, set the score value in the console so that you can try the upgrade. This is a general way. But basically, there’s no one command that you can use to test it.

1 Like

Run the function that you want to test in the console. Type the exact name of the function and press enter. For example:

Your game has these functions and variables:

  • buyItem(price): Function to buy an item.
  • playerScore: Variable to keep track of the player’s score.

To test these in the console, you would:

  • Type buyItem(50) and press Enter to simulate buying an item costing 50 points.
  • Type playerScore = 1000 and press Enter to set the player’s score to 1000.
  • Type console.log(playerScore) and press Enter to check the current value of playerScore.

You can also set breakpoints through your test.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.