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="Weed" data-source="post: 211629" data-attributes="member: 394"><p>I don't actually know any VB, I've done games in another languages. I'm shooting in the dark here. <img src="/styles/default/xenforo/smilies/emojione/tongue.png" class="smilie" loading="lazy" alt=":p" title="Stick Out Tongue :p" data-shortname=":p" /></p><p> </p><p>Make the computer move to the height the ball is at. So grab it's Y position on the X Y scale, and make the computer move to that height.</p><p> </p><p>Wherever your infinite game loop is, add a line of code to check the ball's Y, and set the paddle to it's Y.</p><p> </p><p>[CODE]</p><p> If Ball.Location.Y > 5 And Ball.Location.Y < Pad.Height - 40 _</p><p> - paddlePlayer.Height Then _</p><p> paddleComputer.Location = New Point(paddleComputer.Location.X, gameBall.Location.Y)</p><p>[/CODE]</p><p></p><p>If you don't have a gameloop, it's sort of vastly important for anything requiring images that refresh/move.</p></blockquote><p></p>
[QUOTE="Weed, post: 211629, member: 394"] I don't actually know any VB, I've done games in another languages. I'm shooting in the dark here. :P Make the computer move to the height the ball is at. So grab it's Y position on the X Y scale, and make the computer move to that height. Wherever your infinite game loop is, add a line of code to check the ball's Y, and set the paddle to it's Y. [CODE] If Ball.Location.Y > 5 And Ball.Location.Y < Pad.Height - 40 _ - paddlePlayer.Height Then _ paddleComputer.Location = New Point(paddleComputer.Location.X, gameBall.Location.Y) [/CODE] If you don't have a gameloop, it's sort of vastly important for anything requiring images that refresh/move. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
PONG GAME (VB6)
Top