Quick question about the text extension

Hi there! Is it possible to create a simple custom score using the arcade text extension?
This is the thing that i’m working on. I’d like to make it so that the coin counter in the picture goes up once you kill an enemy.
arcade-Stupid-Shooter-test

2 Likes

can you send a link them I could help

Okay! Here it is…

3 Likes

thanks

Something like this should work.
image
Hope this helps.

It did actually help! I simply made it so that the monkey would drop a coin when killed and added that code when the player touched the coin. Thanks a bunch!

1 Like

so you just need to put the change score block

1 Like

yeah i did the same thing

but I also made it so it updates

2 Likes

Another question I’d like to ask (that doesn’t nessecarily relate to the text extension…)
Is it possible to save the amount of coins that the player has after destroying monkeys?
I’m asking because I plan to add more weapons to this game, so I’ll add a shop where you could spend coins for different weapons. There’s no point in buying a weapon when you reset the game and everything is gone, right?

The settings extention saves a number or a string, so when you come back, it is still what is was when you left.

2 Likes

I Have also put in saving for your coins :grinning::+1:

Sorry, could you put that code back in for the current link? The project you have is outdated, and I’d like to put the code back into the current version, since when I try to do that, it doesn’t work.

1 Like

I was just watching Curious George with my sister before reading this post…
(I’m not kidding)

4 Likes

ok will do :+1:

here it is and if you press the menu there will be an option to reset your coins:

Built-in menu options??? How? (I did sneak a peek at the code to figure out how.) It seems to be an extension! Can you send me the extension download link when you have the time?

well @meeeeeeeep1 has created this extension but here the link Custom Menu Showcase
and I can teach you how

  1. go to javascript
    image

  2. click on explorer under the simulator
    image

  3. click on the plus symbol next to the explorer
    image

  4. click the ok button but don’t change the name

  5. delete all the code in the file and paste in this:
    //% color=“#e6ac00” icon=“” block=“Menu”
    namespace menu {

    //% block=“Add system menu option $name icon $image function:”
    //% handlerStatement=1
    //% image.shadow=screen_image_picker
    export function addmenuoption(name: string, image: Image, handler: () => void): void {
    scene.systemMenu.addEntry(() => name, handler, image);

    }
    }
    then click back to blocks

1 Like

Wow, thanks! This is better than my custom-made pause menu.

1 Like

Hey there again! I’m sorry I keep asking so many of these, but this will hopefully be the last question I ask: Would it be possible to create a menu using the arcade-menu extension?
For some reason, whenever I try to do this myself, the game crashes due to a “reading width” error.
Here’s the current code: https://makecode.com/_Rtm977MeiF0b
Additionally, I’ve added a new gun; the Freeze Ray. Thanks for playing the game & answering my questions :smiley:

I’ve fixed the error you had.