Colision seems a bit weird?

I'm trying to make a maze game with App Inventor (with reverted controls and hidden bombs) and now I've only made the moving jocestick and the hidden bomb.
The screen is supposed to refresh when the character touches sprite2 and sprite2's image is boom.png. However it just sometimes don't work. Something I've noticed is that it always don't work when you just stand still.
I'm kinda new to App Inventor and am not sure if I've done something wrong or something.


image of my blocks
the_expected_dungeon.aia (10.4 KB)
my code

and besides, is there someway to solve the problem of the blank spaces cause by different screen sizes?

Welcome.

I suggest you experiment with a fixed Canvas (perhaps 300 x 300 pixels) and see what happens. Your algorithm for adjusting Screen size may be buggy. (No I don't know what might be wrong with it). If your game works with a fixed size flawlessly then move on to adjust your algorithm.

I expect you have already read and understand Creating Animated Apps , it provides great advice with respect to collisions. Be aware when you program your sprite the collision is determined by the left upper coordinates of the corner of your Sprite (not the center of the sprite or necessarily an actual edge).

Knowing this may help you to fix your app.

Ok thanks a lot! I will try the methods you’ve suggested.

Well I think I’ve discovered why the collision is so strange: the Collide event is only triggered when a sprite is not touching something and suddenly touches something, unlike pygame which I used, where colliderect will always return true when the two objects are touch each other.
So I guess I would have to instead check the pos of the player to see if it’s touching the explosion.

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