# Face escape

**URL:** <https://forum.makecode.com/t/face-escape/3249>\
**Category:** Arcade\
**Tags:** game\
**Created:** [August 27, 2020, 7:01pm UTC](https://forum.makecode.com/t/face-escape/3249 "2020-08-27T19:01:47Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![purna079](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/purna079/32/4018_2.png) [@purna079](https://forum.makecode.com/u/purna079)\
**Post date:** [August 27, 2020, 7:01pm UTC](https://forum.makecode.com/t/face-escape/3249/1 "2020-08-27T19:01:48Z")

</div>

> **[Face escape](https://arcade.makecode.com/83843-06786-08224-40403)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![annapurna079](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@annapurna079](https://forum.makecode.com/u/annapurna079)\
**Post date:** [August 27, 2020, 9:29pm UTC](https://forum.makecode.com/t/face-escape/3249/2 "2020-08-27T21:29:27Z")

</div>

good job for the nice game.

---

<div class="post-metadata">

**Author:** ![LcAtonal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/lcatonal/32/16800_2.png) [@LcAtonal](https://forum.makecode.com/u/LcAtonal)\
**Post date:** [August 28, 2020, 6:51am UTC](https://forum.makecode.com/t/face-escape/3249/3 "2020-08-28T06:51:42Z")

</div>

Did you want infinite jump?

---

<div class="post-metadata">

**Author:** ![purna079](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/purna079/32/4018_2.png) [@purna079](https://forum.makecode.com/u/purna079)\
**Post date:** [August 28, 2020, 3:11pm UTC](https://forum.makecode.com/t/face-escape/3249/4 "2020-08-28T15:11:34Z")

</div>

I sorta wanted gravity but this is fine!

---

<div class="post-metadata">

**Author:** ![GameGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamegod/32/2756_2.png) [@GameGod](https://forum.makecode.com/u/GameGod)\
**Post date:** [November 5, 2020, 6:46pm UTC](https://forum.makecode.com/t/face-escape/3249/5 "2020-11-05T18:46:24Z")

</div>

The physics seems to stop when you move in the air.

---

<div class="post-metadata">

**Author:** ![purna079](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/purna079/32/4018_2.png) [@purna079](https://forum.makecode.com/u/purna079)\
**Post date:** [November 5, 2020, 6:50pm UTC](https://forum.makecode.com/t/face-escape/3249/6 "2020-11-05T18:50:38Z")

</div>

Yeah, gotta fix that… but there is an invisable barrier in someparts

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [November 6, 2020, 11:47am UTC](https://forum.makecode.com/t/face-escape/3249/7 "2020-11-06T11:47:54Z")

</div>

Hi @purna079,

I liked your game so much, I just wanted to implement a few improvements; I hope you don’t mind.

> **[Face escape (cosmos)](https://arcade.makecode.com/30212-33489-59029-13865)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

The _invisible barrier_ were the ‘black’ walls at the top of the screen; so I made them visible. Also about the jumping, you set the character to move using the controller (x & y), which meant that you could float through the game by continuously pressing up. I removed the ‘move by y’ and have the player jump in a ‘controller up’ event. I added a variable ‘jumping’, that is set to ‘true’ (as you fall from the sky), and becomes ‘false’ when you overlap a wall (at the bottom). In the controller ‘up’ event, I check that the player is not already jumping, and have the player jump again. Since you have set the gravity (acceleration y), when jumping you only need to set the ‘velocity y’ to a negative value (to move up the screen).

There is something that I found strange in the game. You can land on a blue/purple tile. However when standing next to a ‘red faced’ tile (no even on top), it would end the game. You have a on overlap event for the ‘pink’ colored tile, but the player is not even touching it.

@jwunderl  
Hi Joey, I am wondering if you have time to look at the above mentioned ‘overlap’ issue. Is this a bug in the game or in the color-coded tilemap extension? The player does not even overlap the ‘pink’ colored tile, but when it gets close to it, it triggers the event. I thought maybe the sprite was wider than it appeared, but it is also 16x16. Could it be that overlap events for walls in color coded tilemap work differently than overlapping in sprites (i.e. the entire sprite dimensions are compared vs only the visible pixels)?

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [November 6, 2020, 11:51am UTC](https://forum.makecode.com/t/face-escape/3249/8 "2020-11-06T11:51:21Z")

</div>

> [@purna079](#):
>
> Yeah, gotta fix that…

If you want some more ideas on how to animate the player (when moving, jumping, facing left and right), take a look at this ‘template’ game I just made:

> [@Side-scrolling platformer template](https://forum.makecode.com/t/side-scrolling-platformer-template/4292):
>
> I just wanted to share with you my template for creating a side-scrolling platform game. It has the typical movement animations you would expect when moving left & right (thanks to the extension ‘riknoll/character-animations’ from @richard). I also set an image when jumping and facing left or right, and another image when ‘not moving’. I use the camera a little different than what most games do. Normally the player is set to move the camera. In this case the player is always centered in the mi…

---

<div class="post-metadata">

**Author:** ![purna079](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/purna079/32/4018_2.png) [@purna079](https://forum.makecode.com/u/purna079)\
**Post date:** [November 6, 2020, 2:02pm UTC](https://forum.makecode.com/t/face-escape/3249/9 "2020-11-06T14:02:38Z")

</div>

> [@cosmoscowboy](#):
>
> Hi @purna079,
> 
> I liked your game so much, I just wanted to implement a few improvements; I hope you don’t mind.

I don’t mind at all! Thank you! I just don’t know how to fix that bug… thanks anyway!

---

<div class="post-metadata">

**Author:** ![purna079](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/purna079/32/4018_2.png) [@purna079](https://forum.makecode.com/u/purna079)\
**Post date:** [November 6, 2020, 2:20pm UTC](https://forum.makecode.com/t/face-escape/3249/10 "2020-11-06T14:20:00Z")

</div>

> **[Face escape (cosmos) + Purna079's Edits](https://arcade.makecode.com/24452-27296-02782-60396)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

I fixed the problems by using regular tilemaps and not color-coded. hope you guys can fix that bug.

Thanks to @cosmoscowboy for pointing out the bugs. enjoy!

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [November 6, 2020, 6:12pm UTC](https://forum.makecode.com/t/face-escape/3249/11 "2020-11-06T18:12:22Z")

</div>

This looks about as expected, the sprite wall collisions are based on a bounding box of the sprite, not the exact overlapping pixels - it looks like the arms are a bit wider than the rest, so its colliding when the arms start to be above the danger pixels

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [November 6, 2020, 7:03pm UTC](https://forum.makecode.com/t/face-escape/3249/12 "2020-11-06T19:03:58Z")

</div>

Thank you for replying on this. I was expecting that it had to do with the bounds of the sprite, and not the visible pixels.

Sorry to be pedantic about this, but it seems that the check for a colliding wall seems to occur a few pixels earlier than actually overlapping. When a player lands on the ground, with a wall that does not have an overlap event, then there is no gap between the sprite and the ground.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/c/c53b7380e2ff13417687767b66b82f548387d633.png)

When I enable the overlap event (the brown colored tile is where the player lands on the ground), the player lands a few pixels higher than the wall.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/1/111d7f0f7f2d7489d526ffc8aa744ff2fa3b505c.png)

Here is an example of this:

> **[Rygary](https://arcade.makecode.com/13768-62070-98191-85405)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [November 6, 2020, 7:06pm UTC](https://forum.makecode.com/t/face-escape/3249/13 "2020-11-06T19:06:10Z")

</div>

> [@purna079](#):
>
> I fixed the problems by using regular tilemaps and not color-coded. hope you guys can fix that bug.

I hope they can investigate whether this is an issue, as the game I am starting to develop is using the color-coded tilemap extension. Good to know that this issue does not occur in the regular tilemaps.

---

<div class="post-metadata">

**Author:** ![purna079](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/purna079/32/4018_2.png) [@purna079](https://forum.makecode.com/u/purna079)\
**Post date:** [November 7, 2020, 3:23pm UTC](https://forum.makecode.com/t/face-escape/3249/14 "2020-11-07T15:23:21Z")

</div>

Thank you all for helping me!
