• (4 Pages)
  • +
  • « First
  • 2
  • 3
  • 4

Creating a fully-functional pong game. A step-by-step guide to creating a pong game in VB.NET Rate Topic: ***** 2 Votes

#46 Vaibhavg GArg  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 25-May 15

Posted 25 May 2015 - 06:11 AM

It was the best ever game I created :bananaman: ...Can you please explain, how to increase the speed...I couldn't find a suitable place to put the code that increases the speed...please explain...I'm 15 yrs old :helpsmilie: ...
And one more thing i want to ask is, will the computer ever loose the game... :sarcasm: ..it might be good if it does...if no..no problem..thanxx for the great tutorial... :bigsmile:
Was This Post Helpful? 0
  • +
  • -

#47 andrewsw  Icon User is online

  • I'm not here to twist your niblets
  • member icon

Reputation: 4714
  • View blog
  • Posts: 17,514
  • Joined: 12-December 12

Posted 25 May 2015 - 06:19 AM

    Dim speed As Single = 10 ' Ball Speed


What happens if you change that value..?

Several people have mentioned changing the speed or allowing the computer to lose. Read the entire thread.
Was This Post Helpful? 0
  • +
  • -

#48 Vaibhavg GArg  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 25-May 15

Posted 25 May 2015 - 07:13 AM

View Postandrewsw, on 25 May 2015 - 06:19 AM, said:

    Dim speed As Single = 10 ' Ball Speed


What happens if you change that value..?

Several people have mentioned changing the speed or allowing the computer to lose. Read the entire thread.



But I wanna increase this value when the game is on...I don't know how to do it...
Was This Post Helpful? 0
  • +
  • -

#49 andrewsw  Icon User is online

  • I'm not here to twist your niblets
  • member icon

Reputation: 4714
  • View blog
  • Posts: 17,514
  • Joined: 12-December 12

Posted 25 May 2015 - 07:17 AM

Did you study and understand the tutorial? What have you attempted?

Note that you do not have to quote the previous post in full, there is a REPLY button further down the page.

This post has been edited by andrewsw: 25 May 2015 - 07:23 AM

Was This Post Helpful? 1
  • +
  • -

#50 Vaibhavg GArg  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 25-May 15

Posted 25 May 2015 - 10:38 PM

Ya...I understood the whole code...I rather found it simple and cool...
I want that as the ball bounces off the surface...the speed increases by 1...So, I added that line...but nothing happens..
If gameBall.Location.Y < 0 Then
gameBall.Location = New Point(gameBall.Location.X, 0)
 yVel = -yVel
speed+=1
End If


I think, every time the ball will bounce off the top wall...the speed of the ball will increase by 1..but nothings seems to happen...

Sorry, I am new to this site (in fact it's the second day... :) )...and I find it very helpful... ^^:)
Was This Post Helpful? 0
  • +
  • -

#51 Vaibhavg GArg  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 25-May 15

Posted 27 May 2015 - 12:32 AM

Thanxx..for no reply :plain: ...I have done it myself...Now I am decrease the interval of the timer to increase the ball speed... :punk:
'bouncing the ball from top
        If Ball.Bounds.IntersectsWith(PictureBox1.Bounds) Then
            Ball.Location = New Point(Ball.Location.X, 45)
            yVel = -yVel
            If Game_Timer.Interval > 0 Then
                Game_Timer.Interval -= 5
            End If
        End If
        '----



Now I am thinking how can I code so that the computer also looses some points :sarcasm:
Was This Post Helpful? 0
  • +
  • -

  • (4 Pages)
  • +
  • « First
  • 2
  • 3
  • 4