There is this game I am making, actually its like an iPad, and I don’t want it to be laggy. I would like to know how much code is in a megabyte, if possible, and find how many megabytes Hopscotch can hold in one project.
I would think that around 50 blocks of code would be a megabyte, but I’m just guessing.
Doesn’t look like the question was every really answered (but it’s a good question).
It takes about 300 characters (in the file that saves your project data) for the Hopscotch code block:
Set X to X + 1
I believe the encoding used is UTF8 so most characters would take 1 byte. So that block took 300 bytes. 1 MB is 1,000,000 bytes so it would take 1,000,000/300 = 3333 of those blocks to consume 1MB of file space.
Every block is different though. And there’s a lot of other data in the file as well, so you’d get less than 3333 blocks in a 1 MB file
How many MBs the file can be (it also gets gzipped for compression) depends on the current settings for the max size that’s allowed to be uploaded to the server. I haven’t tried a large file recently, but a while ago it was somewhere around 3MB, I believe. So that’s a lot of Hopscotch blocks…