Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
PONG GAME (VB6)
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="St4nley" data-source="post: 211617" data-attributes="member: 31081"><p>Ok so i'm making pong, i got basically all collision start from space bar but, when it collides even if the paddle isnt there it'll still collide and go back the other way,</p><p> </p><p>heres my code</p><p> </p><p>[CODE]</p><p>Dim goodVel As Integer</p><p>Dim goodvel1 As Integer</p><p>Private Sub Form_Load()</p><p> goodVel = 50</p><p> goodvel1 = 0</p><p>End Sub</p><p>Private Sub Timer1_Timer()</p><p>imgball.Left = imgball.Left - goodvel1</p><p> </p><p>If imgball.Left + imgball.Width > imgPaddle.Left + 400 Then</p><p> goodvel1 = goodvel1 * -1</p><p>End If</p><p> </p><p>If imgball.Left < imgPaddle.Height - 1000 Then</p><p>goodvel1 = goodVel * -1</p><p>End If</p><p> </p><p>End Sub</p><p> </p><p>Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)</p><p>If Button = 1 Then</p><p>imgPaddle.Top = Y</p><p>imgPaddle.Width = Form2.ScaleHeight</p><p>End If</p><p>End Sub</p><p>Private Sub Form_keydown(keycode As Integer, Shift As Integer)</p><p> If keycode = vbKeySpace Then</p><p> goodvel1 = goodVel * -1</p><p> imgball.Top = imgball.Top - goodVel</p><p> End If</p><p>End Sub</p><p>[/CODE]</p><p> </p><p>if you have vb6 and want to try this yourself then i can simply send you a paddle and a ball to implement this yourself.</p></blockquote><p></p>
[QUOTE="St4nley, post: 211617, member: 31081"] Ok so i'm making pong, i got basically all collision start from space bar but, when it collides even if the paddle isnt there it'll still collide and go back the other way, heres my code [CODE] Dim goodVel As Integer Dim goodvel1 As Integer Private Sub Form_Load() goodVel = 50 goodvel1 = 0 End Sub Private Sub Timer1_Timer() imgball.Left = imgball.Left - goodvel1 If imgball.Left + imgball.Width > imgPaddle.Left + 400 Then goodvel1 = goodvel1 * -1 End If If imgball.Left < imgPaddle.Height - 1000 Then goodvel1 = goodVel * -1 End If End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 1 Then imgPaddle.Top = Y imgPaddle.Width = Form2.ScaleHeight End If End Sub Private Sub Form_keydown(keycode As Integer, Shift As Integer) If keycode = vbKeySpace Then goodvel1 = goodVel * -1 imgball.Top = imgball.Top - goodVel End If End Sub [/CODE] if you have vb6 and want to try this yourself then i can simply send you a paddle and a ball to implement this yourself. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
PONG GAME (VB6)
Top