A Basic Game : Pong
Author |
Message |
Foundation
|
Posted: Sat Sep 16, 2006 8:36 am Post subject: A Basic Game : Pong |
|
|
I followed the tutorial and programmed Pong. I know it's an old game, but please if you have any suggestions or advice, please give freely. I am new to programming, so may have used a lot of extra lines that experienced programmers could have omitted. Thanks for your attention.
You can move up, down, left, and right.
P.S. The confetti file is just a very basic entertaining program I created. No viruses or anything bad. , it's very simple, like 20 lines.
Description: |
The game Pong and a little program that creates a lot of confetti. :D |
|
Download |
Filename: |
Pong (with Confetti).rar |
Filesize: |
456.37 KB |
Downloaded: |
332 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Clayton
|
Posted: Sat Sep 16, 2006 4:33 pm Post subject: (No subject) |
|
|
first of all, when you are posting you .exes, plz just compress them with winZip or WinRar so that its not taking up massive amounts of space
on to the program, not bad, but try to keep it so that the paddles dont go off the screen, and make it so that the players have a bit of time before the ball starts to move other than that good job
|
|
|
|
|
|
Foundation
|
Posted: Mon Sep 18, 2006 7:31 am Post subject: (No subject) |
|
|
Thanks for the advice , I will put all my future files in a zip folder. I tried to make it so that the paddles go off the bottom and appear on the top. And if it goes out on the sides, or the middle, it will appear in the middle or on the sides respectively. I will try harder to make a good program in the future.
Now, it pauses a second before starting the game every time.
P.S. Is there any way of making this "Looped Confetti" more efficient?
code: |
var x, y, c : int;
setscreen ("graphics:640;480,position:center;center,nobuttonbar,offscreenonly,title: Confetti -- By Foundation")
var font := Font.New ("impact:24:bold,italic")
var font2 := Font.New ("comicsans:24:bold")
for i : 1 .. 1000
randint (c, 1, 15)
Font.Draw ("We Give You : continuous CONFETTI!!!", 75, maxy div 2, font, c)
delay (3)
View.Update
cls
end for
delay (500)
var start : string (1)
for i : 1 .. 500
randint (c, 1, 255)
Font.Draw ("Well, Press a Button!", 150, maxy div 2, font2, c)
put "Press a button to exit."
delay (3)
View.Update
cls
end for
getch (start)
var ending : string (1)
setscreen ("nooffscreenonly")
loop
for i : 1 .. 768000
randint (x, 0, maxx);
randint (y, 0, maxy);
randint (c, 1, 15);
drawdot (x, y, c);
end for
for i : 1 .. 3072000
randint (x, 0, maxx);
randint (y, 0, maxy);
c := 255;
drawdot (x, y, c);
end for
for i : 1 .. 2304000
randint (x, 0, maxx);
randint (y, 0, maxy);
c := 0;
drawdot (x, y, c);
end for
end loop
|
|
|
|
|
|
|
TheOneTrueGod
|
Posted: Mon Sep 18, 2006 9:51 pm Post subject: (No subject) |
|
|
Er, not have it?
You could allways use math... Have an array of numbers, from 0 to maxx*maxy, each one representing a pixel on the screen. Then, just randomize the order of these integers, and draw a random colour on each one in turn. This will ensure that the entire screen gets covered, and it would be the minimal time that you could do it in (if you use individual pixels). Either way, this sort of effect really isn't worth the effort...
|
|
|
|
|
|
Foundation
|
Posted: Tue Sep 19, 2006 7:31 am Post subject: (No subject) |
|
|
Oh. So to have limited random effect... and random cover the entire screen. .
That would take less time...
|
|
|
|
|
|
BenLi
|
Posted: Tue Sep 19, 2006 8:05 am Post subject: (No subject) |
|
|
well i guess this kind of thing is the first step to making more advanced effects and graphics...
|
|
|
|
|
|
|
|