# C Pong Help

## Recommended Posts

Hi,

if you haven't seen this already the link is here:

http://www.autoitscript.com/forum/index.php?showtopic=80453

I am looking for someone who could help me with the highscore problem i am having with it...

The functions it uses are:

Updater()

stop()

Thanks

##### Share on other sites

Bump,

plz someone help me with this!

it's not THAT complicated...

i've been testing every little bit one at a time,

and is taking a long time...

##### Share on other sites

Please don't bump within 24 hours of the last post it's rude. Someone will help you when they have time.

##### Share on other sites

Bump,

plz someone help me with this!

it's not THAT complicated...

i've been testing every little bit one at a time,

and is taking a long time...

Could you set \$highscore =0 when you declare it, then add this line in ballcheck?

```Func ballcheck()
If \$paused = False Then
\$pad1 = WinGetPos("           C Pong 1")
\$pad2 = WinGetPos("           C Pong 2")
; Check Y
If \$next[1] < 0 Then
Sign("y")
ElseIf \$next[1] > \$height2 - 10 Then
Sign("y")
EndIf
; Check X
Switch \$signx
Case "-"
If \$next[0] > \$width1 AND \$next[0] < \$width1 + \$padw Then
If \$next[1] > (\$pad1[1] - \$bsize * 2) AND \$next[1] < (\$pad1[1] + \$padh) Then
Sign("x")
\$maxa = \$maxa + Random(0, 1, 1)
\$speed[0] = \$speed[0] + Random(0, 1, 1)
\$speed[1] = Random(1, \$maxa, 1)
\$hits = \$hits + 1
EndIf
EndIf
Case "+"
If \$next[0] > \$width2 - \$bsize AND \$next[0] < \$width2 + \$padw Then
If \$next[1] > (\$pad2[1] - \$bsize * 2) AND \$next[1] < (\$pad2[1] + \$padh) Then
Sign("x")
\$maxa = \$maxa + Random(0, 1, 1)
\$speed[0] = \$speed[0] + Random(0, 1, 1)
\$speed[1] = Random(1, \$maxa, 1)
\$hits = \$hits + 1
EndIf
EndIf
EndSwitch
if \$hits > \$highscore then \$highscore = \$hits;<----------------add this?
EndIf
EndFunc```

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

##### Share on other sites

Could you set \$highscore =0 when you declare it, then add this line in ballcheck?

```Func ballcheck()
If \$paused = False Then
\$pad1 = WinGetPos("           C Pong 1")
\$pad2 = WinGetPos("           C Pong 2")
; Check Y
If \$next[1] < 0 Then
Sign("y")
ElseIf \$next[1] > \$height2 - 10 Then
Sign("y")
EndIf
; Check X
Switch \$signx
Case "-"
If \$next[0] > \$width1 AND \$next[0] < \$width1 + \$padw Then
If \$next[1] > (\$pad1[1] - \$bsize * 2) AND \$next[1] < (\$pad1[1] + \$padh) Then
Sign("x")
\$maxa = \$maxa + Random(0, 1, 1)
\$speed[0] = \$speed[0] + Random(0, 1, 1)
\$speed[1] = Random(1, \$maxa, 1)
\$hits = \$hits + 1
EndIf
EndIf
Case "+"
If \$next[0] > \$width2 - \$bsize AND \$next[0] < \$width2 + \$padw Then
If \$next[1] > (\$pad2[1] - \$bsize * 2) AND \$next[1] < (\$pad2[1] + \$padh) Then
Sign("x")
\$maxa = \$maxa + Random(0, 1, 1)
\$speed[0] = \$speed[0] + Random(0, 1, 1)
\$speed[1] = Random(1, \$maxa, 1)
\$hits = \$hits + 1
EndIf
EndIf
EndSwitch
if \$hits > \$highscore then \$highscore = \$hits;<----------------add this?
EndIf
EndFunc```
That would make the highscore go by the hits,

not the rally time

and that's what i want it to do,

so i could try switching \$rallyt and \$highscore around,

but that doesn't explain why it always comes out to 0:09 if it was on the 2nd + ball

##### Share on other sites

That would make the highscore go by the hits,

not the rally time

and that's what i want it to do,

so i could try switching \$rallyt and \$highscore around,

but that doesn't explain why it always comes out to 0:09 if it was on the 2nd + ball

I still can't get it to work...

NOBODY CAN FIND A PROBLEM?!?

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account

×

• Wiki

• Back

• Git

## Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.