# Help with golf game

**URL:** https://forum.kirupa.com/t/help-with-golf-game/138042
**Category:** Uncategorized
**Created:** [February 19, 2005, 9:31am UTC](https://forum.kirupa.com/t/help-with-golf-game/138042 "2005-02-19T09:31:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sandrinik](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@sandrinik](https://forum.kirupa.com/u/sandrinik)
#### Post date: [February 19, 2005, 9:31am UTC](https://forum.kirupa.com/t/help-with-golf-game/138042/1 "2005-02-19T09:31:56Z")

</div>

hi, i’m new of this chat.  
Sorry for my english.  
i have a problem with my golf game. i don’t know how bounce a ball.  
The code of ball is:

```php
 
 
onClipEvent(load){}
onClipEvent(enterFrame){
 if (_root.speed>0) {
 _x +=Math.sin(_root.angle*(Math.PI/180))*_root.speed;
 _y -=Math.cos(_root.angle*(Math.PI/180))*_root.speed;
 _root.speed--;
 if(this.hitTest(_parent._root.muro)){ //bounce with other movieclip
  trace("coll");
  _x -= Math.sin(_root.angle*(Math.PI/180))*_root.speed;
  _y += Math.sin(_root.angle*(Math.PI/180))*_root.speed;
 }
 if(_y<100){ //height of stage
  trace("100");
  _x -= Math.sin(_root.angle*(Math.PI/180))*_root.speed;
  _y += Math.sin(_root.angle*(Math.PI/180))*_root.speed;
  }
 }
}

 

```

thank you very much
