Sophie's Castle Adventure - block code

Anyone have suggestions on how to access block code for Sophie’s Castle Adventure. I’m working on a project for my kids and wanted to use Sophie’s Castle Adventure posted not the MakeCode page as a learning tool or framework for further development. However it is shared as JavaScript and not block code. The JavaScript is complex and beyond my abilities. There is no block code option due to the complexity of the JavaScript as I understand. There is access to a .png file of block code but it is unreadable due to the low resolution. Anyone have suggestions on how to access readable block code for Sophie’s Castle Adventure.

2 Likes

welcome @Ponysong ! You could create a new project, switch it to javascript, then copy-paste the code from Sophie’s Castle Adventure, into the new project, then switch it back to blocks. If any of this didn’t make sense I could try to send pictures

Welcome to the forums @Ponysong!

Wait, so you are unable to click this?

If you could post the link here, that my help. (Just in case you don’t know how to, you press the 3 connected circles at the top right of the screen, press share, then press copy link.)

Even if you converted it to block code, many sections would not convert cleanly (grey blocks), thats just the nature of trying to convert JavaScript → blocks. And the resulting code would still be confusing to use and work with.

If you really want to use this project, you could ask sylvancircle for help explaining specific parts, and then take away that info in your own project. In essence, the gameloop is quite simple - enemies spawn around the player, player kills enemies for upgrades, enemies get stronger over time, repeat so it shouldn’t be difficult to create a working prototype.

3 Likes

that button can be deleted by deleting the “main.blocks” file in the file explorer

1 Like

Actually, yeah good point…

1 Like

Thanks everyone. I think Luke up above summarized it well. To paraphrase - ‘you can’t get there from here’. I tried the cut and paste method, but got a MakeCode generated error. Ultimately I reached out to the author through GitHub just for a readable higher res version of the block code. That request is still pending. It has been 4 years since it has been touched by them. So expectations are low.

I was just surprised the Microsoft team has it listed on the main start page under Community Games and yet not accessible in Block Code for what I would guess is the average ability for the majority of the community. The JavaScript is beyond me, but maybe that is the learning point I guess…get deeper into JavaScript. Thanks everyone.

2 Likes

That’s fair yeah; it’s somewhat hard to balance in that regard, as you want a mix of ‘aspirational’ and ‘easily attainable’ on the homescreen – ideally don’t want to scare people away on either end, have to be careful to show that even though there’s a low floor on making games (just a few blocks and you’re moving) there’s still a high ceiling to what you can do in the platform. Because we start in blocks, it’s easy to have people’s first impressions dismiss it as ‘just for little kids’ if more fully featured games aren’t right up front.

You can still do complicated games in blocks (e.g. if you see the game we’ve been making on the livestream currently, it’s MASSIVE but we’re still in blocks), but many find it easier to transition to javascript to split things up / keep track at that point. The community games section / game jam ones in particular are a bit more in the aspirational category, because they’re directly from community / we don’t edit them before showing. We’re happy to help with figuring out ways to do things / if you want games in the same vibe as sophies castle but blocks based i’m sure some others here will have pointers, or I can find some starting points after i get through start of work day / clear forum queue / etc~

2 Likes

the error was likely a lack of extensions

Again thanks. I’ve been enjoying the learning journey. In the spirit of continuing on my learning curve I will jump into the livestream jwunderl referenced. Which one is that specifically? Got any links I can click?

1 Like

Looking at the project, they used many javaScript only features, such as switch statements, that aren’t in blocks at all. Unfortunately that means that there most likely is not a blocks version, and it would be a painful and manual process to convert the project to blocks. main.ts is also nearly 2000 lines long. That’s not a small project, and even in blocks it would not make for a very easy example project. It would be a pretty good teaching tool if you were to ever teach them JavaScript though! It looks super well organized and the code actually looks like it would be quite straight forward and would be alright for teaching Switch statements and ternary operators, which are used often!

1 Like

Ah yes, our stream starts in just about 2 hours at 1pm PT here: http://twitch.tv/msmakecode (we usually do monday/wednesday/friday at that time).

They do also all get mirrored over to our youtube Microsoft MakeCode - YouTube if the time doesn’t work well or if you want to scroll through other ones (e.g. where we’re not multiple months deep into a very complicated game :laughing:). For example, here’s the start of us making a falling blocks game in blocks Last livestream of 2025 in MakeCode Arcade!

1 Like

Yeah that can work… If the assets would also come with copy and pasting the code.

1 Like

Wow. Thanks everyone. I normally eschew posting to forums, amazon reviews, and the like. That said, through this thread I have found MakeCode to be a very supportive and positive online community. What is here are some great assessments and insights with understanding. I have been shown several threads to pull on and develop. Thanks all for taking the time to share. Now for me to work on it all! It’s been very ‘aspirational’.

2 Likes

not intirelly sure it works, but i heard that if you turn it into a github thing then you can make files witrh any extension (.cpp, .blocks (maybe), etc), so maybe you could re-create main.blocks. this is only a theory though

there’s a good reason why i’ve stuck around here for 3 years :D

good luck coding!

1 Like