namespace userconfig {
export const ARCADE_SCREEN_WIDTH = 160;
export const ARCADE_SCREEN_HEIGHT = 120;
/**
* Custom blocks
*/
//% weight=100 color=#ffd1dc icon="🖥️"
namespace custom
*/
//% block
export function Resolution(R: number): void {
R = game.askForNumber("Resolution?")
const userconfig.ARCADE_SCREEN_WIDTH = R
const userconfig.ARCADE_SCREEN_HEIGHT = R
}}}
I need to get why it wants a comma (,) Instead of a dot
PLEEEEEEAAAAAAAAASSSSSEEEE!!!
2 Likes
Ok, let’s go error by error. The most obvious one is that you’re missing a “{” after “namespace custom”.
The comma thing usually happens when the compiler literally has no idea what you’re trying to do. This is happening because of the “const” keyword. It thinks you are trying to define a new variable, which is incorrect. The solution would be to simply remove the “const” keyword, because you aren’t trying to define a new variable, you are trying to change an old variable.
Now you come to the real issue. You can’t redefine a constant after it has been defined once. You’re done. It just can’t be done. Many people, including me, have tried and failed to create this exact extension. It’s just not possible. Unless the Makecode devs add it themselves, block users will always have to go into javaScript and do it manually.
1 Like
one question at the top why is the the screen change code there’s no reason for it to be there also not sure if emojis work or not also why is there the */ have I forgot something I have coded some extensions before so
I can see what you’re trying to do but unfortunately I’m 95% sure that it’s impossible to change the screen size with an extension. If you can get it working then congratulations! A possible error I’m seeing is that the namespace userconfig doesn’t have a closing bracket
1 Like
I’m not sure what you mean, but as I’m looking at this code, I don’t think this will work. It looks to me like you are trying to make adjustable screen resolution, which is not possible. the screen width and screen height are both constants, meaning they cannot be changed except at the very beginning of the game.
1 Like