I was just happily coding my game when I got this error.
This is the link
And here are the logs.
This is such a cool game! It compiled fine on my end when I played. I have seen this error though. First I would try closing and opening Makecode, and then try duplicating the project and opening the copy. Last time I saw this, there was an error in my code, but it wasn’t highlighting the block/showing the warning triangle, but because your code ran fine for me, I would assume it’s fine and a problem with either Makecode or your copy of the project somehow.
Good job grabbing the logs! That is something that everyone should be doing whenever they see something weird like this, if possible. The more things we can do to make the Dev and Mod teams jobs easier the better (they are kinda the same people lol. Love you Makecode Team! )
Yeah sorry. This was a problem. Turns out makecode was duplicating one of my functions, and then renaming some of the blocks. Then I was calling a function that doesn’t exist. I tried to post it 2 days ago, but later fixed it and couldn’t delete the topic. Thanks a lot for helping though
Thanks mods . So speedy
By the way, I didn’t want to share this version until it is done, although it is getting really impressive. Without your help I never would have gotten sin and cos for vectored velocity. I have a minimap now, made with my own code (like the status bars!!!). It is a 50 by 50 sprite. I am thinking of saving a snapshot of that image whenever it is created, or 1 in every 10 in an array. Then I could play back the “video” of the game playing out. Would makecode have enough space for this?
50 x 50 is pretty small for a normal computer, but on Makecode it would stack up quickly. It really depends on how often you are updating the your mini map. If it saves an image one every 5 seconds, that’s only 12 images per minute, but it would certainly depend on how long the games last as well. I bet you could do some testing! Maybe set it up so it captures every single frame, and then let it run while you play. Keep the fps on the screen too. If the fps drops significantly or you run out of memory (it will error) then you can estimate how often you should be grabbing frames from there. Then you can try it again with the new amount and see what happens!
I found out something interesting and unexpected. I tried it normally and… fine. No problems after a few minutes. I tried more and more adding of the frames a second until my game lagged from the effort. Still no out of memory error. Most of the picture is empty space, would that affect how much space the image takes up? This is how many times every 10ms I was running it
Well, just try playing the images back before you get excited. You might have to use “Clone(minimapImage)” instead. There is a good chance that adding the image is just adding a “pointer” to the location of the image in memory, and that would mean that it’s not actually storing the image, and is instead storing pointers to the location of the “mimimapImage” in memory, which would mean that every single array element points to the same image! This happens because usually when you set the image, it doesn’t matter if it’s a copy of the image or a pointer to an image, so the compiler just uses a pointer instead of using up a bunch of memory to make a copy for no reason. The “clone (image)” block forces it to actually copy the image instead of adding just a pointer. I would try running this test again with the Clone block around the mimimapImage variable, just to make sure.
It works so well!!! I might try to add options to speed it up, or replay it… For now I have used sx and sy to make it bigger as well.
Note that I changed max energy to 1000 and changed regen so I had machine-gunning capabilities for a better gif. At the end I just died so I would get the short recording