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.

Newcomers DBPro Corner / My First Pong Game

Author
Message
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 9th Jan 2004 23:26
I know how the scoring work.But I try the same method and when I make a score, the score is display,but when I make another score the score is write on the old score.
How you erase the old score to replace it for the new score?

Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
demons breath
20
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 11th Jan 2004 22:32
What's wrong with this code please? It's my AI code (player 2 is computer) but the bat only ever moves at the beginning; it won't go in another direction.


Am I the only one here who's really confused?
Chris K
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 12th Jan 2004 20:28
I don't think you need the balla# bit why did you put that in?
Do you only want it to move when the ball is coming towards it? If so, you got the angles the wrong way round it should be:



Mods? Sticky?

demons breath
20
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 13th Jan 2004 19:04
looked fine for a bit but then messed up again - and balla# was right on my one because the computer's on the right.

Am I the only one here who's really confused?
Chris K
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 13th Jan 2004 21:24
Put this in the main loop and it'll work



Alkaline
20
Years of Service
User Offline
Joined: 4th Dec 2003
Location: Seattle, Washington
Posted: 15th Jan 2004 05:24
how do i make it to get to a certain score such as...20 and them say like "yuou won" or "you lost"?

~Adikt Studios, go to the official site at www.Adikt.dbpcommunity.com~
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 15th Jan 2004 19:50
Easy


Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 15th Jan 2004 19:55
sorry, this is the right
Let'supposed your score variable is player1_score and the AI score is player2_score.Then use the next code:


I hope this help

Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
Alkaline
20
Years of Service
User Offline
Joined: 4th Dec 2003
Location: Seattle, Washington
Posted: 17th Jan 2004 03:18
thanks but what i want is that when a player reaches 10 then it stops the game and prints "you won" or "you lost" and then asks if you want to replay and then it starts all over again

~Adikt Studios~
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 17th Jan 2004 04:38


This should work

Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 17th Jan 2004 04:43
Quote: "if score<10 and score_2=20 then Print "You Lost"
input "You want to play again?<Y/N>";answer$
"



That part I made a mistake, the two lines have to be in the same line.
like this:

Quote: "if score<10 and score_2=20 then Print "You Lost" : input "You want to play again?<Y/N>";answer$"


Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
Alkaline
20
Years of Service
User Offline
Joined: 4th Dec 2003
Location: Seattle, Washington
Posted: 17th Jan 2004 05:04
i put that in and every time it goes to it it does this wied thing...heres my code

~Adikt Studios~
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 17th Jan 2004 05:14
oh! ok,I'm thinking in 2D what stupid me.If you want it more cool.I think you have to draw the buttons.Then giving mouse coordinates to the program to know when and where the cursor is pressing the button like

I think if the button start in 20 of the coordinates x and end in 29 and start in 10 of the coordinates y and end in 15.
I think you have to use

for x=20 to 29
for y=10 to 15
if mousex()=x and mousey()=y and mouseclick()=1 then make something
next x
next y

I don't know if it work.

Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
Alkaline
20
Years of Service
User Offline
Joined: 4th Dec 2003
Location: Seattle, Washington
Posted: 17th Jan 2004 05:16
can you help me figure out a way to make it work so you can have the option for reseting the game?

~Adikt Studios~
PiratSS
21
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 17th Jan 2004 05:16
Now make it all a big one tut!

Dual AMD Athlon MP 2x1GHZ | IBM 15000Rpm SCSI 73.4 Gb X 2 | e-GeForce Ti4400 | Audigy 2 + 7.1 Surround sound | 17' Monitor | Ugly mouse
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 17th Jan 2004 05:49
I am not the indicate person,maybe I can try.

You tried to make when you have 10 points or if the enemy have 10 points

Then you print to the screen

Print "If you want to try again press spacekey or if you want to quit press Esc"
if returnkey()=1 then goto start

And the Escapekey you don't have to put an instruction for it cuz whe you press escapekey without to put instructionfor it, it quit the program.

Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 17th Jan 2004 05:51
Quote: "if returnkey()=1 then goto start"


That is
if spacekey()=1 then goto start

Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
Alkaline
20
Years of Service
User Offline
Joined: 4th Dec 2003
Location: Seattle, Washington
Posted: 17th Jan 2004 07:00
nobody seems to explain any thing. ok when a player reaches a score of 10 i want it to stop the game and ask if he/she want to quit or restart the game. Any if they restart the game it goes to the begining of my code and starts all over. can anybody help? my code is pasted below.

~Adikt Studios~
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 17th Jan 2004 07:56
Well, I dunno

You can get that effect if one the player reach 10 of score then hide all objects.And then put the messsenge if he/she want to play again.

Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
Neb the only
20
Years of Service
User Offline
Joined: 16th Jan 2004
Location:
Posted: 18th Jan 2004 06:13
WICKED tutorial!!! I thank you {--------------- ----------------}
much i can't express how much that helped
thankyou in short
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 18th Jan 2004 06:41
That really help you?

I think you can use this too
do
repeat
commands go here
until playe1_score=20 or player2_score=20
if player1_score=20 and player2_score<>20 then print "win"
if player1_score<>20 and player2_score=20 then print "lose"
loop

Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
Chris K
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 18th Jan 2004 11:54
I think he was talking to me, me being the one who actually did the tutorial, you being the one who posted incorrect Code Snippits at the end.

comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 18th Jan 2004 17:36
Heheehehehehehehe

Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
Don Malone
21
Years of Service
User Offline
Joined: 27th Apr 2003
Location: Birmingham, Alabama
Posted: 19th Jan 2004 05:10
adikt.

Think like this as program development exercise.

1) You know what you want to do.
a) Check Score
b) If score is your target then ask pleyer "Play Again?"
c) get answer and process, either prepare to end or reset variables such as game speed, scores and whatever else is need before returning to game start. You game start may already reset the game in which case you could just jumb to game start with one of those disliked goto commands. To use to goto or gosub commands make sure you have created a label to jump to to restart the program.

How you write it is based upon how you are or have written the other parts. If you want more specifics it will not be that hard but this is a great exercise in program development.

Wasting CPU Cycles since the 286 was a hot machine.
Alkaline
20
Years of Service
User Offline
Joined: 4th Dec 2003
Location: Seattle, Washington
Posted: 19th Jan 2004 05:16
when every i put a goto command in it just skips it and gives me a sytax error

~Adikt Studios~
Chris K
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 19th Jan 2004 16:02
You need to do it like this:



greenlig
20
Years of Service
User Offline
Joined: 30th Aug 2003
Location: Melbourne
Posted: 20th Jan 2004 12:24
Goto's dont return though... Try a gosub or a function

I got best and fairest for soccer WHOOHOOO!
Alkaline
20
Years of Service
User Offline
Joined: 4th Dec 2003
Location: Seattle, Washington
Posted: 22nd Jan 2004 04:21
when every i use that the text only flashes

~Adikt Studios~
Chris K
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 22nd Jan 2004 22:58
You need to add a SUPSEND FOR KEY in there, else it will only keep it for one sync (1/60th of a second)

GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 23rd Jan 2004 18:57
how can I appy a texture to the object instead of a boring color?

just code
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 23rd Jan 2004 19:15
texture object object number,image number

Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
Chris K
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 23rd Jan 2004 20:24
Yep.

You need to

- put the texture in the project file
- add LOAD IMAGE "filename.jpg/.bmp",1
- add TEXTURE OBJECT 1,1


Something like:



BearCDPOLD
20
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 28th Jan 2004 05:27
hey....this thread was a good idea.
...bump...

Juvenile Industries
Current Project: KillZone(FPS)
Soon to come:An rts, and a snowball fight game
Chris K
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 28th Jan 2004 10:11
Yup.

Can a mod sticky it pleeeeeeeeeaaaaaaaaaassssssseeeee?

Chris K
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 30th Jan 2004 23:13
Stick stick stick stick stick stick sticky.

Chris K
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 5th Feb 2004 20:34
How come that other tutorial gets stickied and this one dies? eh??

Wulvgar
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location: US
Posted: 6th Feb 2004 01:14
this one needs sticking.

It's the best starter one I've seen so far.

much better than what comes with the program.
Uber Krystoff
20
Years of Service
User Offline
Joined: 3rd Feb 2004
Location:
Posted: 6th Feb 2004 20:06


do i see 20 lines of code? i think i do? wow if your not a teacher already you should be chris, WOW. write some tutorials

There are 10 types of people in the world, those who understand binary and those who don't.
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 6th Feb 2004 21:56
Quote: " How come that other tutorial gets stickied and this one dies? eh??"


Don't know.

You should perhaps go through all your posts and sumerise it into a simgle big post or stick it on a website.

Our civilization faces three great dangers. The first is destruction by a nuclear war, the second is being crippled with overpopulation and the third is the Age of Leisure.
Chris K
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 8th Feb 2004 17:50
How about, you don't need to sticky it but can someone please go through and delete all the useless posts so that it doesn't get too cluttered.

Uber Krystoff
20
Years of Service
User Offline
Joined: 3rd Feb 2004
Location:
Posted: 9th Feb 2004 02:30
here's my version of pong:


It does have some bugs but they are minor.

There are 10 types of people in the world, those who understand binary and those who don't.
Uber Krystoff
20
Years of Service
User Offline
Joined: 3rd Feb 2004
Location:
Posted: 9th Feb 2004 02:33
OOPS! forgot to remove some of the sounds in the above version, bottom one is fixed



There are 10 types of people in the world, those who understand binary and those who don't.
anseyder
20
Years of Service
User Offline
Joined: 25th Sep 2003
Location: Australia
Posted: 10th Feb 2004 05:00
early in the piece you mentioned you would take everything you have done in this forum and turn it into a tutorial - is there a text file with all this great information anywhere that I can download please?

buy the PS2 Game Firewarrior (I worked on it as a level artist)
Chris K
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 10th Feb 2004 21:20
Ummmm..... what do you mean?

Just read it on the forums. It breaks it up nicely.

Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 11th Feb 2004 21:52
I have got up to the bit where you get the balls to bounce. However it bounces off 1 and then goes through the other depending on which is moved first.



Also i am using DBPro and i copied your code in and i just got a blank screen.

Please help
Chris K
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 18th Feb 2004 15:26
I know why that isn't working ........ can anyone else see?

comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 18th Feb 2004 18:55 Edited at: 18th Feb 2004 18:58
I know why!

if ballx#>4 and ballx#<4.5 and ABS(player1pos#-ballz#)<1.5 then balla#=360-balla#
if ballx#<-4 and ballx#>-4.5 and ABS(player2pos#-ballz#)>-1.5 then balla#=180-balla#

it's supposed to be likse this

if ballx#>4 and ballx#<4.5 and ABS(player1pos#-ballz#)<1.5 then balla#=360-balla#
if ballx#<-4 and ballx#>-4.5 and ABS(player2pos#-ballz#)<1.5 then balla#=360-balla#

and he don't check the ball be less than 360 degrees

balla#=wrapvalue(balla#)

CURRENT PROJECT: RETRO PAC-MAN
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 18th Feb 2004 19:02
but there's another problem and I dunno what it is!

CURRENT PROJECT: RETRO PAC-MAN
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 18th Feb 2004 20:18
It all appears to be working know. There was a couple of things wrong.

f ballx#>4 and ballx#<4.5 and ABS(player1pos#-ballz#)<1.5 then balla#=360-balla#
if ballx#<-4 and ballx#>-4.5 and ABS(player2pos#-ballz#)<1.5 then balla#=360-balla#

should be
if ballx#>4 and ballx#<4.5 and ABS(player2pos#-ballz#)<1.5 then balla#=360-balla#
if ballx#<-4 and ballx#>-4.5 and ABS(player1pos#-ballz#)<1.5 then balla#=360-balla#

You also want to set a sync rate or use someother method to keep the speed constant on fast and slow computers.

Our civilization faces three great dangers. The first is destruction by a nuclear war, the second is being crippled with overpopulation and the third is the Age of Leisure.
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 19th Feb 2004 13:39
Thanks for that. I've managed to get it working now. I'm just working on the scoring bit so when a player reaches 20 points it prints Player 1/2 won and starts again.

Cheers,

Michael

Intel Celron 2.6ghz, 256 MB Ram, 80gb HD,D DVD Rom, CD Rewriter,17" Flat pannel Monitior and DB Pro

Login to post a reply

Server time is: 2024-05-02 18:48:26
Your offset time is: 2024-05-02 18:48:26