How to make a game of PONG in Excel – part #3

In this tutorial (which is a continuation of part#2) the kinematics of the ball starts being implemented. Two new macros are being introduced, the “Serve” macro and the “Play” macro.

[sociallocker][/sociallocker]

This article has 2 Comments

  1. Surabhi,Open the VBA editor and chech out the macros in the modules. There must be one which takes the coordinates of the cursor on the screen and paste it (scaled) in cell S6. I found it:
    Sub Bat_Tutorial_2()
    [A42] = [BG1].Value
    Dim Pt0 As POINTAPI
    Dim Pt1 As POINTAPI

    RunPause = Not RunPause
    GetCursorPos Pt0
    Do While RunPause = True
    DoEvents
    GetCursorPos Pt1
    [S6] = [P8] * (-Pt1.Y + Pt0.Y)
    Loop
    End Sub

  2. How is the bat2 moving when “Bat” macros is enabled. I am unable to do it. Please help.

Leave a Reply

Your email address will not be published. Required fields are marked *