# Dynamic Scores, (I am a noob with dynamics)

**URL:** <https://forum.kirupa.com/t/dynamic-scores-i-am-a-noob-with-dynamics/184522>\
**Category:** Uncategorized\
**Created:** [April 5, 2006, 6:19pm UTC](https://forum.kirupa.com/t/dynamic-scores-i-am-a-noob-with-dynamics/184522 "2006-04-05T18:19:04Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![woad](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@woad](https://forum.kirupa.com/u/woad)\
**Post date:** [April 5, 2006, 6:19pm UTC](https://forum.kirupa.com/t/dynamic-scores-i-am-a-noob-with-dynamics/184522/1 "2006-04-05T18:19:04Z")

</div>

Ok so I’ve started another project, a pong game, it’s nearly finished except for the scorecount.

On the ball movieclip:

if (this.\_x\>\_root.Pad.\_x) {  
\_root.LeftScore += 1;  
}  
if (this.\_x\<\_root.EnPad.\_x) {  
\_root.RightScore += 1;  
}

So if the ball is behind a paddle give the score to the opposite player. This is onClipEvent (EnterFrame) so it’s doing it every frame.

On the Actions frame:

LeftScore = 0;  
RightScore = 0;  
stop();

---

<div class="post-metadata">

**Author:** ![ricer](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@ricer](https://forum.kirupa.com/u/ricer)\
**Post date:** [April 5, 2006, 7:26pm UTC](https://forum.kirupa.com/t/dynamic-scores-i-am-a-noob-with-dynamics/184522/2 "2006-04-05T19:26:17Z")

</div>

Give it a enterframe

and make the dynamic “scoreboard” a “var” and link em with the other script 🙂

the left dynamic board should have:

```auto
 LeftScore

```

as Variable

and the right

```auto
RightScore

```

---

<div class="post-metadata">

**Author:** ![woad](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@woad](https://forum.kirupa.com/u/woad)\
**Post date:** [April 5, 2006, 9:11pm UTC](https://forum.kirupa.com/t/dynamic-scores-i-am-a-noob-with-dynamics/184522/3 "2006-04-05T21:11:21Z")

</div>

That only makes them say ‘a’

---

<div class="post-metadata">

**Author:** ![bombsledder](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bombsledder](https://forum.kirupa.com/u/bombsledder)\
**Post date:** [April 6, 2006, 12:09am UTC](https://forum.kirupa.com/t/dynamic-scores-i-am-a-noob-with-dynamics/184522/4 "2006-04-06T00:09:22Z")

</div>

ricer that doesn’t explain too much to someone that doesn’t know exactly how to do it, now i think you might be using little line as walls? or not, i wish you would have explained your setup a little better…

frame:

```auto

var LeftScore:Number = 0;
var RightScore:Number = 0;
stop();

```

ball:

```auto

on(EnterFrame){

 if (this._x>_root.Pad._x) {
trace("left")
_root.LeftScore++;
};

if (this._x<_root.EnPad._x) {
trace("right")
_root.RightScore ++;
};

}

```

now the score will increase not sure what your problem exactly was but after that you only wan’t it to add score once so i would make a function that will reset the game if you don’t already have it in your version

---

<div class="post-metadata">

**Author:** ![woad](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@woad](https://forum.kirupa.com/u/woad)\
**Post date:** [April 6, 2006, 3:04am UTC](https://forum.kirupa.com/t/dynamic-scores-i-am-a-noob-with-dynamics/184522/5 "2006-04-06T03:04:40Z")

</div>

Nope, that didn’t seem to do anything for it.

I’ll post the fla

---

<div class="post-metadata">

**Author:** ![hybrid101](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@hybrid101](https://forum.kirupa.com/u/hybrid101)\
**Post date:** [April 6, 2006, 5:44am UTC](https://forum.kirupa.com/t/dynamic-scores-i-am-a-noob-with-dynamics/184522/6 "2006-04-06T05:44:57Z")

</div>

darn, flash 8  
could you convert to mx 2004 professional?

---

<div class="post-metadata">

**Author:** ![woad](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@woad](https://forum.kirupa.com/u/woad)\
**Post date:** [April 6, 2006, 5:54pm UTC](https://forum.kirupa.com/t/dynamic-scores-i-am-a-noob-with-dynamics/184522/7 "2006-04-06T17:54:09Z")

</div>

Yeah sure, here’s the Flash 7 version

---

<div class="post-metadata">

**Author:** ![Joppe](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@Joppe](https://forum.kirupa.com/u/Joppe)\
**Post date:** [April 6, 2006, 6:21pm UTC](https://forum.kirupa.com/t/dynamic-scores-i-am-a-noob-with-dynamics/184522/8 "2006-04-06T18:21:19Z")

</div>

\_root.RightScore.text ++;

try that

---

<div class="post-metadata">

**Author:** ![bombsledder](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bombsledder](https://forum.kirupa.com/u/bombsledder)\
**Post date:** [April 6, 2006, 7:25pm UTC](https://forum.kirupa.com/t/dynamic-scores-i-am-a-noob-with-dynamics/184522/9 "2006-04-06T19:25:15Z")

</div>

never said that they were textboxes… and didn’t look at the fla so i guess joppe gets the credit =( [whisper]cries[/whisper]

---

<div class="post-metadata">

**Author:** ![Joppe](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@Joppe](https://forum.kirupa.com/u/Joppe)\
**Post date:** [April 7, 2006, 11:11am UTC](https://forum.kirupa.com/t/dynamic-scores-i-am-a-noob-with-dynamics/184522/10 "2006-04-07T11:11:15Z")

</div>

lol, no Bomb you get all the credit 🙂 😉

---

<div class="post-metadata">

**Author:** ![woad](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@woad](https://forum.kirupa.com/u/woad)\
**Post date:** [April 7, 2006, 11:20pm UTC](https://forum.kirupa.com/t/dynamic-scores-i-am-a-noob-with-dynamics/184522/11 "2006-04-07T23:20:12Z")

</div>

Thx joppe and bomb

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [April 7, 2006, 11:31pm UTC](https://forum.kirupa.com/t/dynamic-scores-i-am-a-noob-with-dynamics/184522/12 "2006-04-07T23:31:11Z")

</div>

better method…  
(the code’s prettier)
