2 simulators running simultaneously

I have a student who’s game runs a second simulator about 5 secs after he runs his game simulator. Why is this happening and how do i get rid of it? I have tired researching it but can’t find useful information on it. His plane will also only shoot when the second simulator is started.

4 Likes

Hey,

Most likely what’s going on is they added the ‘radio’ extension and used it in their program; you can check this pretty quickly by looking for the category in their toolbox:

image

This is for communicating between two physical devices; we don’t use it much in arcade but you will see it very often in micro:bit programs – e.g. the rock paper scissors under games or the fireflies project.

It’s easiest to help if we can get a share link to their current code, but you should be able to locate the blocks that are causing this by searching for ‘radio’; either press ctrl+f or right click on the workspace and press find... at the bottom:

image

This will pull up a search box, and if you type ‘radio’ it’ll highlight all the associated blocks:

which you can then remove from the project.

Here’s an example of radio being used: https://makecode.com/_DDYPHfb4eaE4

If you don’t see the Radio category, there might be another extension they added causing it, but I’d have to see the project to identify it / I don’t think any of our other ‘suggested’ extensions interact with the radio feature.

4 Likes

Yes, he is using a few radios.

3 Likes

Hm, are they using radio to try and separate out their code? For example, here it look like they just want to fire a projectile on game update:

and are trying to use the delay since you can’t pause in on game update without making the whole game slow down. If that’s the case, they can use the timers extension:

And use the ‘separately do’ block to run the code that fires the projectiles

Or, in this case, they could use a forever block to do the same thing without handling all boolean logic themselves (the forever block is similar to on game update, but it doesn’t cause the game to wait for it to finish – it’ll just run again whenever it finishes):

It looks like they have similar logic for each of the enemy types, so they’ll want to make a similar conversion there as well.

One other feature they might be interesting in are function blocks; you can find them by clicking on advanced. These will let them define their own functions that they can call, which is similar to separation they have by putting them in their own functions; that’d make it easy to combine the logic for spawning all the enemies into one on game update, and let the function keep track of whether to spawn one or not without waiting on it; e.g. like this:

Here’s the link with those changes in it as examples they can use:

2 Likes

I think they were trying to use radio as a sort of “message” in Scratch. Perhaps they were looking for “functions” instead?

1 Like