
-----------------------------------
Foundation
Sat Sep 16, 2006 8:36 am

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.  :D , it's very simple, like 20 lines.

-----------------------------------
Clayton
Sat Sep 16, 2006 4:33 pm


-----------------------------------
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 :D

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 :P

-----------------------------------
Foundation
Mon Sep 18, 2006 7:31 am


-----------------------------------
Thanks for the advice  :D , 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. :P  And if it goes out on the sides, or the middle, it will appear in the middle or on the sides respectively.  :wink:  I will try harder to make a good program in the future.

Now, it pauses a second before starting the game every time.  :D

P.S. Is there any way of making this "Looped Confetti" more efficient?


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
Mon Sep 18, 2006 9:51 pm


-----------------------------------
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
Tue Sep 19, 2006 7:31 am


-----------------------------------
Oh. So to have limited random effect... and random cover the entire screen. :lol: .

That would take less time...

-----------------------------------
BenLi
Tue Sep 19, 2006 8:05 am


-----------------------------------
well  i guess this kind of thing is the first step to making more advanced effects and graphics...
