Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / computer in game

Author
Message
gamer n00b
19
Years of Service
User Offline
Joined: 14th Jan 2006
Location:
Posted: 21st Jan 2006 03:44
Is there a code that you can put into a game like ping pong and instead of it being a two player game wou will play a computer? If there is let me know.
x1b
20
Years of Service
User Offline
Joined: 19th Sep 2004
Location:
Posted: 21st Jan 2006 04:41
learn AI

- Do it, Do it Right, Do it right now..
UFO
19
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 23rd Jan 2006 13:45 Edited at: 23rd Jan 2006 13:46
What? That's not very helpful, x1b...
You should make the computer paddle go up if the ball's y coordinate is lower than the paddle, and make it go down it the ball's y coordinate is higher than the paddles.
Here is some code:

Replace bally and compy with the variables used for the ball's y-coordinate, and the computer paddle y coordinate.


Hippopotomonstrosesquippedaliophobia-Fear of long words
gamer n00b
19
Years of Service
User Offline
Joined: 14th Jan 2006
Location:
Posted: 23rd Jan 2006 23:37
what is AI
UFO
19
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 23rd Jan 2006 23:47
Artificial inteligence. That means that the computer will be able to make decisions, like it is intelegent. But you need to code it so it will make the right decisions...


Hippopotomonstrosesquippedaliophobia-Fear of long words
gamer n00b
19
Years of Service
User Offline
Joined: 14th Jan 2006
Location:
Posted: 24th Jan 2006 00:54
ok thanx
gamesmad
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: UK
Posted: 24th Jan 2006 21:50
Sorry, but, LOL...

Will

Team leader of Games Mad! and 3D designer, modeller and animator for Cyrain Studios.
devastation
19
Years of Service
User Offline
Joined: 11th Aug 2005
Location:
Posted: 25th Jan 2006 00:04
lol indeed

he must've skipped playing games and learning terms and gone straight to programming. good for him tho

Your signature has been erased by a mod because it's larger than 600x120...
!!!
19
Years of Service
User Offline
Joined: 29th Jan 2006
Location:
Posted: 3rd Feb 2006 05:01
yea, lol, learn something beforeyou start programming

but likei always say dont post something unless its productive sooooooo *deep breath*

AI is atrifical intelegance, heres a simple pong game(untested):



thats just basic pieces, so you can apply them to your game.

things you could add:

1. goal scoring
2. background
3. etc.

Login to post a reply

Server time is: 2025-05-23 00:18:00
Your offset time is: 2025-05-23 00:18:00