Unknown issue with collisions

Hello, i’ve been having a few issues in making a game here…

It’s a small remake of PvZ to MIT App Inventor. The project is really big for now.

The issue is, when a Zombie collides with a brain, it should open the screen “Deathscreen”. and, well, it DOES work… but sometimes, not always but sometimes, when a zombie spawns, for some reason it still switches to the Deathscreen, as if it thinks it collided with a Brain, but i’m quite sure it did not. I cannot explain that much here because the project is really big, but i’ll link the .aia using Mediafire because the project is over 8 mb.
I can say that the zombies’ spawn in on the top part of the blocks, with all the procedures, and the Brain collisions are at the very left, where there is the Zombie HP system. I’ve been quite going insane with this and i’d really appreciate help, thanks for reading.

.aia link:

Show your relevant blocks for zombie spawning and brain collision...

Your Media could be reduced.

Is that the issue? I didn’t think file sizes would inflict the collisions or several proprieties

Might help if you provided block images that we could actually read here...

regarding your images in the app:
Reducing your image file sizes will certainly help with app performance, if nothing else.
Look at what size you are setting for each image, and the devices on which the app will be run. Your image dimensions do not really need to be any bigger than that.

According to Unchive, you have 277 Sprites for one Canvas:

Unchive

From the file, they were well readable… maybe this works?

Yes, it’s true, I needed to do that so the user could spawn around 40 of each type of plant (so a bit more than 80 in total) and around 130 projectiles so if the limit of placed shooters was placed there still would be enough projectiles for them to shoot that can be inside a list of projectiles

I'm seeing a lot of rubber stamping based on those Sprites:

This type of app benefits from Generic Event blocks and tables of Sprite Pictures and collision type combinations (Sprite Type A against Sprite Type B)

You can also use dictionaries to hang extra attributes against Sprite components, to age them.

Sample app: Changing Sprite in Blocks - #6 by ABG

Your multiple Clocks can be tricky to juggle.
The new Closures feature of AI2 allows you to store pieces of code into lists, that you could arrange into a schedule to happen in the future, sorted by time and serviced by a single fast Clock. (I have not tried this yet, but it sounds like your app might need this.)

Regarding the spawning on top of other Sprites problem, that might be addressed by checking a prospective spawn site against the Every Sprite block, checking your prospective Sprite's footprint against the footprint of every other Sprite currently Visible before doing the spawn.

This is another case for Generic blocks.

Sample Generic blocks using Sprites:

I went a BIT crazy, buuut… I found a solution.

So, easy workaround? Just make it so the “Lose” Procedure only works after one minute and 30 seconds. somehow it works this way. That, and many “and”s with ifs and thens… just make many controls of it being able to work

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.