# Canvas hitbox problem

**URL:** <https://community.thunkable.com/t/canvas-hitbox-problem/327062>\
**Category:** Questions about Thunkable X\
**Tags:** tcanvas\
**Created:** [November 19, 2019, 6:17am UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062 "2019-11-19T06:17:09Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlueWhaleYT](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bluewhaleyt/32/28437_2.png) [@BlueWhaleYT](https://community.thunkable.com/u/BlueWhaleYT)\
**Post date:** [November 19, 2019, 6:17am UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/1 "2019-11-19T06:17:09Z")

</div>

Hi there,  
I gotta to make a game called “Ball”,which a simple game controlling the ball to move to shoot these basic action.  
Yesterday,I have been tried to use [Ready Maker](https://www.getready.io/) to do what I expected,but that is quite difficult to use.Therefore,I turn back to use Thunkable.

There is a problem that can be fixed or not?  
I tried to make if the player ball is collides on the enemy ball,the health bar will substract to 5.  
BUT,the hitbox is having extra area,due to the player ball collides on the air causes health bar do it’s substation.

 ![78_Nov192019](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/8/885716b52cab1c3affff0c3436e6af20e0886b0c.gif)

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 19, 2019, 7:06am UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/2 "2019-11-19T07:06:28Z")

</div>

Hi,

Show the image of the balls.

---

<div class="post-metadata">

**Author:** ![BlueWhaleYT](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bluewhaleyt/32/28437_2.png) [@BlueWhaleYT](https://community.thunkable.com/u/BlueWhaleYT)\
**Post date:** [November 19, 2019, 7:07am UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/3 "2019-11-19T07:07:58Z")

</div>

I straightforward send the project link to you then.  
[https://x.thunkable.com/projects/5dd37137acac676d591f0cf1/71c4a4c5-39d7-4de6-b099-d23fe6041d8f/designer](https://x.thunkable.com/projects/5dd37137acac676d591f0cf1/71c4a4c5-39d7-4de6-b099-d23fe6041d8f/designer)

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 19, 2019, 7:10am UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/4 "2019-11-19T07:10:08Z")

</div>

You thought it up well. I will see the project.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 19, 2019, 7:22am UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/5 "2019-11-19T07:22:39Z")

</div>

In Live on iOS 12.4 and Android 8.1 everything works fine for me. The health indicator decreases only when the balls collide accurately

---

<div class="post-metadata">

**Author:** ![BlueWhaleYT](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bluewhaleyt/32/28437_2.png) [@BlueWhaleYT](https://community.thunkable.com/u/BlueWhaleYT)\
**Post date:** [November 19, 2019, 7:34am UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/6 "2019-11-19T07:34:21Z")

</div>

☹

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 19, 2019, 7:42am UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/7 "2019-11-19T07:42:25Z")

</div>

But I see a problem in Bluestackes. Try to display the coordinates of the ball of the player and the enemy. Perhaps the player’s step exceeds the distance to the enemy and it turns out that the collision occurred and the ball bounced back, but you do not see the collision itself. That is, the distance to the opponent’s ball is much less than the step of moving the player’s ball.

---

<div class="post-metadata">

**Author:** ![BlueWhaleYT](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bluewhaleyt/32/28437_2.png) [@BlueWhaleYT](https://community.thunkable.com/u/BlueWhaleYT)\
**Post date:** [November 19, 2019, 8:07am UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/8 "2019-11-19T08:07:32Z")

</div>

I’m sorry,I do not understand.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 19, 2019, 11:17am UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/9 "2019-11-19T11:17:54Z")

</div>

The distance between the balls is 10px, and the pitch of the player’s step is 20px

---

<div class="post-metadata">

**Author:** ![BlueWhaleYT](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bluewhaleyt/32/28437_2.png) [@BlueWhaleYT](https://community.thunkable.com/u/BlueWhaleYT)\
**Post date:** [November 19, 2019, 11:32am UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/10 "2019-11-19T11:32:35Z")

</div>

so what solution you have thought 🤔

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 19, 2019, 11:34am UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/11 "2019-11-19T11:34:04Z")

</div>

Did you display the coordinates of the balls on the screen for verification?

---

<div class="post-metadata">

**Author:** ![BlueWhaleYT](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bluewhaleyt/32/28437_2.png) [@BlueWhaleYT](https://community.thunkable.com/u/BlueWhaleYT)\
**Post date:** [November 19, 2019, 11:39am UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/12 "2019-11-19T11:39:45Z")

</div>

what do you mean to display their coordinates

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 19, 2019, 11:41am UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/13 "2019-11-19T11:41:24Z")

</div>

The balls have X coordinates. Display them on the screen in Label

---

<div class="post-metadata">

**Author:** ![BlueWhaleYT](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bluewhaleyt/32/28437_2.png) [@BlueWhaleYT](https://community.thunkable.com/u/BlueWhaleYT)\
**Post date:** [November 19, 2019, 11:47am UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/14 "2019-11-19T11:47:35Z")

</div>

![live](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/6/f699dcc2916be40329ddaade938153aed569f4a5.png)  
above one : player’s x coord  
bottom one : enemy’s x coord

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 19, 2019, 11:53am UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/15 "2019-11-19T11:53:24Z")

</div>

Now collide the balls and look at the coordinates.

---

<div class="post-metadata">

**Author:** ![BlueWhaleYT](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bluewhaleyt/32/28437_2.png) [@BlueWhaleYT](https://community.thunkable.com/u/BlueWhaleYT)\
**Post date:** [November 19, 2019, 12:04pm UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/16 "2019-11-19T12:04:44Z")

</div>

umm…I’m not understand after I did.I give you to see then.  
[https://x.thunkable.com/projects/5dd37137acac676d591f0cf1/0746cbcf-8431-4513-940c-09befeb9ed3d/designer](https://x.thunkable.com/projects/5dd37137acac676d591f0cf1/0746cbcf-8431-4513-940c-09befeb9ed3d/designer)

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 19, 2019, 12:09pm UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/17 "2019-11-19T12:09:58Z")

</div>

Do your balls bounce at what coordinates? What is the step of moving the player’s ball? What size balls? You have all these parameters. Make an equation and see. Under what condition do the balls collide? When their bounding rectangles intersect with each other. Do you understand this?

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:46am UTC](https://community.thunkable.com/t/canvas-hitbox-problem/327062/18 "2024-11-08T11:46:40Z")

</div>


