Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › How To Make a Bouncing Ball

How To Make a Bouncing Ball

Posts 1–5 of 5 · Page 1 of 1
Zoom
Zoom
How To Make a Bouncing Ball
Welcome to my first tutorial.

You will need:

Visual basic
A application
A timer!

.................................................. .................

Add this to the over form1_load like this:

Code:
Public Class Form1
    Dim m_Dx As Integer
    Dim m_Dy As Integer
    Dim m_X As Integer
    Dim m_Y As Integer
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
All the Dim is X and Y axis for the ball....

Then


And add this code to form1_load.

Code:
 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim rnd As New Random
        m_Dx = rnd.Next(1, 4)
        m_Dy = rnd.Next(1, 4)
        m_X = rnd.Next(0, Me.ClientSize.Width - 50)
        m_Y = rnd.Next(0, Me.ClientSize.Height - 50)
    End Sub
What that code does is to move the bounching ball to a random move....... Between 1 and 4!

Then

Add this code to make a ball.

Code:
e.Graphics.Clear(Me.BackColor)
        e.Graphics.FillEllipse(Brushes.Black, m_X, m_Y, 100, 100)
        e.Graphics.DrawEllipse(Pens.Black, m_X, m_Y, 100, 100)
Then

Set timer1.interval = 1 and make it enabled.
this code to the timer!
Code:
   m_X += m_Dx
        If m_X < 0 Then
            m_Dx = -m_Dx
            Beep()
        ElseIf m_X + 50 > Me.ClientSize.Width Then
            m_Dx = -m_Dx
            Beep()
        End If
        m_Y += m_Dy
        If m_Y < 0 Then
            m_Dy = -m_Dy
            Beep()
        ElseIf m_Y + 50 > Me.ClientSize.Height Then
            m_Dy = -m_Dy
            Beep()
        End If
        Me.Invalidate()
That code moves the ball and and makes a beep sound when it´s hits the wall.

Creditz for the code: environmentalnerd53.
Me for the tutorial and some editing.

............................................

Full code:
Code:
Public Class Form1
    Dim m_Dx As Integer
    Dim m_Dy As Integer
    Dim m_X As Integer
    Dim m_Y As Integer
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim rnd As New Random
        m_Dx = rnd.Next(1, 4)
        m_Dy = rnd.Next(1, 4)
        m_X = rnd.Next(0, Me.ClientSize.Width - 50)
        m_Y = rnd.Next(0, Me.ClientSize.Height - 50)
    End Sub
    Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        e.Graphics.Clear(Me.BackColor)
        e.Graphics.FillEllipse(Brushes.Black, m_X, m_Y, 50, 50)
        e.Graphics.DrawEllipse(Pens.Black, m_X, m_Y, 50, 50)
    End Sub
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        m_X += m_Dx
        If m_X < 0 Then
            m_Dx = -m_Dx
            Beep()
        ElseIf m_X + 50 > Me.ClientSize.Width Then
            m_Dx = -m_Dx
            Beep()
        End If
        m_Y += m_Dy
        If m_Y < 0 Then
            m_Dy = -m_Dy
            Beep()
        ElseIf m_Y + 50 > Me.ClientSize.Height Then
            m_Dy = -m_Dy
            Beep()
        End If
        Me.Invalidate()
    End Sub
End Class
............................................

Final Resultat:

#1 · 16y ago
maarten551
maarten551
wow impressive script i gonna test i tomorrow :P
#2 · 16y ago
AS
Asians
It works. :'D Funny.
#3 · 16y ago
Zoom
Zoom
Quote Originally Posted by Asians View Post
It works. :'D Funny.
No problem...
#4 · 16y ago
K4GE
K4GE
Lol nice tut
#5 · 16y ago
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

  • How I make wallhack?By RaidenDXX in WarRock - International Hacks
    6Last post 20y ago
  • How to make a ZombieBy arunforce in Art & Graphic Design
    2Last post 20y ago
  • How to make the server runBy wowhaxor in Gunz General
    3Last post 20y ago
  • How to make a working NFV HackBy System79 in Game Hacking Tutorials
    1Last post 20y ago
  • How to make a game?By Dave84311 in General
    4Last post 20y ago

Tags for this Thread

#ball#bouncing#make