STA Ecobeasts Trash Cleanup! Meowbit error 021

Im really happy with what I have so far…think I may just want to edit my sprite - change the colours and call it a day with the 3 levels that I have.

I tried to do some walking animation but I think there is a bug somewhere as my hero sprite sometimes behaves strangely hopping by himself…think it might have to do with the state of the sprite when nothing is pressed…

I tried loading the game on my Meowbit but it gives me a 021 error which Ive read could be due to out of memory…anything I can do to fix this?

Play and let me know what you think! Any comments on what to improve? Currently plastic bottles give you 2 points and plastic bags give you a life…think I need to change to less plastic bags to make it more challenging or to make them 3 points and no extra life?

Game so far…

Oh, and on the level with the Thai temple, there is a plasticbag sprite that behaves strangely - coded them to destroy when the player sprite overlaps - works on all except for one and I don’t understand why?!

The Meowbits have less memory than say a PyGamer or PyBadge. Memory is the main thing you need to watch out for when creating lots of sprites and/or modifying images. The Meowbit has 96KB of memory (I think, don’t hold it to me) while the PyGamer has 192KB of memory.

I really like this game, especially the beach level! Beaches are my favorite eco system! :beach_umbrella: (Hmmm…maybe instead of calling them levels, you should call them eco systems. Just a thought…)

1 Like

Yeah, one of them plastic bags have a wall on them.

1 Like

Thanks! Ecosystems it is then! But levels don’t appear in the game - but I’ll call them ecosystems, I like it!

Great that you enjoy the game! :slight_smile: :smile: :wink:

So can not do anything to make it work on the Meow bit? Is it likely to be the walking animation or…different kinds of sprites or the quantity? Just looking for a way to maybe scale it down?


1 Like

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.