Sign in to follow this  
Followers 0
APPLEEATER

C Pong Help

6 posts in this topic




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 this post


Link to post
Share on other sites

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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?!?

Share this post


Link to post
Share on other sites

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

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0