STA Ecobeasts Trash Cleanup! Meowbit error 021

Thank you! Duh!

1 Like

I would try to reduce the amount of sprites and delete sprites that aren’t needed anymore, like sprites from the last level. You might already be doing this since I haven’t looked at the code yet.

I don’t think so.

1 Like

Thanks, think I am already deleting sprites from previous levels…Oh well! I’ll let my class play tomorrow on their iPads and see how they get on! :slight_smile:


I just saw the plastic bag with a wall on it. The one you couldn’t clean up. Also, when you pick up a bag or something. I think it was a bag though. I feel like that you should put the long text box about cleaning up first. Then, when you clean it up again, it will not show the text. Just a suggestion. After each level and the first bag you pick up on the level again, that’s when you can put the large text box on.

1 Like

I also know how to put the levels on a screen if you would like as well.

Also what grade do you teach? Maybe instead of an instant game over, you could ask if they want to try again and start over their current level. Looking at the theme of the game, first graders? second graders?

I edited the game if you don’t mind

1 Like

I like the idea of text box only after first time - how can I make it so it only appears after first time of each level?

I teach year 5 - 10/11 year olds.

I’ll try and find some tutorials to learn how to do what you suggest, I like the ideA of try again option or level selection - Thanks’

you can make true or false statements and use those to see if you should ask or not.

Here are the things. I also added a 50/50 chance of getting a life or not

Hope this helps!

there are beginner tutorials on the front of the home screen when you get to the website. The paddle ball is really fun. It’s probably the hardest tutorial in my opinion. It’s for two players so you could have tiny competitions for your students.

Here is a version of pong I made once

the TextSprites are what’s causing the out of memory error. The ones created in showIntroduction.

@darzu: How big are the images you’re allocating? Can you switch to drawing at runtime and not drawing to an image first?

We create a new image every time there is an update and set it as the sprite’s image:

Do you mean redrawing the text every frame straight to the game buffer?

Yes, subclass Sprite and override the draw method to draw directly to the screen

Will probably need to do something interesting to make overlaps work though

Honestly, I have no experience in the hardware stuff. I’m surprised that the text sprites are the things that takes up all the memory. I was thinking of the giant background causing all the memory stuff to fail

1 Like

@Dreadmask197 yeah, it’s a little tricky!

Big images that you draw in the sprite editor take up no memory unless you change them in your game (i.e. call setPixel, replaceColor, flipHorizontal, flipVertical, etc.). If you create a new empty image, however, those can take up memory. That’s what the TextSprite extension does, it creates new images and draws the text onto them.

hmm… so the textsprite extension uses up a lot of memory due to writing in you words and turning them into pixel art. Then you change the sizes which take up even more memory. Am I right @richard? Confusing, but I think I get it

Hmm this could be tricky. Also the way outlines are computed is pretty expensive and I don’t think we can do that every frame.

With the current approach, we can probably save considerable memory by reusing the sprite’s current image if it is of the correct size already, and maybe oversizing and rounding the image a bit so that the size is less likely to change with minor updates.

So I guess that you shouldn’t use too many text sprites due to memory storage?

Are you sure the outline won’t work? I think it’s worth a shot

I took out the outline and then it worked…

1 Like