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.

2D All the way! / 2d PONG

Author
Message
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 29th Jul 2004 07:36 Edited at: 29th Jul 2004 07:43
Help I'm a n00b to BASIC and I keep trying to make a 2d pong using DarkBASIC, but all i keep getting is The Ring heheh. Here's a scaled picture:


My question is how do you fill the circle up?


http://www.jibjab.com/<-Bush and Kerry Diss each other. Very Funny stuff.
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Jul 2004 07:51
You could draw a ball in an art package, then you can load Image, and use it as a sprite.

They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 29th Jul 2004 08:21 Edited at: 29th Jul 2004 08:22
i guess but isn't there a fill command?
you see im new so i want to learn as much as i can. Without my head exploding.


http://www.jibjab.com/<-Bush and Kerry Diss each other. Very Funny stuff.
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 29th Jul 2004 08:23 Edited at: 29th Jul 2004 08:25
sorry for the double post, but i'm looking through the reference manual (DBPro)and there is none. Strange. lemme look in the index


http://www.jibjab.com/<-Bush and Kerry Diss each other. Very Funny stuff.
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Jul 2004 09:14
Well you may as well learn how to load images. It's one of the main things that you need to learn.

the_winch
22
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 29th Jul 2004 12:48
There is a FilledCircle() function in this codebase entry
http://www.thegamecreators.com/?m=codebase_view&i=c6a376253a019691f5fcc97de1c5247a

down at fraggle rock
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 30th Jul 2004 01:35
Thanks but i'll just use Sprites. I just made some and it would be a waste. Does anyone know how to get the sprite in the game?

Oh im such a n00b...


http://www.jibjab.com/<-Bush and Kerry Diss each other. Very Funny stuff.
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 30th Jul 2004 02:14
Load Image "SpriteImage.bmp",1

where there is a circle command, replace it with.....

Sprite 1,x,y,1

The x,y can be replaced for whatever the circle uses as a token.

They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 30th Jul 2004 02:36 Edited at: 30th Jul 2004 03:47
Ok here's what i have so far:

All i see is BLack.


http://www.jibjab.com/<-Bush and Kerry Diss each other. Very Funny stuff.
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 30th Jul 2004 03:21
Put a sync in there! Also, you didn't need to start all over again, just put the sprite line in the circle line.


Do

Sync
`***End***
Loop

They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 30th Jul 2004 03:41 Edited at: 30th Jul 2004 03:52
Ok here is what i'm getting now:

and here is the code:

Why wont the other paddle show? Is it offscreen?


http://www.jibjab.com/<-Bush and Kerry Diss each other. Very Funny stuff.
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 30th Jul 2004 03:54 Edited at: 30th Jul 2004 03:56
Wait yes it was. since the coordinate you choose only moves the image from the topleft corner of the picture, and i picled 1024 768 it was offscreen.
Here is the new screenshot.

and the code

Edit: I'll be moving that paddle a little to the right shortly.
edit: ok i moved it right.


http://www.jibjab.com/<-Bush and Kerry Diss each other. Very Funny stuff.
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 30th Jul 2004 03:59 Edited at: 30th Jul 2004 04:05
OK I got it to the left and everything shows up. (halleluiah) Now all i have to do is make the sprites transparent and making them move.

let me see if i can do the transparency myself
by looking in the manual.


http://www.jibjab.com/<-Bush and Kerry Diss each other. Very Funny stuff.
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 30th Jul 2004 04:11
Oh great the background transparency color is black and i set it to that bright pink thinking that i could set the BG transparency color. Better make the BG black.


http://www.jibjab.com/<-Bush and Kerry Diss each other. Very Funny stuff.
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 30th Jul 2004 04:17 Edited at: 30th Jul 2004 09:30
Thanks for all the help.
Finally here it is with transparent BG's.




I'm going to figure the rest out myself (using the reference guide and example code.) Thanks for helping.


http://www.jibjab.com/<-Bush and Kerry Diss each other. Very Funny stuff.
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 30th Jul 2004 12:06 Edited at: 30th Jul 2004 13:55
I know i said i would figure it out myself but um... help?

I cant make the ball speed up when it hits the paddles and whenever it does speed up the loop goes and makes it move slowly again. It also chnges the rotation and makes it move to the left, making it go off the screen. I've included the source code and would have included and animated GIF, but those take hours to make...(well not really ). Oh and whenever the ball hits the invisible background, the ball bounces without hiitng the non-invisible part. Can someone help me with all of this?

BTW (as if this couldn't be anymore obvious) this is my first actual game, so please forgive me if i asked any stupid questions or got on your nerves.
It's getting kinda late too, so i'm going to stop coding (i've been doing it all day trying to figure out how to use this darn thing, and now its 10:10 PM and i think i'm tired of programming today, so if you guys do answer my question, please wait for me to answer.


http://www.jibjab.com/<-Bush and Kerry Diss each other. Very Funny stuff.
comando 300
21
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 31st Jul 2004 02:21
I know I'm late for this....but here's a little code to fill a circle:




CURRENT PROJECT: RETRO PAC-MAN
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 31st Jul 2004 07:12 Edited at: 31st Jul 2004 07:20
Oh... ok thanks but does anyone know how to properly make it bounce?
Ok I've solved the bg problem, by editing the actual bitmap.

I think the ball won't bounce the right way because of the loop. Does anyone know to get rid of that problem?:-\


http://www.jibjab.com/<-Bush and Kerry Diss each other. Very Funny stuff.
the_winch
22
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 31st Jul 2004 11:38
Try this



Also have a look at my first pong game thread in the newcommers forum. It uses planes innstead of sprites but the principles are still the same.
http://forum.thegamecreators.com/?m=forum_view&t=22030&b=7
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 13th Aug 2004 02:59
So the GET Image Command sorta make a snapshot of an area of the screen?


Sorry for not posting in so long, I had to take a small break from DarkBASIC. I think im ready to try again though.


Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 13th Aug 2004 03:33
Quote: "So the GET Image Command sorta make a snapshot of an area of the screen?
"


Well more like a copy/paste command really.

They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 13th Aug 2004 03:44 Edited at: 13th Aug 2004 03:48
ok so im not that far off.


Ok so why not use the move sprite command.=P

EDIT: Oh because Sprite Move only moves it in 1 direction, and this way you can get it to move along both the y and x axis. Plus you can change the direction the speed it moves at way easier.


Login to post a reply

Server time is: 2025-05-17 09:52:27
Your offset time is: 2025-05-17 09:52:27