# Arkanoid like game 1st one of mine :)

**URL:** <https://forum.kirupa.com/t/arkanoid-like-game-1st-one-of-mine/154234>\
**Category:** programming\
**Created:** [July 7, 2005, 10:42pm UTC](https://forum.kirupa.com/t/arkanoid-like-game-1st-one-of-mine/154234 "2005-07-07T22:42:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcfly\_tm](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mcfly\_tm](https://forum.kirupa.com/u/mcfly_tm)\
**Post date:** [July 7, 2005, 10:42pm UTC](https://forum.kirupa.com/t/arkanoid-like-game-1st-one-of-mine/154234/1 "2005-07-07T22:42:28Z")

</div>

Thanks to the great tut ive found on this page i made my first flash game :-). I started to “tune” it a little bit and meet problems while changing bouncing “engine”…  
This is the part of AS responsible for bouncing of the paddle :  
[AS]  
else if (this.y \> pGame.barLevel - this.\_height/2) {

```
    var l = bar._x - bar._width/2;

    var r = bar._x + bar._width/2;

    if (this.x &gt; l && this.x &lt; r) {

        trace ("Collision with the bar") ;

        this.y = pGame.barLevel - this._height/2;
        this.vy *= -1;

    }

```

[/AS]  
this.vy \*= -1; this particular line “tells” ball to bounce in 90 degrees angle ( basically that means ball can only have two directions right ( 45 degrees) and left (-45 degrees)).

The million dollar question is : how can I change code so that angle of bounce would be determined by the point in which ball hits the paddle ? I have to add that the closer ball is to the end of paddle the “flatter” angle should be… can somebody help me with that ?  
thanks in forward 🙂
