Microsoft MakeCode

Boss falls from platform/ problem code with Meowbit

hello everyone, i have two problems.
the first concerns the boss, sometimes he falls from the platform when he is injured, or when he is pushed against the walls. it also falls.
the second problem is that the code does not run well on Meowbit. (in gameover, jump on enemies and other objects for example).
If anyone can help me, I thank him in advance.

Tried to reproduce problem 1

image

Changing x of BOSS without a proper wall check might cause problem 1.

I guess you want to bounce boss back a little to avoid immediate death by successive overlap events, an alternative way could be setting BOSS or Player into GHOST mode for a short period of time.

Very nice game, learned a lot the way you code the ladder.

Cheers

suggestion:
go to another small tile map once in “Boss Battle”
Issue 1 is as said above, its due to the change in x, also i suggest there be a “invincible” time after being hit, same for the player and the BOSS, this way you don’t get stuck in infinite loops of getting hit.
Lastly:
the graphics/art is SO GOOD, it all fits in one art style, and looks great. keep on making!!!

thanks

  • Blobiy

Thanks for your help,

the Ghost “method” doesn’t work on platform Game, player falls through the walls ^^.
Yes, the idea is the boss bounce on the wall.

Thanks for your help,

i think the “small tilemap” is a good idea. Maybe with a door to teleport the player on that tilemap.

Use a variable to implement ghost mode.

Hello Felixtsu,

do you have an example ? the code i used is to set ghost mode “on” for 100ms or less and set ghost mode “off” after. but the player falls through the wall in ghost mode…

thanks for helping me.

Hi, sorry for the late reply.

The idea is

  1. use a variable, say ‘spriteGhostMode’ to mark the ‘spriteGhostMode’ on/off for a given sprite;
  2. for every onOverlaps event handler and overlapsWith() method call, check ‘spriteGhostMode’ first, eat the event / return false when ‘spriteGhostMode’ is on;
  3. after given period of time, automatically set the variable to off.

No. 3 is a little bit hard to do in blocks, since there’s no threading blocks available.

I’ve written a helper block to do the trick.
Screen Shot 2020-05-20 at 7.44.12 PM

In the given period of time, all onOverlaps event handlers are eaten. Problem is that I can’t intercept Sprite.overlapsWith, so the forever loop handling BOSS collision is needed to change.

Check out the partial fix, when the player collides with a minion, it goes in ‘spriteGhostMode’ for 2 seconds, some animation should be introduced for better indication.

Hope it helps.

Wow, it’s cool !
i’m not able to write those kind of blocks. Thank’s a lot for your help.
Question. why do the same with the minions ?