# Question About Game Idea (Breakout / Arkanoid)

**URL:** <https://discourse.processing.org/t/question-about-game-idea-breakout-arkanoid/38565>\
**Category:** Coding Questions\
**Created:** [August 31, 2022, 1:03am UTC](https://discourse.processing.org/t/question-about-game-idea-breakout-arkanoid/38565 "2022-08-31T01:03:50Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [August 31, 2022, 7:57pm UTC](https://discourse.processing.org/t/question-about-game-idea-breakout-arkanoid/38565/21 "2022-08-31T19:57:13Z")

</div>

> [@Chrisir](#):
>
> ` bally+ballr/2>recty-23`

I think here was my mistake, it must be \> here

(you had ` bally<recty+40) { ` and this applies almost always)

AND it works only when you attach the if-clause before

```auto
if (bally-ballr/2>height) {
    reset();
  }

```

to the paddle-if-clause by …else if.

Then, we check for the paddle only when it’s not hitting the screen border

**Remark 1**

you had also

```auto
        yspeed *= -4;

```

which means the speed gets 4 times faster which is way too fast;

```auto
        yspeed = -4;

```

is enough.

**Remark 2**

You don’t take into account the radius add it upon checking the screen borders etc.

**Remark 3**

instead of working with a fixed speed, try random values.

```auto
xspeed = random(2,6); 
yspeed = random(2,6);

```

_Reflection_

This means for negative values instead of `yspeed = -4;` say  
` yspeed = - abs (yspeed); // always negative`

for positive value: `yspeed = abs (yspeed); // always positive`

abs() just means give me the positive value from whatever comes in (the absolute).

**Remark 4**

Consider to make the edges of the paddle round and to change the kind of reflection.  
When the ball hits the edge from the right, also the speedx could change e.g.

---

<div class="post-metadata">

**Author:** ![newprogrammer12](https://avatars.discourse-cdn.com/v4/letter/n/9f8e36/32.png) [@newprogrammer12](https://discourse.processing.org/u/newprogrammer12)\
**Post date:** [August 31, 2022, 8:03pm UTC](https://discourse.processing.org/t/question-about-game-idea-breakout-arkanoid/38565/22 "2022-08-31T20:03:06Z")

</div>

it works! thanks for the help! i missed that \*= im not really sure why i added it. i think the rest of what i am going to do will be easier now that ive finished this part. thanks again!

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [August 31, 2022, 8:22pm UTC](https://discourse.processing.org/t/question-about-game-idea-breakout-arkanoid/38565/23 "2022-08-31T20:22:53Z")

</div>

please consider my remarks

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [August 31, 2022, 11:05pm UTC](https://discourse.processing.org/t/question-about-game-idea-breakout-arkanoid/38565/24 "2022-08-31T23:05:54Z")

</div>

> **[Collision Detection](http://jeffreythompson.org/collision-detection/circle-rect.php)**
>
> An online book about collision detection using Processing.

[Previous page](https://discourse.processing.org/t/question-about-game-idea-breakout-arkanoid/38565.md?page=1)
